Page 18 of 19

Re: Some questions to H.G.Muller about Winboard.

Posted: Wed Jan 26, 2011 2:09 pm
by hgm
Indeed, I think (1) is unavoidable. We cannot assume there will be standard naming of variants that WinBoard does not officially supports, or for the name of the engine-defined options that set them. The board size should be relayed to the second engine, though. So even if you have a combo that can choose between 10x10 and 8x8 for Checkers, you might make an explicit variant 10x10+0_checkers command overrule that setting, and only obey it when you receive a plain variant checkers. In other words, let the combo option just determine the default. Then you would only have to set it in the first engine. (Or in the WinBoard New Variant menu.) There would be no point in insisting on 8x8 if WinBoard cleary lets you know it will do 10x10 anyway...

As for (2): indeed it was the intension that any setup of the initial position from the second engine would be ignored. (This is important in shuffle games!). But in variant alien this was broken, because it accepted board updates always. I now forbid such opdates of the initial position even in variant alien. Meaning that only the first engine can do it, and only if the user did not already provide an initial position. The version I now uploaded should also allow you to change board size of the selected variant if there is no radio-button for it.

Re: Some questions to H.G.Muller about Winboard.

Posted: Wed Jan 26, 2011 3:09 pm
by Daniel Shawul
Ok canceling the variants menu now keeps the selected variant. For checkers I had /variant=checkers when I started the engine. I changed the board size to 10x10 and had no problems playing an international checkers game.

Should I let the board size be decided by variants menu exclusively? And my combo to select whatever alien variants I have. That sounds much better because it is getting complicated for me now that I have different options to change board size from ini,combo and during startup.

With back captures allowed for international checkers, winboard promoted its own pawn to its own back rank ! White pawn captured a black pawn backwards and got promoted to white queen. I had similar problems with jetan panthans which btw don't promote, so I had to set a different char for panthans in the pieceToCharTable. pawns & hoplites both seem to promote by default. Maybe there is already an option to turn of auto-promotion ?

Re: Some questions to H.G.Muller about Winboard.

Posted: Wed Jan 26, 2011 3:22 pm
by hgm
In general it would be good to keep the combobox to set a default size, because XBoard does not have the board size in the New Variant menu.

Oh, this is definitely a bug. Pawns should not promote on their own back-rank. I guess the test for this is simply sloppy, assuming Pawns do not get there. In Shogi you can drop Pawns there, but Shogi Pawns are not considered Pawns and have their own code in the move generator.

Re: Some questions to H.G.Muller about Winboard.

Posted: Wed Jan 26, 2011 3:28 pm
by Daniel Shawul
wait wait... the back rank problem is mine :oops: I had a (r == 1 || r == 7) test for promotion which obviously didn't work.
But the pawns & hoplite pieces promote by default , right ? I had to use other piece I didn't like for their pawn representation in jetan.

Re: Some questions to H.G.Muller about Winboard.

Posted: Wed Jan 26, 2011 4:38 pm
by hgm
They promote by default, but I think you can suppress promotion by promoting to P (with legality testing off). If not, I should be able to make it that way without damaging anything else.

Re: Some questions to H.G.Muller about Winboard.

Posted: Wed Jan 26, 2011 8:55 pm
by hgm
OK, I see that I had classified promotion to Pawn as an 'ImpossibleMove', which means it would be rejected even with legality testing off. (Like off-board moves and such.) I guess I did that because last-rank Pawns would generate off-board moves and tests, and could thus not be tolerated. But I see now this is not the case. So I changed that now to merely 'IllegalMove', which should make it OK with legality testing off. But you would have to include the promotion character 'p' (or whatever character you designate it with) when you want to suppress promoton for a move that visits last rank.

Re: Some questions to H.G.Muller about Winboard.

Posted: Thu Jan 27, 2011 12:17 am
by Daniel Shawul
I will try the promotion to pawn later.

The resizing of winboard from the combo box doesn't seem to work in the latest of versions. Please look at the log files because the correct setup is sent when an 'option variant=xxxx" is received from winboard. I have removed selection of variant from ini file so the only way to do it now is from the combo boxes. The fact that the 'alien' ,checkers & chess radio buttons are currenlty missing from the variants menu also make it difficult to switch from one variant.
Try switching from the small 8x8 board to 10x10 board, and vice versa.

I am now done with the international checkers variant and jetan as well. The first one was almost a rewrite as I was forced to represent moves
as structs and also do sliders move generation. You will enjoy the international checkers version , but it is not easy to get it up running... ... edirects=0
Please try switching the checkers and chess variants, and suggest how to make the process smoother.

Is there a way to select the 2nd element from the combo box at start up ? Because right now the combos select the first element by default,
which causes a problem when I have f.i the second variant active. It will not send an 'option variant=xxxx' in that case.

Re: Some questions to H.G.Muller about Winboard.

