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
621 stars 196 forks source link

Add Custom Atoms as well as the Ability to Create Custom Hoppers, Riders, and Leapers for any Atom #519

Closed PraseodymiumSpike closed 2 years ago

PraseodymiumSpike commented 2 years ago

It would be really nice if you could add the following things:

  1. the ability to create custom "atoms" for Betza Notation such as the commonly used atom "N". I suggest that they be defined in the .ini file for the variant in a similar way as the custom pieces are. For example, if they were not already defined, the atoms "N" and "Z" would have the following definitions: customAtom1=N:(1,2) and customAtom2=Z:(2,3). There could be up to 25 of these, allowing for overwriting of existing named atoms.
  2. the ability to create riders in any direction specified by the atoms.
  3. the ability to create hoppers in any direction specified by the atoms.
  4. the ability to create leapers in any direction specified by the atoms. Note that this means that customAtom1=F:(1,1) and customAtom2:A:(2,2) would be different.
PraseodymiumSpike commented 2 years ago

Note that "hoppers" are pieces like janggi cannons or Chak Quetzals, riders are pieces like the chess queens or fairy chess nightriders, and leapers are pieces like alfils and chess knights.

PraseodymiumSpike commented 2 years ago

This is probably too ambitious, but if you want to take this idea to its logical extreme, you could consider adding support for pieces like the Toad. The Toad is an esoteric piece I came up with yesterday. Admittedly, it does not seem to be the most practical piece to use in an actual game, but I am suggesting it because of all the other features adding it would require you to add. The Toad is an omnidirectional hopper. On a convex board, it can move to a square if and only if the following conditions are met:

  1. There is exactly 1 piece strictly in between its starting and ending square not including the endpoints. Note that for a piece to be considered strictly in between two squares, the center of the square the piece is on must be on the line segment whose endpoints are the centers of the two squares, and it must not be on one of the endpoint squares.
  2. Moving it does not leave its king in check or break any of the other applicable rules of the variant it's in. It captures exactly as it moves except that it must also follow any rules of the variant that concern capture such as not being able to capture its own side's pieces.

Essentially, it is a Cannon from Quetzal from Chak except that instead of being limited to directions that form a 0-degree angle or 45-degree angle from the grid, it can hop in any direction that forms an angle θ with the grid such that the tangent of θ is a rational number. This is all very complicated, but I think an image will clear things up nicely. Such an image is attached. Toad Fairy Chess Piece Here, note that the Toad is placing the Black King in Check. Also, note that it is not attacking the Black Pawn on a7 as there is no Piece on b5 for it to hop over.

PraseodymiumSpike commented 2 years ago

Note that the Emperor, which is featured in some large shogi variants, would also fit into this category.

ianfab commented 2 years ago

This is partly a duplicate of #499. The other points about atoms beyond betza for me are out of scope, so I am closing this.