Evert wrote:How do "engine-defined variants" work? Is that a new feature? Will it work with regular XBoard? Or just Alien?
This is a new feature of the development version. When an engine says
feature variants="....,XXX,..."
where XXX is not one of the supported variant names, XBoard will assume it is an engine-defined variant, and create a button for it in the New Variant dialog. When the user presses this button, it will sent
variant XXX
to the engine, like it would for any variant, but will set the variant to Unknown internally. And it opens itself to reception of a setup command, even when legality testing was on. The setup command can be something like
setup (PN.RQKpn.rqk) 6x6+0_normal rnqknr/pppppp/6/6/PPPPPP/RNQKNR w - - 0 1
telling XBoard that it should switch to 6x6+0_normal, with the -pieceToCharTable as given between the parentheses, using the FEN as initial position. Starting the game before such a setup command is received will result in an error popup.
This basically automates the configuration process that the user had to do before, when he wanted to play a variant with non-standard board or holdings size, using non-standard (for that variant) pieces, or an alternative start position. Such as mini-Shogi, Los-Alamos Chess or Charge of the Light Brigade. It could all be done before, but it was kind of a hassle. Because you had to provide the FEN in a -loadPositionFile, provide lengthy -pieceToCharTable arguments etc. Now the engine can do all that for you, and make the variant appear in the menu as well.
That the engine has to shuffle has both an upside and a downside. The upside is that it can put any restrictions on the shuffling it wants. E.g. XBoard might not know which pieces are color-bound. Or it might not know whether you want to shuffle the holdings as well, or that only QEH should be allowed in the holdings, and not RBN. The engine could both offer a Seirawan960 and a Seirawan2880 as separate engine-defined variants. The downside of course is that it would have to do the work.
The XBoard option -shuffleOpenings is still independent from this mechanism. I guess I could make sure that when it is set, shuffling would even be applied to the initial setup provided by the engine. It would be a pain that the user still would have to set it, though. I guess it would be better if the setup command would also be able to control the shuffleOpenings option. To do this well, it should be possible to be a bit more specific as to how the shuffling should be done than just on/off. It would be sort of hard to communicate to XBoard that two of QEH should be in the holdings, and the remaining one shuffled with the other back-rank pieces.
One idea could be this:
XBoard now does two kind of shufflings. The first is re-ordering the back rank, which comes in 3 flavors, depending on castling rules (normal / Fischer / nocastle). The other is used in Superchess, where it randomly swaps the holdings pieces with back-rank pieces. One possible way to combine these modes would be to allow the new symbols <> and ? in the setup FEN. ? would mean: take a piece out of the holdings, and put it here. A set of pieces enclosed in <> on the board would mean: put them in random order. (Again, 'random' being subject to castling and color-bound restrictions.) The Seirawan2880 FEN would then become
<rnb?kbnr>/pppppppp/8/8/8/8/PPPPPPPP/<RNB?KBNR> [QHEqhe] w KQkq - 0 1
while Seirawan960 would be
<rnbqkbnr>/pppppppp/8/8/8/8/PPPPPPPP/<RNBQKBNR> [HEhe] w KQkq - 0 1
To also describe Superchess substitution, we could allow the <> also in the holdings. As the order is meaningless in the holdings, they can be given the meaning there to randomly swap the enclosed set with back-rank pieces. The standard start position of Superchess would then be
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR [<ESAVesav>] w KQkq - 0 1