Xboard crazyhouse problem

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27794
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xboard crazyhouse problem

Post by hgm »

stevenaaus wrote:Looks like i'm stuck with the super powerful but infuriating XBoard. (Sorry HG) Whaayyyy cant that thing remember settings ?.
What settings do you want it to remember? Since 4.5.0 it should remember its own settings, in so far they are not engine-related. Other settings, such as the variant, can be installed with the engine, so they take effect automatically whn the engine is loaded from the menu. Polyglot can remember all settings of UCI engines for XBoard. What else would you need?
Do i really have to use the command line. And it crashes at the drop of a hat with my old XOrg, :twisted: though it's probably not xboards fault.
This is still the double-click problem? I brought that up with other XBoard developers, and no one could reproduce it. They suggested it must be some incompatibility between your Xlib and glibc versions.
User avatar
hgm
Posts: 27794
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xboard crazyhouse problem

Post by hgm »

TonyJH wrote:I think this was easy to reproduce and occurs with recent WinBoard versions. It's only an issue for viewing PGNs. I can try again and provide a debug file if H.G. is interested.
Yes, this would be helpful. Or perhaps just send me the PGN file for which this happens. I cannot imagine beforehand why this would occur, and why loading PGN should behave differently from when the engine supplies the moves.
Btw, TJchess can play loop chess too, but it wouldn't currently work with WinBoard/XBoard since TJchess would require the interface to send "variant loop".
There is a somewhat more user-friendly method to support variants that XBoard does not know yet, which I also use in Fairy-Max for playing Cambodian Chess (Ouk). You just let the engine define an option

feature option="Loop Chess rules -check 0"

that will appear in the Engine Settings menu dialog, and when ticked by the user will cause XBoard to send

option Loop Chess rules=1

to the engine. The engine can store this info in a flag, which it consuts whenever it receives the variant crazyhouse command to decide if it will switch to Loop Chess or Crazyhouse. If you want to install it such that it plays Loop Chess by default, you could add the extra options on the engine line:

-firstOptions "Loop Chess rules=1" -pieceToCharTable "PNBRQKpnbrqk"

by editing the engine list. (Assuming the -variant crazyhouse was already on there too.)

Note, however, that XBoard forgets the pieceToCharTable when you use the menu to switch to another variant, even if you switch back to the original variant later. (Perhaps I should let it remember this, as I already do for -pieceNickNames.)
stevenaaus
Posts: 608
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: Xboard crazyhouse problem

Post by stevenaaus »

hgm wrote:
stevenaaus wrote:Looks like i'm stuck with the super powerful but infuriating XBoard. (Sorry HG) Whaayyyy cant that thing remember settings ?.
What settings do you want it to remember? Since 4.5.0 it should remember its own settings, in so far they are not engine-related. Other settings, such as the variant, can be installed with the engine, so they take effect automatically whn the engine is loaded from the menu. Polyglot can remember all settings of UCI engines for XBoard. What else would you need?
I installed two engine - sjeng, and tkchess. Two play a two engine game of crazy house i have to
LoadNewEngine - Select Sjeng as Engine 1
LoadNewEngine - Select TJ as Engine 2
I have to do this every time. Otherwise it always wants to use Fairymax.
Another Case - I want to play sjeng at Crazyhouse with time odds, which are not remembered.
And i often set the time odds before i remember to set the engine, when i have to set the time odds *again* as it hasn't remembered the value from 5 seconds ago.

Is there a way to resize the board ?

Another criticism i have is the new variant dialog. This shows variants available for the current engine, but for ages this fact eluded me as it is not mentioned anywhere . It should say "Variants supported by engine Fairymax" ( or whatever), or better still - have a drop box at the top with which to select an engine.
Do i really have to use the command line. And it crashes at the drop of a hat with my old XOrg, :twisted: though it's probably not xboards fault.
This is still the double-click problem? I brought that up with other XBoard developers, and no one could reproduce it. They suggested it must be some incompatibility between your Xlib and glibc versions.
Playing crazyhouse against an engine. I play - lose - step back a few moves to examine game, and then truncate game and set mode to engine as black. Well, it only succeeds half the time. The other times, the engine won't play. If i try another time or two, xboard can die.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Xboard crazyhouse problem

Post by Michel »

