|
|
Member
Total posts: 25
Joined: Dec 14, 2014
|
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.
|
|
|
|
|
Posted: Jan 10, 2015 |
[ # 1 ]
|
|
Experienced member
Total posts: 84
Joined: Aug 10, 2013
|
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.
|
|
|
|
|
Posted: Jan 11, 2015 |
[ # 2 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
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.
|
|
|
|
|
Posted: Jan 11, 2015 |
[ # 3 ]
|
|
Guru
Total posts: 1009
Joined: Jun 13, 2013
|
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
But surely chess computer programs are a solved problem. Maybe ChatScript can tie into one that’s already available.
|
|
|
|
|
Posted: Jan 11, 2015 |
[ # 4 ]
|
|
Member
Total posts: 25
Joined: Dec 14, 2014
|
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.
|
|
|
|
|
Posted: Jan 11, 2015 |
[ # 5 ]
|
|
Experienced member
Total posts: 84
Joined: Aug 10, 2013
|
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’).
|
|
|
|
|
Posted: Jan 12, 2015 |
[ # 6 ]
|
|
Experienced member
Total posts: 31
Joined: Oct 23, 2014
|
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.
|
|
|
|
|
Posted: Jan 12, 2015 |
[ # 7 ]
|
|
Member
Total posts: 25
Joined: Dec 14, 2014
|
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.
|
|
|
|
|
Posted: Jan 12, 2015 |
[ # 8 ]
|
|
Experienced member
Total posts: 31
Joined: Oct 23, 2014
|
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
|
|
|
|
|
Posted: Jan 12, 2015 |
[ # 9 ]
|
|
Member
Total posts: 25
Joined: Dec 14, 2014
|
Thank samuel
I thought that was the case. But its better to ask a stupid question the than to proceed on a false assumption.
|
|
|
|
|
Posted: Jan 12, 2015 |
[ # 10 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
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.
|
|
|
|
|
Posted: Jan 13, 2015 |
[ # 11 ]
|
|
Member
Total posts: 27
Joined: Nov 18, 2009
|
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/.
|
|
|
|
|
Posted: Jan 16, 2015 |
[ # 12 ]
|
|
Member
Total posts: 25
Joined: Dec 14, 2014
|
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
|
|
|
|
|
Posted: Jan 16, 2015 |
[ # 13 ]
|
|
Guru
Total posts: 1081
Joined: Dec 17, 2010
|
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
|
|
|
|
|
Posted: Jan 17, 2015 |
[ # 14 ]
|
|
Experienced member
Total posts: 84
Joined: Aug 10, 2013
|
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.
|
|
|
|
|
Posted: Jan 17, 2015 |
[ # 15 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
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.
|
|
|
|