for Chess-variant authors
Posted: Wed Sep 17, 2014 7:16 pm
The next release of the WinBoard / XBoard will support a protocol extension for improving the GUI functionality in non-standard variants that can only be played with legality testing off. Such variants typically involve pieces with moves different from any of the 22 piece types supported by XBoard. The consequence is that XBoard cannot use the 'show target squares' option, cannot do reliable check and mate detection, and produces lousy SAN with wrong disambiguation. All because it assumes the pieces move differently that they really do.
The new command allows the engine to load XBoard's move generator with a description of how the piece moves, after which all problems mentioned above disappear. The command syntax is
piece ID MOVEDESCRIPTION
where ID is the 1-letter piece code from the pieceToCharTable. So for engines that change the latter through a setup command, the piece commands will have to be sent after the setup command.
The MOVEDESCRIPTION encodes the capabilities of the piece in so-called Betza notation, where sets of symmetry-equivalent moves are indicated by a single capital (e.g. N for the 8 Knight moves). The maximum number of times this step can be repeated in the same direction for sliders/riders can be written behind it, and when the piece only has a subset of of the moves these are written in lower case in front of it. A lower-case m or c in front of the move indicates it is a non-capture only or capture only. When a piece makes moves of different strides, these are simply concatenated. The orthodox pieces B, R, Q, K can also be used, as shortcuts.
Currently this is all that XBoard understands, with the additional convention that a repetition count of 0 means 'infinite'. Future versions will also understand multi-leg moves and hoppers (which can be described as two-step movers).
Some examples:
As you can see, highly symmetric pieces tend to have very compact descriptions, and the much rarer asymmetric or divergent pieces require much longer description.
This extension is mainly intended for variants that involve only a few pieces outside XBoard's standard repertoire. E.g. there exists a Makruk variant Ai-Wok, which replaces the Makruk Queen (a Ferz, like in Shatranj) with a very powerful piece (the 'Ai-Wok'), which moves like Knight, Rook or Ferz. An engine for this could send in response to the variant makruk command (when XBoard's legality testing is off)
setup (PNSR...AKpnsr...ak) rnskasnt/8/pppppppp/8/8/PPPPPPPP/8/RNSAKSNR w - - 0 1
piece A RNF
piece a RNF
(Note that XBoard will not automatically assume white and black pieces with the same ID move alike.)
The new command allows the engine to load XBoard's move generator with a description of how the piece moves, after which all problems mentioned above disappear. The command syntax is
piece ID MOVEDESCRIPTION
where ID is the 1-letter piece code from the pieceToCharTable. So for engines that change the latter through a setup command, the piece commands will have to be sent after the setup command.
The MOVEDESCRIPTION encodes the capabilities of the piece in so-called Betza notation, where sets of symmetry-equivalent moves are indicated by a single capital (e.g. N for the 8 Knight moves). The maximum number of times this step can be repeated in the same direction for sliders/riders can be written behind it, and when the piece only has a subset of of the moves these are written in lower case in front of it. A lower-case m or c in front of the move indicates it is a non-capture only or capture only. When a piece makes moves of different strides, these are simply concatenated. The orthodox pieces B, R, Q, K can also be used, as shortcuts.
Currently this is all that XBoard understands, with the additional convention that a repetition count of 0 means 'infinite'. Future versions will also understand multi-leg moves and hoppers (which can be described as two-step movers).
Some examples:
Code: Select all
W Wazir ((1,0) stepper, Xiangqi King)
W0 Rook
W3 range-3 Rook
RN Chancellor (Rook-Knight compound)
BW Crowned Bishop (Shogi Dragon Horse, King-Bishop compound)
F Ferz ((1,1) stepper)
WF King (does not imply anything about royalty, just states how it moves)
fN Shogi Knight (only has the f=forward-most two moves)
fW Shogi Pawn (or Xiangqi Pawn before the River)
fsW Xiangqi Pawn that crossed the River (s = lr = sideway)
WfF Shogi Gold General
fWF Shogi Silver General
fmWfcF FIDE Pawn
mNcK piece that moves as Knight but captures as King
This extension is mainly intended for variants that involve only a few pieces outside XBoard's standard repertoire. E.g. there exists a Makruk variant Ai-Wok, which replaces the Makruk Queen (a Ferz, like in Shatranj) with a very powerful piece (the 'Ai-Wok'), which moves like Knight, Rook or Ferz. An engine for this could send in response to the variant makruk command (when XBoard's legality testing is off)
setup (PNSR...AKpnsr...ak) rnskasnt/8/pppppppp/8/8/PPPPPPPP/8/RNSAKSNR w - - 0 1
piece A RNF
piece a RNF
(Note that XBoard will not automatically assume white and black pieces with the same ID move alike.)