I installed two engine - sjeng, and tkchess. Two play a two engine game of crazy house i have to
LoadNewEngine - Select Sjeng as Engine 1
LoadNewEngine - Select TJ as Engine 2
I have to do this every time.
Yes it seems xboard does not remember firstEngine and secondEngine.
This is in fact one of the few things I would want it to remember...

Perhaps there should be non-volatile options -defaultFirstEngine and -defaultSecondEngine.
User avatar
hgm
Posts: 27794
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xboard crazyhouse problem

Post by hgm »

stevenaaus wrote:I installed two engine - sjeng, and tkchess. Two play a two engine game of crazy house i have to
LoadNewEngine - Select Sjeng as Engine 1
LoadNewEngine - Select TJ as Engine 2
I have to do this every time. Otherwise it always wants to use Fairymax.
Another Case - I want to play sjeng at Crazyhouse with time odds, which are not remembered.
And i often set the time odds before i remember to set the engine, when i have to set the time odds *again* as it hasn't remembered the value from 5 seconds ago.
Well, all this is easy to do. (The tables with command-line options in args.h contain a boolean field that determines if the option is persistent or volatile, and it is just a matter of flipping those, and recompile.) But the question is what is most desirable. In general people have many engines installed, and they don't use all of them equally often. The probability that they get the engine they need by default is then larger when their favorite engine is their fixed default, than when they get the engine they last used.

But a fixed default is of course the worst if it is a default you _never_ want. So there is some merit in Michel's proposal to make an option for setting the default engines. Note that the same effect can already be achieved by configuring, though: the default engines can be specified through normal -fcp, -scp options in the master settings file (/etc/xboard.conf). If it is undesirable that the user should alter system files (e.g.different users want different default engines) they can add another level of indirection by renaming their ~/.xboardrc to ~/.myXBoardSettings, and creating a new ~/.xboardrc that contains the lines:

-fcp sjeng
-scp tjchess
-variant crazyhouse
-settingsFile ~/.myXBoardSettings
-saveSettingsFile ~/.myXBoardSettings

After that, XBoard will always start with the mentioned engines as defaults.

Note that it should also be possible to select recently used installed engines directly from the Engine menu. This saves you the work of going to the Load Engine dialog. (I admit: this does not work for engine 2. I thought about whether I should bump first engine to second engine when the user uses this menu...)
Is there a way to resize the board ?
Not during a session. There are command-line options that specify the startup size, though. Like -size middling, -size bulky (equivalent to -size 49, -size 72). XBoard still lags a lot behind WinBoard in this respect.
Another criticism i have is the new variant dialog. This shows variants available for the current engine, but for ages this fact eluded me as it is not mentioned anywhere . It should say "Variants supported by engine Fairymax" ( or whatever), or better still - have a drop box at the top with which to select an engine.
Well, it does show all variants, but the variants that you cannot currently select, because they would only make the engine crash, are grayed out (set insensitive). I thought this was absolutely standard. Would it solve the problem if I added a message "(variants not supported by <engineName> disabled)"?
I see that when you select a variant the second engine does not play, XBoard complains about this when you select Two Machines, and exits with a fatal error. I guess the latter is a bit harsh; there really is no reason why it should exit at all. It can simply refuse to switch to Two Machines mode. I will certainly fix that for 4.6.1.
Calling dialogs from other dialogs is a bit tricky, and I'd rather not do it. Calling up the Load Engine dialog from the main menu is not any more work than calling it from the New Variant dialog.
Playing crazyhouse against an engine. I play - lose - step back a few moves to examine game, and then truncate game and set mode to engine as black. Well, it only succeeds half the time. The other times, the engine won't play. If i try another time or two, xboard can die.
OK, I see. It would be helpful if you could make a debug file (option -debug) of a case where it goes wrong,and send it to me, so that I can check if XBoard or the engine is at fault. (Some engines do not support the undo command properly, and there is nothing I can do about that.) Note that in principle the recommended way to do this is to use the Retract Move item in the Engine menu (or its Ctrl-X shortcut), not use Truncate Game. I will check if truncating while an engine is playing is properly handled. Do you switch to EditGame mode first?
User avatar
hgm
Posts: 27794
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xboard crazyhouse problem

Post by hgm »

