📝Greg Strong wrote on Sun, Nov 20, 2016 05:34 PM UTC:
Hi Aurelian,
Yes, you are correct. I never added Grande Acedrix because the Griffon move isn't directly supported. This would be tricky to implement in a general way. It's not just being able to generate the moves - that's not too bad. It gets more complicated with the IsSquareAttacked function used for detecting Check. IsSquareAttacked starts at the square and "backs up" in every direction the game uses until it hits a piece or leaves the board. If it hits a piece, it determines if that piece can move that far in that direction. To support moves with multiple parts, the logic in IsSquareAttacked would get pretty complicated. To see if a square is attacked by a Griffin, as it is backing up in Rook steps, for each step, it would then need to back up one diagonal step each way and check for a piece that can move like a Griffon. Then there is the problem of Static Exchange Evaluation (SEE). This gets even more complicated, but ChessV allows you to just turn off SEE for specific games. Some of the games already supported have to turn off SEE. It's not really necessary, it just makes then engine faster.
All that said, it is possible to implement the Griffon in ChessV if you are really dedicated, but it is probably more trouble than it is worth. You can override the GenerateSpecialMoves function of the Game class to add support for moves that the internal move generator can't handle. Most of the pieces from Ultima work this way. (Look at the implementation of Chess with Ultima Pieces for an example.) Then you also have to override the IsSquareAttacked virtual function as well.
You could also look at Postduif by Evert Glebbeek. It was designed to play Grande Acedrix. In its move generator, every move has a step/leap component followed by a slide component (either one of which can be zero to skip it.) It may have problems with some of the other pieces or rules for Apothecary though. I haven't looked at it in detail.
Hi Aurelian,
Yes, you are correct. I never added Grande Acedrix because the Griffon move isn't directly supported. This would be tricky to implement in a general way. It's not just being able to generate the moves - that's not too bad. It gets more complicated with the IsSquareAttacked function used for detecting Check. IsSquareAttacked starts at the square and "backs up" in every direction the game uses until it hits a piece or leaves the board. If it hits a piece, it determines if that piece can move that far in that direction. To support moves with multiple parts, the logic in IsSquareAttacked would get pretty complicated. To see if a square is attacked by a Griffin, as it is backing up in Rook steps, for each step, it would then need to back up one diagonal step each way and check for a piece that can move like a Griffon. Then there is the problem of Static Exchange Evaluation (SEE). This gets even more complicated, but ChessV allows you to just turn off SEE for specific games. Some of the games already supported have to turn off SEE. It's not really necessary, it just makes then engine faster.
All that said, it is possible to implement the Griffon in ChessV if you are really dedicated, but it is probably more trouble than it is worth. You can override the GenerateSpecialMoves function of the Game class to add support for moves that the internal move generator can't handle. Most of the pieces from Ultima work this way. (Look at the implementation of Chess with Ultima Pieces for an example.) Then you also have to override the IsSquareAttacked virtual function as well.
You could also look at Postduif by Evert Glebbeek. It was designed to play Grande Acedrix. In its move generator, every move has a step/leap component followed by a slide component (either one of which can be zero to skip it.) It may have problems with some of the other pieces or rules for Apothecary though. I haven't looked at it in detail.
Cheers,
Greg