WB Alien protocol
Posted: 01 Mar 2013, 14:39
Continuation of PM discussion:
To play under standard WinBoard reporting 'alien' in the variants feature is pointless anyway, as it does not know that variant. In WB-Alien it is usually not needed to to explicitly define a size override in WinBoard, as the engine will redefine the size through the setup command. You might want to do it if you want to play from a file of start positions, though. Then XBoard would not accept the FENs i the file unless it was set to the same board size first. So it could be necessary to start WinBoard with 3x4+3 size in -variant alien, and then it would check if the engine says it supports 3x4+3_alien, and it would not be satisfied with just variants="alien".
There already exists a solution for that, however: when you include "boardsize" as a pseudo-variant in the variants feature, WinBoard will assume any of the variants you mention can also be played with other board sizes. So feature variants="shogi,boardsize" would lead WinBoard to think the engine can play Shogi with any board/holdings size. This should really be improved by specifying a maximum, like feature variants="alien,15x15+7boardsize" would allow variant alien with any board size upto 15x15, and any holdings size upto 7. I think the specs even state this.
We could require that the engine should not overrule an explicitly requested board size. If WinBoard would just say variant alien, the engine would specify the size in a setup command, (as per its combobox) and WB would obey. If, however, WB would send variant 5x5+5_alien, it was probably set to 5x5 before starting the game for a reason (e.g. an externally loaded start pos), and not respecting it is a source of trouble. (WB will likely ignore the setup command in that case). Perhaps the engine should report the discrepancy in a tellusererror command. I can imagine that engines like Nebiyu would be capable of taking the rules of the variant they were set for per combobox (or which they recognize from the variant command), and use all its rules except for the board size, in which they would use what the GUI requested.
E.g. suppose I set WinBoard for 8x8 board, 7-holdings and select Shogi. It will send variant 8x8+7_shogi to the engine. Now the engine only knows 5x5+5, 6x6+6 and regular (9x9+7) shogi. So it picks 9x9 as being the closest, uses it rules, overrules the board size to 8x8, improvises a starting position in any way it wishes (could be empty board, anticipating that the GUI will provide it). For engines that supply arbitrary board size (as "boardsize" in the variants list suggets) this seems a good procedure. Engines that only specify specific board sizes would have to explicitly mention all of those as prefixed names.
Indeed, this is an annoying rule for an engine builder...
There is another engine that ignores this rule, and from that I know that in mini-Shogi there is a lot of opportunity to violate it. As the side that will get checkmated usually sacrifices all his material to postpone it, the mating side will have a wide choice of material to drop. And often it drops a Pawn when plenty of other material could have been dropped in stead to deliver the mate as well. (S, G, and R are all upward-compatible to P.)
Note, however, that the problem game I sent you was not about dropping Pawns, but about dropping Rooks!
The problem is not double letters. In Shogi one uses only a + to indicate promotions. (Very confusing for Chess players, who would think it means check!). Like a4a5+ (in mini-Shogi) in stead of a4a5g . So you would have to write the + in stead of the letter. And on input, replace the + by the ID letter for whatever piece you know the moved piece to promote to. And be sure to ignore a promotion character =, which can be added to stress there is no promotion when there could have been one.
Daniel Shawul wrote:Yesterday i removed sending variants 8x8+0_alien and such. Now it can play games perfectly under the standard winboard version. So i had a chance to play games against many variants in pulsar and shokidoki. I found many bugs in variants such as atomic, shogi etc... Nebiyu was basically playing itself in the past so these bugs don't show up. Can we completely remove sending of 8x8+0_alien etc in the winboard variant ?
To play under standard WinBoard reporting 'alien' in the variants feature is pointless anyway, as it does not know that variant. In WB-Alien it is usually not needed to to explicitly define a size override in WinBoard, as the engine will redefine the size through the setup command. You might want to do it if you want to play from a file of start positions, though. Then XBoard would not accept the FENs i the file unless it was set to the same board size first. So it could be necessary to start WinBoard with 3x4+3 size in -variant alien, and then it would check if the engine says it supports 3x4+3_alien, and it would not be satisfied with just variants="alien".
There already exists a solution for that, however: when you include "boardsize" as a pseudo-variant in the variants feature, WinBoard will assume any of the variants you mention can also be played with other board sizes. So feature variants="shogi,boardsize" would lead WinBoard to think the engine can play Shogi with any board/holdings size. This should really be improved by specifying a maximum, like feature variants="alien,15x15+7boardsize" would allow variant alien with any board size upto 15x15, and any holdings size upto 7. I think the specs even state this.
We could require that the engine should not overrule an explicitly requested board size. If WinBoard would just say variant alien, the engine would specify the size in a setup command, (as per its combobox) and WB would obey. If, however, WB would send variant 5x5+5_alien, it was probably set to 5x5 before starting the game for a reason (e.g. an externally loaded start pos), and not respecting it is a source of trouble. (WB will likely ignore the setup command in that case). Perhaps the engine should report the discrepancy in a tellusererror command. I can imagine that engines like Nebiyu would be capable of taking the rules of the variant they were set for per combobox (or which they recognize from the variant command), and use all its rules except for the board size, in which they would use what the GUI requested.
E.g. suppose I set WinBoard for 8x8 board, 7-holdings and select Shogi. It will send variant 8x8+7_shogi to the engine. Now the engine only knows 5x5+5, 6x6+6 and regular (9x9+7) shogi. So it picks 9x9 as being the closest, uses it rules, overrules the board size to 8x8, improvises a starting position in any way it wishes (could be empty board, anticipating that the GUI will provide it). For engines that supply arbitrary board size (as "boardsize" in the variants list suggets) this seems a good procedure. Engines that only specify specific board sizes would have to explicitly mention all of those as prefixed names.
As you said it is useless except for checking board size. One the variants are completely determined from the combo box for non supported variants. Second when some match those supported with winboard then it should send me 8x8+0_normal etc.. Winboard currently just say 5x5+5_alien and don't allow to play a game. If you remove that from the alien edition , Nebiyu can play in both alien and standard edition of winboard perfectly. In alien mode Nebiyu always sends setup.
For shogi, drops for pawns were allowed anywhere, now fixed it so that files with no pawns. That required a special flag in the ini with Shogi_pawn_rule.
Indeed, this is an annoying rule for an engine builder...
I still need to add the 'pawns can't be dropped to give checkmate' stuff.
There is another engine that ignores this rule, and from that I know that in mini-Shogi there is a lot of opportunity to violate it. As the side that will get checkmated usually sacrifices all his material to postpone it, the mating side will have a wide choice of material to drop. And often it drops a Pawn when plenty of other material could have been dropped in stead to deliver the mate as well. (S, G, and R are all upward-compatible to P.)
Note, however, that the problem game I sent you was not about dropping Pawns, but about dropping Rooks!
Right now i think what is left to fix are promotion piece chars Nebiyu only knows single char promotion lettters. So i use T , D etc for promotion letters. Even when two different pieces promote to goldgeneral different letters are used since it helps when making drops letter. I can still use T, D internally and send a +,= appended double letters but the problem is during promotions. I
The problem is not double letters. In Shogi one uses only a + to indicate promotions. (Very confusing for Chess players, who would think it means check!). Like a4a5+ (in mini-Shogi) in stead of a4a5g . So you would have to write the + in stead of the letter. And on input, replace the + by the ID letter for whatever piece you know the moved piece to promote to. And be sure to ignore a promotion character =, which can be added to stress there is no promotion when there could have been one.