That is fantasy chess. Testing for stuff like this on the horizon can slow the engine. Would you tie the shoelaces together of your opponent before challenging him to a footrace?
It is not worth it. Do not interfere with the flow of thought. Let the engine find the move to win. That is the human style and democratic thing to do. The proof is in the elo.Having the value of all pieces go up towards the end-game is a simple and usuful method for encouraging piece trading when ahead. Trading Pawns should not be considered advancing the game phase, however. Actually more the opposite.
Any time there is a pawn on the board, there is a danger of winning for the inferior side. Every pawn position has to be tested with depth. Only KBKP / KNKP are quickly cutoff. Even then they are not equated as a force draw; rather their scores are reduced or minimized to give the pawn a chance to show its stuff.It is important to not only score KRNKR as draw, but also KRNKRP. Otherwise the engine will happily trade into KRNKRP (e.g. from KRNPPKRNP) and think it is OK as long as it refrains from capturing the last Pawn.
Code: Select all
if (piececount==4) {
if ((wknight | wbishop) == 1 && (bpawn==1))
return min(eg,0);
if ((bknight | bbishop) == 1 && (wpawn==1))
return max(eg,0);
}
[d]8/1p6/3p2k1/K2P1p2/8/P7/1PP5/8 b - - 0 40
I used to have a poor man's KP bitbase to quickly assess passed pawns, but it does not seem to be good enough now. Maybe a KPK bitbase might help.