WB Alien protocol

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Re: WB Alien protocol

Postby H.G.Muller » 05 Mar 2013, 08:22

Daniel Shawul wrote:Sure now I can send comfortable and standard names that winboard and other engines use such as minishogi,judkins_shogi. This should be standardized since all engines get the same variant name.

I am not sure it came across what I asked. WinBoard 4.7.0 does not understand the setup command if you send any name at all. So you should also not send things like 'minishogi' in the setup command. (You can of course in the variant command.) What I had in mind was something like:

Code: Select all
void setup() {
    char myName[80];
    sprint(myName, " %dx%d+%d_%s\n",BOARDX,BOARDY,HOLDINGS,PARENT);
    if(!strcmp(myName, requestedName)) myName[0] = '\0'; // equals name from variant command
    print("setup (%s)%s %s\n",setup_str,myName,start_fen);
}


So if the name expands to a 'parentage name' that is exactly what the GUI asked, suppress its printing in the initial setup command, as the GUI obviously already was aware of this parentage. This would provide compatibility with WinBoard 4.6.x and 4.7.0.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: WB Alien protocol

Postby Daniel Shawul » 05 Mar 2013, 13:32

Ok I understand now. I guess it is also better to suppress the latter setups sent after moves are made. The better names i was talking about were those sent in the feature variants. I still send those ugly names with board sizes that make it difficult to identify them when put in a combo-box. All i have to do is put a parent name in the game specification which will be sent in the first setup, while the child name specified in the 'feature variants= minishogi' . I will make those changes now since it doesn't require a new winboard version.
User avatar
Daniel Shawul
 
Posts: 366
Joined: 28 Sep 2004, 09:33
Location: Ethiopia

Re: WB Alien protocol

Postby H.G.Muller » 05 Mar 2013, 14:46

OK, great! Indeed it would be better to only send the later setups if the parent variant is variant alien. Although WB is in general quite resistant to non-compliant stuff thrown at it by the engine. (And with versions that already recognize 'setup' as a keyword, because they allow it in the initial position, there is really no danger at all, as they just ignore it except in some very rare case where it is allowed, and only parse it then.)

I will change Shokidoki to emit a setup command when started in 5x5+5 or 6x6+6 too.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: WB Alien protocol

Postby Daniel Shawul » 05 Mar 2013, 16:45

I have implemented this now but ithink Winboard has to let the engine know if the variant is currently supported or not.
If it is not it must send setups, otherwise it should suppress it.We can assume all parent variants are supported, and setups
are required for derived ones. But for my GUI which completely relies on alien mode, it will not work. Even for Winboard if you
later decide to include support for variant, the engine has to change i.e not send setups. So i think it is better to signal the engine to send setups.
For example before sending 'variant=minishogi' winboard can send 'alien' to tell it to send setups. I say before because
the first setup is sent when reciving the variant name. Also this may be important later if you want to have only specific engines setup winboard

Edit
It seems i can not use mini,judkins,goro etc to name variants. Winboard attaches the dimensions of the board to name smaller size variants.
I am not sure if it is a good idea since many engines may have already supported this. What does it mean when the user changes winboard sizes?
Does winboard know to setup itself up or does it expect to be setup? I think there is some inconsistency here which is why i decided to name variants
always with board dimensions in the past. I think it is wrong to allow board size be editable. Winboard can't set the starting position, and there may
be other rule changes other than board size. For example judkins/mini shogi have different promotion ranks. How can winboard know that unless you
code it. What if two variants are of the same size have different rules while having the same parent? That is why i think we should have the freedom of naming
mini variants as we want. But the parent can be specified on each setup. Right now winboard says 6x6+6_shogi is not supported for judkins.
Last edited by Daniel Shawul on 05 Mar 2013, 18:02, edited 1 time in total.
User avatar
Daniel Shawul
 
Posts: 366
Joined: 28 Sep 2004, 09:33
Location: Ethiopia

Re: WB Alien protocol

Postby H.G.Muller » 05 Mar 2013, 17:59

I don't quite understand the problem. You mean your GUI needs board updates after every move, even for playing normal or shogi? In WinBoard you would have to send those only if the parent variant is alien.

In that case you should just send the setup commands always, to please your GUI. It won't hurt WinBoard, andwe can put it in the protocol specs that unsolicited setup commands should simply be ignored.

