Author: Andrew Williams
Date: 00:04:35 01/26/04
Go up one level in this thread
On January 26, 2004 at 01:10:12, Mathieu Pagé wrote: >Hi, > >I always thought that it was not necessary to check for check after each moves. >My supposition was that if the search visit a node were the side that has just >move is still in check the opposite side will take the king and this will lead >to a so bad position (king captured) that the search (minimax, AB things) would >just reject that move. > >But this causes my engines to play illegal moves in the end of the games when he >is losing. When he see that is king will be captured whatever he do (mate in X) >he will sometimes play moves that leaves him in check. > >I know how to correct that problem at the root. I just have to check for check >after each root move and if it leaves my engines king in check I just reject >that move. But if I do this at every moves of the search, this will slow down >the process. > >Can I avoid calling this at every nodes ? Personally I check at every node. If you want to do it your way you have to consider some things (I think - I've never tried it): 1. The "material value" of the King must be so high that no matter how far ahead in material you are, losing your King returns a score which is worse than MATED_IN_ZERO. 2. You probably want to stop your search at the point when the King is captured. Eg if the King is captured in ply 4 of an eight ply search, that line should be terminated as soon as the King is taken. 3. Because of 2, you will want to check to see if the last move was a King capture. Surely you could then just return something < MATED_IN_ZERO at that point. This invalidates point (1) above. So point (1) only applies if you decide to allow the search to continue past the point where the King was captured. Andrew
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.