ml-research / liground

A free, open-source and modern Chess Variant Analysis GUI for the 21st century
https://ml-research.github.io/liground.github.io/
GNU Affero General Public License v3.0
108 stars 35 forks source link

Liground supporting Musketeer Chess #221

Open musketeerchess opened 3 years ago

musketeerchess commented 3 years ago

Hi Musketeer Chess is a chess variant played on an 8x8 classic chess board with a classic chess set. Only difference is: Two additional pieces are added (pieces can be atypical pieces or classic pieces). These pieces are chosen as follows: first white choses the first piece type, then it's blacks turn to chose the second piece type. Initially when the variant was created, black couldn't chose the same piece type white has chosen (it was to bring more diversity to the game and make the players rapidly confortable with different piece types). Now the variant evolved and it's possible to chose the same piece type.

After the additonal pieces are chosen (Piece Selection Phase) it's time for each side to select the squares where the additional pieces will enter the playing stage. This phase is called Gate Selection. In fact, the additional pieces are introduced by a drop mechanism once one of the pieces on first Rank (or 8th Rank for Black) moves for the first time. The additional piece is then dropped at the same time, making it a double piece move like castlling involving two pieces. For example, we want the piece to enter at c1 square. So when the Bishop in c1 square moves for the first time for example from c1 to g5, the additional piece is dropped in the c1 square and it then joins the fight. Both sides will alternate chosing the drop squares for their pieces. It's forbidden to Gate Select behind King and Rook at the same time preventing from dropping both pieces at the same time when castling.

Further explainations at https://musketeerchess.net/home/index.html or https://github.com/fsmosca/musketeer-chess

QueensGambit commented 3 years ago

Hello @musketeerchess ,

LiGround internally uses ffish.js for move generation which is built using Fairy-Stockfish.

I noticed that there is a new PR which aims to add Musketeer Chess to Fairy-Stockfish.

After the PR was merged, it will be available in ffish.js, too.

Implementing the setup phase of Musketeer Chess requires a bit of work.

Is there a standardized way of describing the setup phase in PGN format? I found an example in the Musketeer Chess forum where the header has already been set.

[Event "?"]
[Site "?"]
[Date "2021.02.03"]
[Round "-"]
[White "-"]
[Black "-"]
[Result "*"]
[Variant "musketeer"]
[VariantFamily "seirawan"]
[VariantMen "E:KDA;C:llNrrNDK;A:NB;F:B3DfNbN;M:NR;H:DHAG;S:B2DN;U:CN;D:QN;L:NB2;K:KisO2"]
[FEN "*c*l****/rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR/**C**L** w KQkq - 0 1"]
[SetUp "1"]

{--------------
. c . l . . . .
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
R N B Q K B N R
. . C . . L . .
white to play
--------------}
*
alexobviously commented 3 years ago

Is there a standardized way of describing the setup phase in PGN format?

I have implemented the Musketeer variant for fairy-stockfish and pychess-variants, and the approach I went for was not considering the setup phase to be part of the game, but rather having a variable starting position for games (i.e. where the committed pieces are already set). I don't think this is exactly ideal, but implementing the setup phase in fairy would have required serious refactoring since nothing like that exists at the moment, and most likely it would not have been approved. Instead, all of the setup is handled in pychess, and a starting FEN is just passed to fairy. Since you're using ffish.js, I guess if you were to add this variant to liground you'd have to take sort of the same approach.

QueensGambit commented 3 years ago

Thank you @alexobviously for elaborating this. I assumed it would be handled this way in Fairy-Stockfish.