Page 1 of 1

Will Tournament Manager work with Xiangqi engines

PostPosted: 26 Jul 2010, 21:57
by tvt2020
Can some one show me how to setup a tournament between 2 Xiangqi engines.

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 27 Jul 2010, 08:16
by H.G.Muller
You either have to install all the XQ engines in PSWBTM with /variant=xiangqi (or @xq, because the xq.ini file already contains this option, next to setting the board style to oriental) amongst their WinBoard options. Or you would have to add the line /variant=xiangqi to the winboard.ini file. (It will stay there during the tourney, but it will disappear as soon as you save settings, as the variant is a volatile option.)

So for example, in the PSWBTM "parameters" field of the Engine Manager for HaQiKi D, you put:
WBopt /%sXBook /variant=xiangqi
or
WBopt /%xBook @xq

and for Elephant Eye you would put
QH\eleeye.ini WBopt /%sLogo="..\EleEye\logo.bmp" /variant=xianqi

For the rest things work exactly as between normal Chess engines. You just select the engines and start the tournament.

To install other UCCI engines, you would have to make a copy of eleeye.ini in the QH sub-folder of the WinBoard folder, and name it after that engine (e.g. 3dchess.ini). You would then edit that copy to replace the Name= and File= lines, e.g.
Name=3DChess 0.56
File=../3D/3Dchess.exe

You would then install the engine in PSWBTM by browsing to UCCI2WB.exe in the WinBoard folder, and make that the engine exe, and put for parameters:
QH\3dchess.ini WBopt /variant=xiangqi

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 28 Jul 2010, 15:56
by tvt2020
Thanks for the info

This work for me

Engine#1
Name: EleEye
Exe: C:\WinBoard-4.4.3\EleEye\UCCI2WB.exe
Parameters: C:\WinBoard-4.4.3\winboard\QH\eleeye.ini WBopt @xq

Engine#2
Name: gg503
Exe: C:\Engines\engine503\UCI2WB.exe
Parameters: gg503.exe C:\Engines\engine503 /fd=C:\Engines\engine503 WBopt @xq

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 28 Jul 2010, 17:11
by H.G.Muller
Yes, that should work.

Some remarks: I see that you copied the UCCI2WB.exe to the EleEye folder. If you do that (which is certainly a good method) you have the disadvantage that you would need a copy of UCCI2WB.exe in the folder of every UCCI engine, which is not very elegant. (But UCCI2WB is small, so who cares...?) The advantage is that WinBoard is already aware of the engine folder, and thus will automatically look for a logo.bmp file there. (If you use logos through /autoLogo=true; otherwise you would not care.) Another advantage is that you can also put the engine.ini file (here: eleeye.ini) in the EleEye folder, and give it the name UCCI2QH.ini. In that case you would not even have to specify it in the parameters, because if you call UCCI2WB.exe with no parameters, it will search by default for a file UCCI2QH.ini in its own folder. In that case you would just have to type:

parameters: WBopt @xq

Explicit mentioning of the engine.ini file name is only necessary if you are using the same UCCI2WB.exe for all UCCI engines (e.g. one in the WinBoard folder), so that they cannot all be called UCCI2QH.ini. I prepared the install for that method, where all engine.ini files would go in the QH sub-folder, each with a name derived from the engine to which they belong.

Btw, it is enough to give the engine.ini path relative to the location of UCCI2WB.exe. So if you use the UCCI2WB.exe in the WinBoard directory you could simply say QH\eleeye.ini. Now that you use the copy in the EleEye folder, you could say ..\WinBoard\QH\eleeye.ini (which is not a big improvement, but keeps working when you would change the name of the WinBoard-4.4.3 folder). Or you could also copy the eleeye.ini to the EleEye folder, and then yu would only have to say

parameters: eleeye.ini WBopt @xq

For the other engine: As you have UCI2WB.exe put in the engine folder, you could actually leave out the second argument to UCI2WB altogether. The /fd= option should also not be necessary in the parameters field: PSWBTM already supplies this option to WinBoard automatically, deriving the path name of the folder from the Exe you have given. WinBoard makes this the current directory before it invokes UCI2WB, and then UCI2WB can simply stay there, because the engine exe happens to be there too.

parameters: gg503.exe WBopt @xq



One question:

