I did a quick hack of the WinBoard Alien Edition, so that it can support Kyoto Shogi. One problem is that the Alien Edition is rather old, and doesn't support the more advanced features of the pieceToCharTable, such as associating arbitrary pieces to be each other's (un)promoted form through the "^X" notation. But it has the kanji for all large Shogi variants, as well as on-the-fly generation of mnemonic piece symbols from the move table built into the WinBoard front-end. So I am sort of stuck with it for my Shogi-Variants package, and want Kyoto Shogi to be incorporated in that.
Rather than adding a new standard variant, I decided to support Kyoto Shogi as 5x5+4_shogi. (The holdings size distiguishes it from mini-Shogi.) This of course goes disastrously wrong w.r.t. promotions, in a way reconfiguring the primitive pieceToCharTable cannot fix. So I added a new feature / command-line option -demotions, which accepts a string in pieceToCharTable format. Its effect is that any piece for which an ID is defined in it will be considered 'auto-promoting' to the piece of the mentioned ID. For this to work one of the two pieces has to be defined with ID '+' in the normal pieceToCharTable, and a nick-name has to be defined for it as a normal letter. This way each piece can be known through a letter ID even in Shogi variants. The -demotions argument then tells how each piece must promote/demote after every move.
When a piece is auto-promoting this has many consequences:
* promotion suffixes on input moves will be ignored
* no promotion suffixes will be written on SAN output moves
* a '+' suffix will be written on output moves in coordinate notation
* it will be allowed to drop the piece in promoted form
To configure WinBoard Alien for Kyoto Shogi then needs
Code: Select all
-variant shogi
-boardWidth 5
-boardHeight 5
-holdingsSize 4
-pieceToCharTable "++BR++...G.TK++br++...g.tk"
-pieceNickNames "PN..LS.pn..ls."
-demotions "RGSPTB...N.L.rgsptb...n.l."
-loadPositionFile "kyoto.fen"
This selects BRGT as the 'unpromoted' forms, so that these will be displayed in the holdings for dropping; the PNLS, which are in general weaker and less likely to be dropped will require the user to hold the Shift key down during the drop. Otherwise there are no consequences at all of which pieces are designated as promoted; FENs will use the nicknames for auto-promoting pieces.
I am not yet sure how the promotion suffix is best treated. Requiring it on the moves and paying attention to it is more flexible, as you could then also do variants where promotion is not automatic (such as micro-Shogi, where you would write the '+' then only on captures). But in PGN it looks very ugly to have all these redundant suffixes; SAN already explicitly mentions whether a move is a capture. Plus that having suffixes raises the issue whether it shoud be a '+' or western-style mentioning the ID. It might be better to just inform WinBoard that automatic (i.e. suffix-less) promotion only occurs on captures, through an option -promoteOnCapture true/false.
The pieceToCharTable can be set by the engine (just as board and holdings size) through the 'setup' command. In the XBoard standard edition the -pieceNickNames can be set by embedding "=Y" behind a piece ID; the 'setup' parser splices the pieceToChar string by excising those for the purpose of setting the pieceToCharTable, and uses them to construct a pieceNickNames table. A similar method could be used for putting the 'demotions' info in the pieceToChar string, e.g. by embedding ">Z" to indicate the piece before it auto-promotes to Z. Then the setup command for Kyoto Shogi would look:
setup (+=P>R+=N>GB>SR>P+=L>T+=S>B...G>N.T>LK+=p>r+=n>gb>sr>p+=l>t+=s>b...g>n.t>lk) 5x5+4_shogi pskgt/5/5/5/TGKSP [-] w 0 1
Or (probably better), having '-' as an alternative for the '^' that the standard edition uses to define a piece as '+' and at the same time associate it with the upromoted piece 'X' by writing "^X", where "-X" would then also define the piece (and its partner) as auto-promoting to each other, and the "=Y" would still define the nicknames:
setup (-R=P-G=NBR-T=L-B=S...G.TK-r=p-g=nbr-t=l-b=s...g.tk) 5x5+4_shogi pskgt/5/5/5/TGKSP [-] w 0 1
To have the engine configure micro-Shogi would also require setting the -promoteOnCapture argument. Perhaps this could be done through a special symbol at the end of the pieceToChar string ('!' ?).