Check out Chess with Different Armies, our featured variant for July, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Grand Apothecary Chess-Alert. Very large Board variant obtained trough tinkering with known games.[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Fri, Sep 8, 2023 09:34 AM UTC in reply to Aurelian Florea from 04:41 AM:

OK, I see. This was automated with GAME code generated by the Play-Test Applet.

I did some debugging, and it doesn't seem there is anything wrong with the code. I get the impression that it just runs into a timeout enforced by Game Courier, so that it cannot complete, and gives you the error message instead.

You are using full legality checking here (which probably is a necessity due to participation of the Joker). That means that testing to see if white is checkmated requires finding a legal  move for white. So it tries all white moves, and for each of those it then generates all black moves to see if there is one that captures the King. If there isn't, the process is aborted, with the verdict that there is no mate; if it encounters one that does capture the King it knows the preceding white move was illegal, and immediately goes on with the next, to see if it has better luck there.

But it appears the board is scanned for pieces from rank 14 to rank 1. After NN a3xe1 the Nightrider is checking. I have not studied the rules of your game to see if this is actually checkmate, but it is clear that the white pieces on the high ranks cannot resolve the check. And it starts trying all those, before it gets to pieces that would be close enough to the Nightrider to capture it. And all these other moves have to be refuted by Nightrider takes King, which is also one of the last moves it generates for black. So it must refute nearly all white moves, and for each of those it has to generate nearly all black moves to do it.

Had it scanned the board from low to high rank, it would always have detected the NNxK capture as one of the first black moves, so even if it was really checkmate (and it would have to try all white moves to prove that), it would have gone more than an order of magnitude faster. And if a white piece on low rank would have been able to capture the NN, it would have been one of the first things it tried for white. And then it would have found its legal move for white, and abort the mate test, which would again make it an order of magnitude faster. As it is, it only gets to trying moves from g3 before it is timed out.

I am not sure what we could do about this, apart for asking Fergus to stretch the timeout for executing GAME code. The Betza move generator uses a statement

  for (from piece) fn friends #player:

to loop over all pieces of the side to move, and this provides no control over the order in which the pieces are treated. Obviously the mate test could be sped up very much if we would always start with the piece that was checking; then almost all moves of the (nearly) checkmated player would be very quickly refuted by the King capture. The function 'friends' I used here gets its result from either onlyupper or onlylower, and I suppose it would be possible to reorder the pieces in these associative array, to get the checker in front, if the move generator is called for the purpose of legality testing for moves starting from an in-check position.

A poor-man's solution would be to scan the board always strating from the side of the player on move, because that is where his King starts. King moves are often a good way to get out of check, and if the King is suffocated like here, the check is likely to come from a piece that is close by.