Advertisement

AI for chess

Started by July 06, 2005 11:54 PM
18 comments, last by Sagar_Indurkhya 19 years, 4 months ago
i think a 3 level search will be fine with average chess players. and that is exactly what i want. thanks guys for all your support!
You might find that a 3 ply search is not deep enough.

1. Computer moves
2. Human moves
3. Computer moves



------------------http://www.nentari.com
Advertisement
I think a 3 ply search would be enough for an average chess game. what would you suggest is a good play search RPGeezus ?
At least four. That lets the computer see two full moves ahead. Most humans are able to do this. Maybe five. Do you plan on implementing quescience search? Seearc extensions? It will depend on how sophisticated you make your chess program.

There are two big problems with shallow searches. Deeper searches do a better job at hiding these problems.

1. Even a poor player (like me) can usually bog the computer down by playing defensively. Instead of playing to capture pieces I would play just not to lose any of my own. Without the ability to see any kind of clear goal the computer will end up making a lot of stupid moves. This becomes compounded with the next issue.

2. Captures can lead to self-destruct mode. With a 2 or 3 ply search the computer may see itself losing a big piece, but choses delay it by 1 or 2 moves by sacraficing a weaker piece. Since it doesnt look ahead far enough to resolve the outcome of the captures it is likely it will start throwing pieces away!

Remember that the computer will always assume it's opponent will make the 'best' move. If the computer see's a possible capture of a knight (even though the human doesn't see it) but believes it can prevent it by sacraficing a pawn, it will. In this way the computer will eventually make very obvious blunders that anyone can see.

You'll often see this problem occure once the computer detects it will lose-- to your human eyes (if you're as bad as chess as I am) it will appear like your program has a bug, because the computer will start sacraficing it's queen, rook, etc... for no apparent reason. In reality it detected that it's going to lose, but pushed the mate past it's search horizion. -5 is way better than -999999. :)

There are ways to mitigate these problems, but I'm under the impression that you want something relaitively simple. This is why I suggest at least a 4 or 5 ply search.

Either way, it's your program. Make it play like you want. Pat yourself on the back for even getting something running. :)

Cheers,
Will
------------------http://www.nentari.com
i think it is better that i implement a 4 level ply search. Yes I'm going to implement quescience search. How do we tackle the problem of computer assuming the opnents BEST move ? If the computer is always assuming that the oponent will always make the best move, then we are in a lot of trouble with oponents of lesser quality ? will it eventually make the computer loose ? or is there a way we can take care of this ? I think i should involve some kind of learning in my program. This would allow me to learn the oponents moves and decide on what level is the oponent is. Then maybe i should not tell the computer to assume that the oponents will make the best move, but assume from the learning gathered. The learning will decide whether the computer will make a average, good or a best move.
If you put in quiscence then the problems I mentioned above will not be as big an issue. Quiscience will continue searching captures until it sees a quite outcome. In this way it's much less likely that you encounter a horizon effect for anything but a check-mate.

Will
------------------http://www.nentari.com
Advertisement
I'll implement quiscence. How does one handle the horizon effect for check mate?
One thing to keep in mind is that the computer will not always find the best move even if you have computer choose the position it feels is the "best". This is because the logic behind evaluating the moves will be less than optimal, whether you write it yourself or it's professionally done. For skilled players, computers beat humans because of speed, not better evaluation.

For beginners, this isn't going to matter much, since they'll get smashed by making rookie mistakes. (Heck, I'm a decent player and make silly mistakes!)

If you want to have a machine "learn" how strong a player is, some simple ways would be keeping track of length of the games, and how quickly a player is routed --where the game is practically won or lost (a minor piece--bishop or knight--down could work).

Another idea is to compare what the human does to how the computer evaluates the human's position. Moves that seriously degrade the position would indicate a weaker player. There should be a threshhold where a player should not be penalized or rewarded (maybe .05 pawns) to account for computer imperfections or positions where several moves are roughly equal. The computer should review the game afterwards to make these comparisons, since a quick human player won't give the computer enough time to make a decent judgment.
Actually I was thinking of having some kind of learning in the chess game. Judging the human's strength would be one way to analize the oponent. What other simple learning techniques can we incorporate in the game ?
One area you should look at is evaluation functions. Making a good one is very difficult, and sometimes, if you get an ANN or GA to inspect games, you can get good evaluation functions.

This topic is closed to new replies.

Advertisement