What is a worse problem is that the parent variant might not be supported by WinBoard (e.g. the regular version would not support alien, multi or checkers). There currently is no way to prevent the user from selecting non-standard variants with such a parent. This seems purely a GUI problem, though. I guess the best way to handle it is to remember the previous variant, and if the setup received in response to the variant command specified an unknown parent, switch back to the previous variant and throw up an error message.

Another problem is that it is difficult to 'promote' non-standard variants to standard. If minishogi would ever become standard in WB, the engine would likely still say 5x5+5_shogi in its setup command. Perhaps this should also be solved in the GUI? For standard variants, or size modifications of variants, there should be no parent specification in the setup (for WB 4.7.0 compatibility). So if the user selects a variant the GUI believes to be standard, but the engine indicates a different parent, it should perhaps prefer its own standard implementation. (If the sizes match, that is.)

Of course we could decide never to add any standard variants anymore, but in the future rely on rule-modifier flags. These would then take the place of the parent name, probably with recognizable syntax (like 9x9+5_[!doublepush,royalknight,zonedepth=3,promoholdings], say).
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: WB Alien protocol

Postby H.G.Muller » 05 Mar 2013, 18:09

Daniel Shawul wrote:It seems i can not use mini,judkins,goro etc to name variants. Winboard attaches the dimensions of the board to name smaller size variants.
I am not sure if it is a good idea since many engines may have already supported this. What does it mean when the user changes winboard sizes?
Does winboard know to setup itself up or does it expect to be setup? I think there is some inconsistency here which is why i decided to name variants
always with board dimensions in the past. I think it is wrong to allow board size be editable. Winboard can't set the starting position, and there may
be other rule changes other than board size. For example judkins/mini shogi have different promotion ranks. How can winboard know that unless you
code it. What if two variants are of the same size have different rules while having the same parent? That is why i think we should have the freedom of naming
mini variants as we want. But the parent can be specified on each setup. Right now winboard says 6x6+6_shogi is not supported for judkins.


Currently WinBoard should not allow you to specify 'judkins' at all. The only way to play it now is specify 'shogi', and a board size that is 6x6+6. Which would make WB set up an emptyboard, unless you provide a loadPositionFile. But this is what the setup command should change in the future. The user would just select minishogi from a combobox in the New Variant dialog, not touch the size overrules, and WB would send 'variant minishogi' without any prefixes.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: WB Alien protocol

Postby Daniel Shawul » 05 Mar 2013, 18:14

I don't quite understand the problem. You mean your GUI needs board updates after every move, even for playing normal or shogi? In WinBoard you would have to send those only if the parent variant is alien.

In that case you should just send the setup commands always, to please your GUI. It won't hurt WinBoard, andwe can put it in the protocol specs that unsolicited setup commands should simply be ignored.

Yes it is always exclusively in alien mode. But that transfers to all GUIs supporting winboard protocol including winboard itself. When winboard is evolving supporting new variants it has to tell the old engine not to send setups anymore if that breaks it. The engine don't have to figure out what is natively supported by the GUI, it should simply be told. Otherwise it will be very confusing. Well the easiest solution is for winboard to disregard unnecessary setups anyway.
Currently WinBoard should not allow you to specify 'judkins' at all. The only way to play it now is specify 'shogi', and a board size that is 6x6+6. Which would make WB set up an emptyboard, unless you provide a loadPositionFile. But this is what the setup command should change in the future. The user would just select minishogi from a combobox in the New Variant dialog, not touch the size overrules, and WB would send 'variant minishogi' without any prefixes.

Yes but other engines who depended on 5x5+5_shogi wont work any more. It means shokidoki and tjchess have to change because they don't understand minishogi. If minishoig was standardized before then everything is ok.
User avatar
Daniel Shawul
 
Posts: 366
Joined: 28 Sep 2004, 09:33
Location: Ethiopia

Re: WB Alien protocol

Postby H.G.Muller » 05 Mar 2013, 18:40

Well, getting all engines 'on the same page' will be a separate effort. But something is gained already if this can be made to work in human-engine mode.

The startup sequence in two-machines mode is such that the first engine will complete its new-game sequence before the second engine will be started. This to allow the first engine to send a setup, and than load the specified position with setboard into the other. (This is necessary for shuffle games.) We could defer testing whether the second engine plays the selected variant until after receiving the setup from the first. If it tuns out that the originally selected non-standard name (say 'minishogi') is not in the second engine's variants list, WinBoard can now also check if 5x5+5_shogi, which was specified in the 1st engine's setup command as parent, is in that list, and send that instead if it is.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Previous

Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 3 guests