fairy-stockfish / Fairy-Stockfish

chess variant engine supporting Xiangqi, Shogi, Janggi, Makruk, S-Chess, Crazyhouse, Bughouse, and many more
https://fairy-stockfish.github.io/
GNU General Public License v3.0
625 stars 196 forks source link

Please support tame pieces #683

Open zeth opened 1 year ago

zeth commented 1 year ago

Hello, thanks to @ianfab et al for Fairy-Stockfish, it's a really great project. I'm having lots of fun playing with (and against) the different pieces.

The Amazon (and a few others) are really fun but force checkmate rather quickly, they are really overpowered on an 8x8 board. I made it in the client (chessground) of my game that my dragon (Amazon) could not attack a king (perhaps because the king has dragon's blood), and it brought a nice balance to the game, but my instance of Fairy Stockfish doesn't know about that so I have to code around it and hope the AI doesn't blunder its dragon completely then turn into non-Fairy Stockfish.

Is there a way to configure Fairy Stockfish for a piece that can't attack a king? I couldn't find one (but I don't have complete understanding of the config) so if not then this is a feature request. I notice in the Betza specification at xboard, it says:

Tame pieces - XBoard interprets a modifier 't' on a final (or only) leg of a move as a prohibition to capture Kings.

I notice there a similar feature in review, but you wanted to generalise it:

I would suggest a more descriptive name here, e.g., like `mutuallyImmuneTypes`. Not sure if there is a better suggestion, I would just like to make the name less specific to atomar.

_Originally posted by @ianfab in https://github.com/fairy-stockfish/Fairy-Stockfish/pull/663#discussion_r1257530959_

May I suggest you generalise it in this way instead (or as well)? For example, my dragon could be set like this:

customPiece1 = d:QNt

The Atomar Chess use case could be:

king = k:Kt

Anyway, I understand that some things are more difficult than others to implement and you have to keep some kind of scope, but thanks for reading.

ianfab commented 1 year ago

Thanks for the suggestion. My comment you are referring to does not suggest a generalization but just a mere renaming. One major difference between tame pieces and non-royal pieces not capturable by other pieces is that attacks on the kings, i.e., checks, have some special logic beyond what is required for other pieces, so that will be a bit more tricky.