silentshark wrote: ↑Fri Feb 07, 2020 9:22 am
So.. how do other engine authors stop their programs slipping into obviously drawn endgames?
An example for my engine is KRB vs KR. This is often drawn (I think - anyhow my engine can't win it). The problem I have is that this endgame might be drawn or might be a win (e.g. if the opponent's rook is en prise).
krbkr is indeed very difficult to win. Here are the conditions to win.
1. The IK (inferior king - materially inferior side) must be driven to the edge of the board.
2. The SK (superior king) must be very close to the IK.
3. The SR (superior rook) must guard the rank so that the IK cannot escape from the edge of the board, and drive out the IR.
If those conditions are present, give some bonus otherwise scale down the score by a factor of 8 or so.
Sample position that was already known in the 18th century, analyzed by Philidor.
[d]3k4/4r3/3K4/3B4/8/8/8/5R2 w - - c0 "KRBvKR, Philidor position, white wins";
Even when IK is already at the edge of the board, it is not enough to win if SK is far from IK and IR is actively preventing SK to get closer to IK.
[d]4k3/6R1/8/4K3/4B3/8/4r3/8 w - - c0 "KRBvKR, Cochrane defence position, black can draw";
Ref: 100 Endgames You Must Know, by Jesus de la Villa
I have the 3rd Edition. Good book for players and programmers who likes to implement endings on their engine.