AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

The little chess bot
 
 

The little chess bot
at first thought chatscript is not an obvious tool for righting a chess program, especially one that can give a good player a hard game.
Imagine an old fashion game of postal chess, a post card saying something like N C6 D4 {or what ever the correct code is}, and how is the wedding planing going? Then a couple of days latter the reply comes back, her mother as taken over, and ive been ordered not to upset her! KB F3. A week latter the response is. Don’t let the dragon have things all her own way, or you’ll never be shot of her. PB7 B6. The idea of this short paragraph is to show that a game of chess is like a conversation between friends.
It might strike you that there are to many possible permutations of moves to make a really good chess bot with chatscript. And you would be right.
The little chess bot can only work if at each move the player makes the best move at each turn. The little chess bot can not play against a player who makes bad moves.

The idea is this, get a load of records of games of good players. Grand masters etc. use these as the rules and responses. Then have chatscript follow a narrative thread that leads to a victory for it.

 

 
  [ # 1 ]

So, your intention is essentially for it to play solely from a very large opening book? It might be that I’ve misunderstood what you’re saying, but I don’t see how this could work. Even without blatantly poor play on the part of the user, there are still simply too many permutations. You could probably get well into the middle game against good play, but not much further.

 

 
  [ # 2 ]

You are looking at billions of permutations. I tried something like this with AIML before abandoning it as an impossible to finish task.

Even doing something similar with tictactoe led to many hundreds of categories. In the end I just wrote some AIML to teach the bot how to play rather than keep a record of every possible move.

 

 
  [ # 3 ]

Cool. This reminds me of Alan Turing’s paper where by example he asked the computer to make a chess move. I didn’t realise it at the time but it doesn’t say anywhere that the computer actually has to be good at it LOL

But surely chess computer programs are a solved problem. Maybe ChatScript can tie into one that’s already available.

 

 
  [ # 4 ]

I have already accepted that little chess bot can not possibly know all of the permutations of a chess board. Now I would ask you to accept that he vast majority of those permutation are never going to occur in real games between competent players.

To better understand what I am thinking.
Imagine a little boy with 2 chess sets, on one he is playing you, on the other he is playing a grandmaster, and all he dose is copy the moves between the 2.

I picked up this idea from an old RI Christmas lecture. 1974 I think.

Having calmed above that a game that has been played can be read like a chatscript narrative, a gambit, followed by a string of rejoinders. Take a thousand or so such ready made scripts and merge them to make one large script with lots of branching points, that can be played forward as games.

What is needed is a good supply of easily editable ready made scripts. Chessgames.com clams to have a database of 739000 games.

 

 
  [ # 5 ]
jp fellows - Jan 11, 2015:

I have already accepted that little chess bot can not possibly know all of the permutations of a chess board. Now I would ask you to accept that he vast majority of those permutation are never going to occur in real games between competent players.

To better understand what I am thinking.
Imagine a little boy with 2 chess sets, on one he is playing you, on the other he is playing a grandmaster, and all he dose is copy the moves between the 2.

I picked up this idea from an old RI Christmas lecture. 1974 I think.

Having calmed above that a game that has been played can be read like a chatscript narrative, a gambit, followed by a string of rejoinders. Take a thousand or so such ready made scripts and merge them to make one large script with lots of branching points, that can be played forward as games.

What is needed is a good supply of easily editable ready made scripts. Chessgames.com clams to have a database of 739000 games.

This is the idea to which I was responding, and the only reason I said that you could possibly get well into the middle game (which would be a hopeless proposition against arbitrary play). The idea prunes the necessary permutations immensely, but still not enough.
I’m with Don. The only viable option is to find a way to link your bot into an external chess engine or else find a way to implement such an algorithm in ChatScript itself (I haven’t looked at ChatScript in much detail, so I don’t know where this falls on the continuum from ‘trivial’ to ‘impossible’).

 

 
  [ # 6 ]

Did you watched the latest episode of Person of Interest?

It is about that AI bot learning chess via voice conversation with human.

To your question. I think that ChatScript is intended to solve conservation logic problems and it will not be easy to program other AI problems with it. you should use some other tool and create an interface to your ChatScript bot via HTTP service or other means of communication supported by the engine.

 

 
  [ # 7 ]

Point one, chess is a conversation, and chatscript is the perfect tool for programming conversations.

Point two. The player is not playing against chatscript {the boy}. But against all of the; masters, grand masters, and the competition grade players who’s games where used to make the script.

A question about chatscript rejoinders, not about chess moves.
1
s(e2 e4) g8 f6
or
2
s(e2 e4) e7 e5
u(d2 d3) g8 f6

the question is will the rejoinders from one example of g8 f6 somehow get confused with those of the other. Or are the two conversations tret quite separately, which is what I need.

 

 
  [ # 8 ]
jp fellows - Jan 12, 2015:

Point one, chess is a conversation, and chatscript is the perfect tool for programming conversations.

Point two. The player is not playing against chatscript {the boy}. But against all of the; masters, grand masters, and the competition grade players who’s games where used to make the script.

A question about chatscript rejoinders, not about chess moves.
1
s(e2 e4) g8 f6
or
2
s(e2 e4) e7 e5
u(d2 d3) g8 f6

the question is will the rejoinders from one example of g8 f6 somehow get confused with those of the other. Or are the two conversations tret quite separately, which is what I need.

I understand you want to create conversation about predefined Chess Moves. that could be achieved using ChatScript.

To your question about rejoinders:

From my experience, rejoinder is specific to the rule they are under, as you suggested.
you can read more about the subject here in the docs: http://chatscriptwiki-chatscript.rhcloud.com/index.php/Basic_User_Manual#Rejoinders

 

 

 

 
  [ # 9 ]

Thank samuel
I thought that was the case. But its better to ask a stupid question the than to proceed on a false assumption.

 

 
  [ # 10 ]

I don’t see how this can work in any language. If you have a script of chess moves, you have to assume both players will make the same moves as the script. I like to play chess but would make moves that grandmasters would laugh at. What happens when the player deviates from the script in the 2nd or possibly 1st move?

Even the 739,000 games on the website will be no use if I make a crazy queen sacrifice in my 3rd or 4th move.

 

 
  [ # 11 ]

There are chess training programs available that have analyzed many thousands of grandmaster-level play and provide recommended the best next move based on prior moves and the last move by the opponent. These “books” are one of the main ways that expert chess players learn to play at high levels. They memorize all the high probability sequences of moves for the opening style they prefer to play, such as the Ruy Lopez. One of the best of these trainers is the Chess Opening Wizard at http://www.bookup.com/.

 

 
  [ # 12 ]

It is stating to look like this might not work after all. Not because of the choices available to the player, Steve I am still confident could swamped just by having enough games make up the script [27.500 000 000] or there about. But because the bot as the same range of choices.

If the player has a choice then the script would diverge, the same as a normal chatscript

but if the script comes to a choice them it will need to assign variable to track the choices, and make the script divide. And that would quickly become to many variables.
Its a shame because a chess game is almost a ready made script.
1. (d4) f5
2. (c4) c6
3. (Nc3) e6  
4. (Bf4) d5
5. (e3) Nf6
6. (Nf3) Be7
7. (Be2) O-O
8. (O-O) Bd6
9. (Ne5) dc4
10. (Bc4) Nd5
11. (Bg3) Be5
12. (Be5) Nd7
13. (Bg3) N7b6

 

 
  [ # 13 ]

You would need to store the board.
64 slots, either filled or not with one piece.
You could feed that sentence to chatscript for the best response.
https://chessprogramming.wikispaces.com/Zobrist+Hashing

By 2005, all chess positions with up to six pieces (including the two kings) had been solved. By August 2012, tablebases had solved chess for every position with up to seven pieces (the positions with a lone king versus a king and five pieces were omitted because they were considered uninteresting). Tablebases are generated by retrograde analysis, working backwards from a checkmated position.
https://chessprogramming.wikispaces.com/Endgame+Tablebases#x7-man

But, because of the size of the permutations, I don’t know of any chess program that has mapped out all of the potential board positions and best moves. While there’s only about 20 opening moves, there are something like 30 or so second moves, so by the third move we’re looking at 360,000 alternative game states. The total volume of all tablebases is 140 000 gigabytes, which is obviously too much for personal computers.

It might actually be easier to write a chess program in Chatscript.
http://en.wikipedia.org/wiki/Negamax

 

 
  [ # 14 ]
jp fellows - Jan 16, 2015:

It is stating to look like this might not work after all. Not because of the choices available to the player, Steve I am still confident could swamped just by having enough games make up the script [27.500 000 000] or there about. But because the bot as the same range of choices.

If the player has a choice then the script would diverge, the same as a normal chatscript

but if the script comes to a choice them it will need to assign variable to track the choices, and make the script divide. And that would quickly become to many variables.
Its a shame because a chess game is almost a ready made script.
1. (d4) f5
2. (c4) c6
3. (Nc3) e6  
4. (Bf4) d5
5. (e3) Nf6
6. (Nf3) Be7
7. (Be2) O-O
8. (O-O) Bd6
9. (Ne5) dc4
10. (Bc4) Nd5
11. (Bg3) Be5
12. (Be5) Nd7
13. (Bg3) N7b6

Tracking the move history shouldn’t be necessary. It’s required for repetition detection but not much else, and a purely database-driven player shouldn’t really need repetition detection anyway. I still think this approach is infeasible, though.

 

 
  [ # 15 ]

And if I decide not to play f5 in my first move, that script is no longer followed. As Merlin says, there is no way you will be able to map out all the possible moves of a chess game.

 

 1 2 > 
1 of 2
 
  login or register to react