KQKP and the like
Posted: Sat May 25, 2019 7:21 pm
A Pawn advanced to 7th rank is quite strong when supported by its King, and can often draw even against a Queen. We probably all know the rules for this (Rook or Bishop Pawn etc.), or programmed those in our engines. I am now converting KingSlayer to play "chess with different armies", which features many different kinds of fairy pieces, amongst which super-pieces that might or might not be able to beat a supported 7th-rank Pawn. So it would be nice to have a more generic method to let the engine recognize it stumbled into a draw (long) before 50 moves expire, a method which does not require detailed knowledge of the end-game.
If it is possible to tactically gain the Pawn without King help, it is no problem, as the search will quickly find it, after which any special bonus or multiplier for the supported 7th-ranker (which would shift the score close to a draw) will have disappeared. When the piece is too weak to stop promotion it is also easy, as it will then never take very long to promote (after which the draw is a fact). The problem occurs in positions that can only be won with King help, as the King is slow and can be far away, while moving it will not be possible most of the time because of the promotion threat. In KQKP you have to keep checking until you can force the King to step in front of its Pawn, before your own King can approach one step. After which the checking circus starts all over. This usually pushes the position where you finally gain the Pawn with King help far beyond the horizon. With as a result that the engine will keep evaluating the won game as drawish.
I was wondering if the following would help: keep a counter similar to the 50-move counter, except that you reset it for every move of the strong side's King. And then make the evaluation dependent on the value of that counter, in a rather aggressive way. Like evaluating the position as draw when the King has not moved for, say, 5 turns (10 ply). Then a branch that manages to frequently move the King without allowing promotion would escape the 'drawish' verdict, counting on the idea that when you can move your King often enough, it will eventually be able to aproach enough to eliminate the supported passer. Has anyone tried such a thing?
A alterative would of course be to build the 4-men EGT on the fly. Or perhaps a 3-men EGT for Q-KP (i.e. without white King and a royal Queen instead), where a position with the King blocking its Pawn (and white to move) would be considered the win (and an 8th-rank Pawn with black to move a draw). If that blocked position with black to move would be a loss, we will be able to repetitively drive the King in front of its Pawn, making it likely the end-game is won.
If it is possible to tactically gain the Pawn without King help, it is no problem, as the search will quickly find it, after which any special bonus or multiplier for the supported 7th-ranker (which would shift the score close to a draw) will have disappeared. When the piece is too weak to stop promotion it is also easy, as it will then never take very long to promote (after which the draw is a fact). The problem occurs in positions that can only be won with King help, as the King is slow and can be far away, while moving it will not be possible most of the time because of the promotion threat. In KQKP you have to keep checking until you can force the King to step in front of its Pawn, before your own King can approach one step. After which the checking circus starts all over. This usually pushes the position where you finally gain the Pawn with King help far beyond the horizon. With as a result that the engine will keep evaluating the won game as drawish.
I was wondering if the following would help: keep a counter similar to the 50-move counter, except that you reset it for every move of the strong side's King. And then make the evaluation dependent on the value of that counter, in a rather aggressive way. Like evaluating the position as draw when the King has not moved for, say, 5 turns (10 ply). Then a branch that manages to frequently move the King without allowing promotion would escape the 'drawish' verdict, counting on the idea that when you can move your King often enough, it will eventually be able to aproach enough to eliminate the supported passer. Has anyone tried such a thing?
A alterative would of course be to build the 4-men EGT on the fly. Or perhaps a 3-men EGT for Q-KP (i.e. without white King and a royal Queen instead), where a position with the King blocking its Pawn (and white to move) would be considered the win (and an 8th-rank Pawn with black to move a draw). If that blocked position with black to move would be a loss, we will be able to repetitively drive the King in front of its Pawn, making it likely the end-game is won.