If you want to try a version that prints the warning in the New Variant dialog about enabling, and for which a non-playing second engine is not fatal, you can find one in the 'refactor' branch of my git repository at http://hgm.nubati.net/cgi-bin/gitweb.cgi . (Just close the xtra board that appears; I am in the middle of something...)
TonyJH
Posts: 183
Joined: Tue Jun 20, 2006 4:41 am
Location: USA

Re: Xboard crazyhouse problem

Post by TonyJH »

H.G., here is the PGN for the issue I mentioned. I get a pop-up error "Illegal move: 35. P@e2".

I tried deleting my winboard.ini file in appdata\roaming directory and the problem went away. Then I noticed that the setting "test legality" is what makes the difference. It looks like the problem only occurs with "test legality" set to false.

Code: Select all

&#91;Event "TJchess game"&#93;
&#91;Site "?"&#93;
&#91;Date "2012.01.18"&#93;
&#91;Round "?"&#93;
&#91;White "hamish"&#93;
&#91;Black "TJchess 1.1"&#93;
&#91;Result "*"&#93;
&#91;WhiteElo "1736"&#93;
&#91;BlackElo "2461"&#93;
&#91;TimeControl "180+0"&#93;
&#91;Variant "crazyhouse"&#93;
&#91;Time "21&#58;53&#58;53"&#93;

1. d4 Nf6 2. Nf3 d5 3. Bg5 Nc6 4. e3 Ne4 5. Bf4 Bg4 6. Be2 Bxf3 7. Bxf3
Nxf2 8. Kxf2 N@a4 9. Qc1 P@e4 10. Be2 a6 11. Rf1 e6 12. Kg1 Bd6 13. B@e5
Bxe5 14. Bxe5 Nxe5 15. dxe5 B@g6 16. N@g4 B@e7 17. B@f6 gxf6 18. exf6 Bd6
19. P@e5 Bc5 20. Nc3 Nxc3 21. bxc3 Qd7 22. N@d4 O-O-O 23. Rb1 N@b6 24. Bxa6
bxa6 25. P@c6 Qe8 26. Rxb6 Bxb6 27. N@e7+ Kb8 28. N@d7+ Rxd7 29. cxd7 Qxd7
30. Nec6+ Ka8 31. Qb2 P@e2 32. Rb1 R@f1+ 33. Rxf1 exf1=Q+ 34. Kxf1 B@c4+
35. P@e2 R@h1 36. R@g1 N@d2
*
TonyJH
Posts: 183
Joined: Tue Jun 20, 2006 4:41 am
Location: USA

Re: Xboard crazyhouse problem

Post by TonyJH »

Daniel Shawul wrote:If you are looking for engines, Nebiyu can play crazyhouse and shogi too
Daniel, is it NebiyuAlien.exe that plays crazyhouse? Is there some special setup needed? It doesn't seem to report crazyhouse as a supported variant, but I might not have it set up correctly.
User avatar
hgm
Posts: 27794
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Xboard crazyhouse problem

Post by hgm »

TonyJH wrote:H.G., here is the PGN for the issue I mentioned. I get a pop-up error "Illegal move: 35. P@e2".

I tried deleting my winboard.ini file in appdata\roaming directory and the problem went away. Then I noticed that the setting "test legality" is what makes the difference. It looks like the problem only occurs with "test legality" set to false.
Indeed, it seems that legality testing off causes the problem. In this mode any promotion suffix is taken seriously (even when you specify something like Rb3g3=K). This to support unknown variants with unusual promotion zones. This code was added at the end of MakeMove, and thus overrules the special treatment that was already made on Pawn moves to last rank in Crazyhouse, to substitute the 'shadow pieces'.

This is certainly unintended, but I wonder if it is undesired. For one, it would provide the user with a very easy way to play Loop Chess. In an unknown drop variant where the promotion pieces are different from primordial pieces (because they revert to Pawn), the user could simply define separate ID letters for those, and use these in the promotion suffix. When they are later captured, they will automatically revert to Pawns, because they do not fit in the holdings. (This is also the mechanism that makes the shadow piees revert with legality testing on.)

So perhaps we should leave it like this. (An argument against it is that the user could also play this as 8x8+5_normal, and would not need variant crazyhouse.)
TonyJH
Posts: 183
Joined: Tue Jun 20, 2006 4:41 am
Location: USA

Re: Xboard crazyhouse problem

Post by TonyJH »

Thanks HG. Now that I know I can just make sure legality testing is on for crazyhouse, this won't be a problem for me.