Author: Richard Pijl
Date: 05:58:35 11/11/04
Go up one level in this thread
>>
>>Checkmate will always lead to a stand-pat choice in qsearch. Any move will get
>>your king taken, so better do nothing and return eval instead. :-)
>>Easily solved with check-evasions in qsearch, but of course that costs some
>>nodes.
>>Richard.
>
>No need to do check evasions in qsearch to solve the problem.
>My first movei had no checks and check evasion in qsearch but it always knew
>that checkmate is checkmate based only on the evaluation function.
I don't call evaluation when I'm in check, but instead try to find a legal move.
My evaluation is expensive, so I don't want to call it when it is not necessary.
Additionally, I mentioned an _easy_ way of solving it. Determining mate
statically is probably more complicated than adding only a few lines in qsearch:
instead of:
best=eval();
if (best>=beta) return best;
generate_quiescense_moves();
write:
if (incheck) {
best=-MATE_VALUE;
generate_all_moves();
} else {
best=eval();
if (best>=beta) return best;
generate_quiescense_moves();
}
And now I can always assume, when calling evaluation, that I'm not in check.
After looping over all moves I check whether a legal move was found. If not, it
was checkmate.
Richard.
>
>Having evaluation that detect checkmates can save nodes because you do not need
>to search captures at checkmate position.
>
>In most cases it is also cheap to find that the last move threats no check so
>there is no checkmate.
>
>Note that in the case of movei generating all the legal moves is part of the
>evaluation function so it can also detect stalemates.
>It is one of the main reasons that movei is not a fast searcher and I probably
>need to replace my mobility evaluation by something better.
>
>Uri
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.