I see you are using a UCI engine here different from Cyclone. Is that your own engine? I am curious if everything works well; I only had Cyclone to test on, and it was using non-standard UCI. I don't know if this is a special UCI dialect used by all XQ engines, or that it was just a peculiarity of Cyclone.

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 28 Jul 2010, 20:42
by tvt2020
I have a few xiangqi engines that i downloaded from the web, if you like i can email it to you for testing. my email address tvt2020@yahoo.com

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 30 Jul 2010, 21:02
by H.G.Muller
There now is an install available with a WinBoard specially configured for Xiangqi. The variant and board style are by default set to oriental Xiangqi. This makes installing engines much easier, as you can leave out the @xq and /variant options. Also /fUCI and /sUCI work (/%sUCI in PSWBTM).

For those who want to try it:

http://hgm.nubati.net/WinBoard-XQ.exe

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 31 Jul 2010, 16:10
by tvt2020
This is exactly what I have been waiting for all this time, a XQ-board I can understand and work with. Thanks

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 31 Jul 2010, 22:56
by H.G.Muller
Please let me know if you find any bugs, unexpected behavior, or have suggestions for improvements.

Note a new version of UCI2WB is available, which now handles options with spaces in their names. ( http://home.hccnet.nl/h.g.muller/USI2WB.zip ) This is now also included in the installer package.

Retract move will cause illegal move or engine exit unexpect

PostPosted: 01 Aug 2010, 07:07
by tvt2020
recognized 'xiangqi' (-1) as variant xiangqi
recognized 'xiangqi' (-1) as variant xiangqi
WinBoard 4.20100730 + UCCI2WB
Reset(1, 0) from gameMode 0
recognized 'xiangqi' (-1) as variant xiangqi
GameEnds(0, (null), 2)
shuffleOpenings = 0
TC string = '+40/5'
mps=40 tc=300000 inc=0
TC string = '+40/5'
mps=40 tc=300000 inc=0
StartChildProcess (dir="..\Fairy-Max") UCCI2WB QH\bugcchess.ini
785 >first : xboard
protover 2
802 <first : UCCI2WB by Morning Yellow and H.G.Muller
1265 <first : feature myname="BugCChess 2010 (UCCI2WB)"
1267 >first : accepted myname
1268 <first :
1268 <first : feature variants="xiangqi" setboard=1 debug=1
1270 >first : accepted variants
1270 >first : accepted setboard
1271 >first : accepted debug
1271 <first : feature usermove=1 sigint=0 sigterm=0 colors=0 done=1
1272 >first : accepted usermove
1273 >first : accepted sigint
1273 >first : accepted sigterm
1273 >first : accepted colors
1273 >first : accepted done
1284 >first : new
random
1284 >first : variant xiangqi
1284 >first : level 40 5 0
1284 >first : post
1285 >first : hard
1285 >first : easy
45 45 45 45 45 45 Legality test? d0e1
moveType 4 = 33, promochar = 0
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=5 (3,0)-(4,1) -
MateTest: K=0, my=16, his=16
move: d0e1
, parse: Ade1 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=1 bmm=0 ep=-4, reps=4
1 ep=-4
0 ep=-4
nps: w=-1, b=-1
nps: w=-1, b=-1
time odds: 1.000000 1.000000
3403 >first : time 30000
3404 >first : otim 30000
book key = a7fbb5c6f53086d5
book hit = (NULL)
3406 >first : usermove 3406 >first : d0e1
3457 <first : go time 299000 movestogo 40
3491 <first : 5 24 59 33870 b9c7 b0c2 h9g7 h0g2 b7a7
3508 <first : 6 12 76 62725 b9c7 b0c2 h9g7 h0g2 a9a8 b2a2
3546 <first : 7 34 115 143870 b9c7 b0c2 h9g7 h0g2 a9a8 c0e2 a8d8
3587 <first : 8 -12 155 272145 b9c7 h0g2 h9g7 b0c2 a9a8 c0e2 a8d8 a0d0 d8d0 e1d0
3665 <first : 8 1 234 564155 b7e7 h0g2 b9c7 h2i2 h9g7 b0c2 a9b9 a0b0
3739 <first : 9 -5 308 818890 b7e7 h0g2 b9c7 b0c2 h9g7 a0b0 a9a8 b2b8 h7i7
3956 <first : 10 -2 525 1643725 b7e7 h0g2 b9c7 b0c2 h9g7 a0b0 a9a8 h2i2 i9h9 i0h0
4408 <first : 11 0 976 3416330 b7e7 h0g2 b9c7 b2f2 h9g7 b0c2 a9b9 c0e2 h7i7 i0h0 i9h9
5047 <first : 11 12 1616 5967860 h9g7 b0c2 b7f7 h0g2 b9c7 a0b0 a9b9 b2b4 c9e7 b4b8 h7i7
5424 <first : 12 12 1992 7483895 h9g7 b0c2 b9c7 c0e2 b7a7 h0g2 i9i8 a0b0 i8d8 b2a2 a9a8 i0i1
7476 <first : 13 5 4045 15981430 h9g7 b0c2 b9c7 h0g2 a9a8 b2a2 a8d8 a0b0 b7a7 i0i1 i9i8 i1f1 i8f8 f1f8 d8f8
11324 <first : 14 6 7892 31805635 h9g7 b0c2 b9c7 h0g2 a9a8 c0e2 a8d8 a0d0 d8d0 e1d0 c6c5 b2b6 c7d5 b6g6 d5c3 h2i2
19391 <first : move h9g7
machine move 1, castling = 45 45 45 45 45 45
move to parse: h9g7
45 45 45 45 45 45 Legality test? h9g7
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=23 (7,9)-(6,7) -
MateTest: K=0, my=16, his=16
move: h9g7
, parse: Hg7 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=2 bmm=0 ep=-4, reps=4
2 ep=-4
1 ep=-4
0 ep=-4
silence
23722 >first : remove
45 45 45 45 45 45 Legality test? c0e2
moveType 4 = 33, promochar = 0
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=6 (2,0)-(4,2) -
MateTest: K=0, my=16, his=16
move: c0e2
, parse: Ece2 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=1 bmm=0 ep=-4, reps=4
1 ep=-4
0 ep=-4
time odds: 1.000000 1.000000
25193 >first : time 30000
25194 >first : otim 29821
book key = ba14e345aabb179a
book move field = 5828
book hit = b7f7
25196 >first : force
25196 >first : usermove 25197 >first : c0e2
25197 >first : usermove b7f7
machine move 1, castling = 45 45 45 45 45 45
move to parse: b7f7
45 45 45 45 45 45 Legality test? b7f7
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=33 (1,7)-(5,7) -
MateTest: K=0, my=16, his=16
move: b7f7
, parse: Cbf7 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=2 bmm=0 ep=-4, reps=4
2 ep=-4
1 ep=-4
0 ep=-4
silence
45 45 45 45 45 45 Legality test? a0a1
moveType 4 = 33, promochar = 0
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=3 (0,0)-(0,1) -
MateTest: K=0, my=16, his=16
move: a0a1
, parse: Ra1 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=3 bmm=0 ep=-4, reps=4
3 ep=-4
2 ep=-4
1 ep=-4
0 ep=-4
time odds: 1.000000 1.000000
29977 >first : time 29997
29978 >first : otim 29345
book key = 1530574261036fed
book hit = (NULL)
29980 >first : usermove 29980 >first : a0a1
29980 >first : go
30023 <first : go time 298970 movestogo 38
30026 <first : 5 100 43 15480 b9c7 b2d2 a9b9 b0c2 h7i7
30041 <first : 6 82 58 36150 b9c7 b2d2 a9b9 b0c2 f7f1 e1d0
30060 <first : 7 70 77 70545 b9c7 b2d2 a9b9 b0c2 f7f1 e1d0 f1h1
30097 <first : 8 130 114 184995 b9c7 b2d2 a9b9 b0c2 b9b3 h0g2 b3c3
30132 <first : 9 130 149 300875 b9c7 b0c2 a9b9 b2a2 b9b3 a1d1 b3c3 h0i2 i9i8
30272 <first : 10 121 289 774485 b9c7 a1d1 a9b9 d1d8 h7i7 d8g8 c7e8 i0i1 i9h9 i1h1 i7i3
30417 <first : 11 116 434 1265775 b9c7 a1d1 a9b9 d1d8 h7i7 b0d1 i9i8 d8i8 g7i8 h0g2 i8g7 i0h0 i7i3
30933 <first : 12 110 950 3156670 b9c7 a1d1 a9b9 h0i2 h7i7 i0h0 i7i3 d1d6 i9h9 d6c6 c9e7 b0d1 h9h5
31770 <first : 13 112 1786 6269445 b9c7 a1d1 a9b9 h0i2 b9b5 d1d8 f9e8 b0d1 g9e7 h2f2 h7h8 d8d4 i9g9
34019 <first : 14 101 4035 14949390 b9c7 b2d2 a9b9 b0c2 b9b3 c3c4 h7i7 h0g2 b3c3 a1a2 i9h9 i0h0 i7i3 a2b2 i3e3 g2e3 c3e3
39284 <first : 15 89 9301 35734400 b9c7 b2d2 a9b9 b0c2 b9b3 c3c4 b3c3 a1a2 i9i8 h0g2 i8d8 a2b2 d8d3 i0i1 c3c4
50621 <first : move b9c7
machine move 3, castling = 45 45 45 45 45 45
move to parse: b9c7
45 45 45 45 45 45 Legality test? b9c7
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=23 (1,9)-(2,7) -
MateTest: K=0, my=16, his=16
move: b9c7
, parse: Hc7 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=4 bmm=0 ep=-4, reps=4
4 ep=-4
3 ep=-4
2 ep=-4
1 ep=-4
0 ep=-4
silence
55521 >first : remove
45 45 45 45 45 45 Legality test? b0c2
moveType 4 = 33, promochar = 0
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=1 (1,0)-(2,2) -
MateTest: K=0, my=16, his=16
move: b0c2
, parse: Hc2 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=3 bmm=0 ep=-4, reps=4
3 ep=-4
2 ep=-4
1 ep=-4
0 ep=-4
time odds: 1.000000 1.000000
57199 >first : time 29997
57199 >first : otim 29611
book key = 1026e2942952a5dd
book move field = 7445
book hit = b9c7
57200 >first : force
57200 >first : usermove 57201 >first : b0c2
57201 >first : usermove b9c7
machine move 3, castling = 45 45 45 45 45 45
move to parse: b9c7
45 45 45 45 45 45 Legality test? b9c7
TC string = '+40/5'
mps=40 tc=300000 inc=0
CoordsToAlgebraic, piece=23 (1,9)-(2,7) -
MateTest: K=0, my=16, his=16
move: b9c7
, parse: Hc7 (
)
bare = 1, w,b = 16 16
MateTest: K=0, my=16, his=16
repeat test fmm=4 bmm=0 ep=-4, reps=4
4 ep=-4
3 ep=-4
2 ep=-4
1 ep=-4
0 ep=-4
silence
57236 <first : Illegal move (no idea why)
TC string = '+40/5'
mps=40 tc=300000 inc=0
size-move
sizing
sizing
sizing
sizing
sizing
sizing
sizing
sizing
sizing
sizing
exit size-move, size = 49
square size = 49
GameEnds(40, xboard exit, 2)
150512 >first : result * {xboard exit}
150513 >first : force
150513 >first : quit

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 01 Aug 2010, 09:22
by H.G.Muller
I will see if there is something I can fix. UCCI2WB actually is a version of UCCI2QH which I hacked to replace the QH commands by corresponding WB commands, without really knowing much about how it works. It could be that QH protocol does not support a command to retract moves, or that I simply forgot to make it recognize the WB "undo" command in stead. In the latter case I should be able to fix it easily.

It does not support analyze mode either, and I only used it for engine-engine games. I would really like to equip my UCI2WB adapter with UCCI capability as well. But it might not be possible: UCCI specs state that you have to send the position FEN not of the initial position, but that after the last irreversible move, and only the moves after that. Wich is impossible for an adapter that doesnot keep track of game state. I am not sure how UCCI engines would react if you send them all the moves from the start of the game anyway. They might crash after a certain number of moves, because they get sent more moves than their input buffer can handle.

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 01 Aug 2010, 18:58
by tvt2020
Is it possible to keep a log of current game's fen position and resend the fen position where the player want to retract to?

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 01 Aug 2010, 21:39
by H.G.Muller
Well, formally you would have to send the FEN after the last irreversible move before the position you want to retract to. But I guess you could remember those too, for every move, including the moves itself. It would require to have a real good look at the UCCI2WB source, to see where and how it makes those FENs,. You would have to update the internal board to the desired state too, or it would make wrong FENs for future positions. One of the problems of UCCI2WB is that all comments are in Chinese...

Anyway, I fixed the retract problem for UCI now, and uploaded the new UCI2WB.

[edit] OK, I think I fixed it. UCCI2QH (nd thus UCCI2WB) did implement 'undo' to take back one move. I just put a loop around it, that is executed twice when a 'remove' command is received. In theory, that should do it. (Not tested, though.)

Retract move it work now

PostPosted: 02 Aug 2010, 06:42
by tvt2020
Retract move works great for uci xq variant engines. thanks

Re: Will Tournament Manager work with Xiangqi engines

PostPosted: 02 Aug 2010, 12:03
by H.G.Muller
I think I got analysis to work too now, on UCCI2WB. The version supporting it is included in the WinBoard-XQ installer now.

backup winboard settings

PostPosted: 02 Aug 2010, 15:57
by tvt2020
Don't forget to backup the 2 files below, which has the engines configuration.

C:\WinBoard-XQ\PSWBTM\engines.pswbtm
C:\WinBoard-XQ\WinBoard\settings.ini