Posted: Thu Jan 27, 2011 11:43 am
by hgm
winboard.debug wrote:731 >first : xboard
protover 2
761 <first : feature done=0
761 >first : accepted done
761 <first : setup (P...Q.p...q.) 8x8+0 1p1p1p1p/p1p1p1p1/1p1p1p1p/8/8/P1P1P1P1/1P1P1P1P/P1P1P1P1 w - - 0 1
1072 <first : ht 524288 X 128 = 64MB
1072 <first : feature name=1 myname="NebiyuCheckers_1.0"
1072 >first : accepted name
1072 >first : accepted myname
... (more features)
1092 <first : feature option="variant -combo 8x8+0_checkers /// 10x10+0_checkers"
1092 >first : accepted option
1092 <first : feature done=1
1092 >first : accepted done
1102 >first : new
1102 >first : variant checkers
1102 >first : force
1102 >first : setboard 1p1p1p1p/p1p1p1p1/1p1p1p1p/8/8/P1P1P1P1/1P1P1P1P/P1P1P1P1 w - - 0 1
1102 >first : level 40 10 0
1102 >first : post
1102 >first : hard
1102 >first : easy
1402 <first : setup (P...Q.p...q.) 8x8+0 1p1p1p1p/p1p1p1p1/1p1p1p1p/8/8/P1P1P1P1/1P1P1P1P/P1P1P1P1 w - - 0 1
31245 >first : option variant=10x10+0_checkers
31405 <first : setup (P...Q.p...q.) 10x10+0 1p1p1p1p1p/p1p1p1p1p1/1p1p1p1p1p/p1p1p1p1p1/10/10/1P1P1P1P1P/P1P1P1P1P1/1P1P1P1P1P/P1P1P1P1P1 w - - 0 1
44855 >first : force
44855 >first : new
44855 >first : variant checkers
44855 >first : level 40 10 0
44855 >first : post
44855 >first : hard
44865 >first : easy
45145 <first : setup (P...Q.p...q.) 8x8+0 1p1p1p1p/p1p1p1p1/1p1p1p1p/8/8/P1P1P1P1/1P1P1P1P/P1P1P1P1 w - - 0 1
48440 >first : result * {xboard exit}
48450 >first : force
48450 >first : quit
It seems you set the 10x10 FEN at the wrong moment, not in response to the variant command. I see one already after the protover, and one in response to the option variant command.

By doing this, you confuse WinBoard: it already loads the position before initializing a new game. As a result, it now thinks that the user set up that non-standard position. So it ignores the setup from the engine, and it sends it a setboard in stead, with the position assumed to be given by the user. (We don't want an unknown variant to start from the default initial position of that variant if the user provided a position.)

You should also not send a setup in response to the user setting an engine option, even if that option would change the (sub-)variant. The engine combobox settings should only determine what sub-variant will be played in the _next_ game, not in the current game. And it should not automatically start a new game, as WB would have no idea it is doing that, and GUI and engine would get out of sync. (To WB this is just an engine-defined option that could mean anything, like switching on or off engine logging during a game.) So you should wait for the user to click New Game. That wouldalso gve him time to set the other engine to the new sub-variant, if needed. In fact the combobox choice should only become effective when you actually select the variant to which it applies; e.g. in Fairy-Max there is a combobox to tell it what to play for variant fairy, which should be ignored when Fairy-Max is set to play variant normal or gothic. In an engine that plays both Go and Checkers, you can have independent comboboxes for setting Checkers board size (8x8 or 10x10) and Go board size (9x9, 13x13 or 19x19). After all, that you support 19x19 Go does not have to imply you support 19x19 Checkers.

Re: Some questions to H.G.Muller about Winboard.

Posted: Thu Jan 27, 2011 5:00 pm
by Daniel Shawul
Ok I get it. I now understand that the dimension of the board should be changed from the variants menu to play 10x10 international game.
If I only did it from the local combo box, it will change the variant but winboard will send a 'variant checkers' message which change variant to an 8x8 again. To get a 'variant 10x10+0_checkers' it is a must to change it there. This was what was causing the confusion for me. Now I fixed it.

About the promotions, attaching a promotion letter 'p' to suppress pseudo-promotion sounds a bit of a hassle, so for now I will just use another character.

Re: Some questions to H.G.Muller about Winboard.

Posted: Thu Jan 27, 2011 5:52 pm
by hgm
Note that it is not the character that matters, but the underlying WB piece type.

Also note that you are perfectly free to play 10x10 checkers after WB sends you variant checkers, if the combobox tells you to do so. This is what the comboboxes are for. They could make you play Rifle Chess after receiving variant checkers, or whatever other variant you want. So it is perfectly legal for the engine to change the board size to 10x10 _after_ receiving variant checkers. The goal should not be to have the first engine receive variant 10x10+0_checkers, because it already knows you are going to play that from its combobox.

However, once the first engine has sent the setup 10x10+0 FEN in response to variant checkers, the _second_ engine will receive variant 10x10+0_checkers.

So it is not really needed to set the board format through the WB menu, provided that you set it through the combobox of the first engine. You would not even have to set it in the combobox of the second engine, provided you let an explicit format specification in the variant name overrule the combobox setting. (This would not work when you are really substituting one variant for another, as the setup command does not transfer variant names, ust board format. So if I want Fairy-Max to play a game of Chess with Different Armies, Clobberes vs. Nutters, against itself, I would really be forced to set both first and second engine comboboxes to Clobberers vs. Nutters, before selecting variant fairy, and starting the game.)

So the recommended implementation is:
* With explicit size prefix in the variant name, use the specified size, so that the user can set it for both engines at once in the New Variant menu.
* Without size prefix to the variant name, use the engine default, possibly set through a -combo engine option.