WinBoard, exotic version

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
hgm
Posts: 23791
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

WinBoard, exotic version

Post by hgm » Sat Jan 15, 2011 6:24 pm

Mainly because Daniel Shawul was developing an engine that, next to Chess variants, could also play some board games that are not Chess variants, (such as Checkers, Go, Reversi), I made some enhancements in WinBoard to make it (somewhat) usable as a GUI for such games too. There are several problems with such games you do not have in Chess:

1) Moves can have side effects, i.e. the afect other sqares than the from- and to-square. (Like e.p. capture in Chess.)
2) Moves are not always fully characterized by from- and to-square, but take a complex path (the exact path determining the side effects), such as multiple captures in Checkers.
3) In some games you can move multiple pieces per turn (like Castling in Chess)

(2) and (3) are most easily handled by considering them as special cases of doing multiple moves per turn, each 'leg' of the move being a simple move (perhaps with side effects). In (2) you would do multiple moves with the same piece, in (3) with different pieces. So I built into WB a general mechanism toplay multiple moves per turn (which could also be used in Chess variants, e.g. to enter non-standard castlings):

When you keep control pressed during a move, the side to move will not change after it, and you are allowed to enter another move for the same side. An engine can achieve the same effect by suffixing a hyphen to the move in its move command. It can then send a continuation move in another move command. In the other direction, to the engine, WB will send a multi-move in a single line, all (long algebraic) moves separated by hyphens.

As to the side effects:

I defined three new variants, each with a different side effect to the moves. This is similar to variant atomic, where the side effect is to destroy all pieces near a capture square. These are variants are variant checkers, go and reversi.

[d]1nbqk2r/2ppp1pp/BN6/rpK3P1/p1pnbN2/P7/1PPP1PPP/2BQR3 w k - 0 1

In the above diagram, playing b4 would result in the disappearence of Pa4, Pb5 and Ra5 in variant go:

[d]1nbqk2r/2ppp1pp/BN6/2K3P1/1PpnbN2/P7/2PP1PPP/2BQR3 b k b3 0 1

The same move in variant reversi would flip the color of b5, Pc4, Nd4 and Be4:

[d]1nbqk2r/2ppp1pp/BN6/rPK3P1/pPPNBN2/P7/2PP1PPP/2BQR3 b k b3 0 1

Finally, playing Re1xe7 would make Be4 disappear in variant checkers:

[d]1nbqk2r/2ppR1pp/BN6/rpK3P1/p1pn1N2/P7/1PPP1PPP/2BQ4 b k - 0 1

You can obviously only play the latter with legality checking off, which is for which these variants are intended, as WB knows nothing of the rules for these games. The engine would have to enforce the rules (which in WB protocol is possible). WB does not even have an initial setup for them, you would have to paste that in, or let it be loaded automatically from file. Likely the pieces you use move in ways that would violate their use as a Chess piece. Like in Checkers:

[d]1p1p1p1p/p1p1p1p1/1p1p1p1p/8/8/P1P1P1P1/1P1P1P1P/P1P1P1P1 w - - 0 1

Also added is variant amazons, for which the rules are so simple and Chess-like that even WB knows them. You must do two moves per turn here, and WB knows it (even when you do nor press control, and do not use hyphens). After you moved a piece, WB waits for you to click a square where to throw the arrow. The engine would have to send the arrow tracjectory in long algebraic (from + to-square).

To allow even more general side effects, there is variant alien, where the engine is in total control: after every move it can send a setup command with a FEN to define the new board position.

Finally variant dark is in progress of being added to support Dark Chess. The GUI part already works (so you can play in dark mode against a normal engine), but the back-end still has to be fixed for proper communication with a Dark-Chess engine.

I am not sure any of this should go in the main line. Anyway, the beta version is at

http://hgm.nubati.net/WinBoard-4.5.beta.zip

Daniel Shawul
Posts: 3762
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: WinBoard, exotic version

Post by Daniel Shawul » Sat Jan 15, 2011 8:43 pm

Hi all
Nebiyu checkers is available https://sites.google.com/site/dshawul/N ... ects=0&d=1.
It plays decent checkers with "chess tree search" i.e null move & lmr other heuristics... Good for the curious I suppose!
It was playing bad games before because it was returning random evaluation from uninitialized piece value tables. Now that I gave values of 1 and 3.5 for pawns and queens, it started playing good checkers.

Changes
- corrected eval ofcourse
- corrected mate/stalemate issues
- "white" to move first checkers :)
- added "setup" command in response to "variant checkers"
- No move ordering yet.

All that is needed it to comeup with beautiful circular fonts to represent the pieces ! Can't help you there :)
If it isn't strong enough for you, ask for SMP version, if not cluster version :)

Code: Select all

1. a3b4 {-1.56/23} f6e5 {+1.49/24} 2. g3f4 {-1.55/23} e5g3 3. f2h4 {-1.54/21} g7f6 {+1.41/21} 4. b2a3 {-1.26/21} b6c5 {+1.21/22} 5. h2g3 {-1.49/22} f8g7 {+1.27/22} 6. e1f2 {-1.03/24} a7b6 {+1.34/25} 7. a1b2 {-1.29/24} f6e5 {+1.35/26} 8. e3d4 {-0.96/26} c5e3 9. f2d4,d4f6 {-1.20/24} g7e5 {+1.97/24} 10. d2e3 {-1.19/23} b6c5 {+1.77/23} 11. g1h2 {-1.57/22} e7f6 {+1.37/25} 12. e3f4 {-1.45/26} h8g7 {+0.96/25} 13. b4a5 {-1.97/28} e5d4 {+4.79/24} 14. c3e5 f6d4 15. a5b6 {-1.39/23} c7a5 16. f4g5 {-2.38/23} h6f4 17. g3e5,e5c7 b8d6 {+4.46/23} 18. h2g3 {-3.12/25} d6e5 {+9.01/24} 19. h4g5 {-3.07/22} a5b4 {+2.44/22} 20. g5h6 {-2.88/24} b4c3 {+2.04/24} 21. h6f8=Q c3a1=Q 22. c1d2 {+1.19/20} Qb2 {+3.15/23} 23. d2c3 {-3.43/20} d4e3 {+4.74/21} 24. c3b4 {-3.93/21} c5d4 {+4.88/20} 25. b4c5 {-3.30/20} e3f2 {+4.65/20} 26. Qg7 {-2.44/19} f2e1=Q {+3.37/19} 27. g3h4 {-3.23/20} d4e3 {+4.51/19} 28. c5b6 {-3.17/21} e3f2 {+3.98/20} 29. b6a7 {-3.39/19} f2g1=Q {+3.54/19} 30. a7b8=Q {-3.19/19} Qed2 {+4.80/18} 31. a3b4 {-3.04/18} Qdc3 {+4.90/20} 32. Qf6 {-2.73/20} Qc3a5 33. Qf6d4 Qgf2 {+3.62/21} 34. h4g5 {-1.01/21} d8e7 {+1.58/20} 35. Qc5 {-0.90/20} Qba3 {+3.32/20} 36. g5h6 {-0.97/21} Q5b4 {+1.48/22} 37. Qcb6 {-0.79/19} Qbc3 {+2.59/19} 38. h6g7 {-1.13/19} e7f6 {+2.79/19} 39. g7f8=Q {-0.63/19} f6g5 {+1.38/19} 40. Qe7 {-0.90/20} g5f4 {+3.21/22} 41. Qef8 {-2.84/18} f4e3 {+3.01/20} 42. Qg7 {-3.23/18} e3d2 {+3.24/21} 43. Q8c7 {-2.94/17} d2c1=Q {+3.21/19} 44. Qcd6 {-3.39/17} Q1d2 {+3.18/17} 45. Qgh6 {-3.29/18} Qde3 {+3.28/19} 46. Qg7 {-3.29/18} Qfg3 {+3.36/19} 47. Qbc5 {-3.27/20} Qcd4 {+4.23/20} 48. Qcb6 {-3.61/20} Qab4 {+3.62/19} 49. Qde7 {-3.62/20} Qef4 {+3.74/19} 50. Qed6 {-3.78/18} Qgh4 {+4.25/20} 51. Qa5 {-3.26/19} Qdc5 {+6.33/24} 52. Qa5c3 Qc5e7 53. Qcd4 {-3.99/22} Qed6 {+3.91/23} 54. Qh8 {-3.81/24} Qde7 {+24.00/24} 55. Qc3 {-3.57/24} Qef8 {+24.00/26} 56. Qb4 {-3.91/26} Qe5 {+23.20/26} 57. Qc3 {-99.71/27} Qhg3 {+23.20/24} 58. Qd2 {-4.03/25} Qd4 {+99.92/64} 59. Qg7 {-99.93/64} Qf8h6 60. Qc1 {-99.95/26} Qdc3 {+99.96/64} 
Daniel

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

Re: WinBoard, exotic version

Post by hgm » Sat Jan 15, 2011 9:38 pm


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

Re: WinBoard, exotic version

Post by hgm » Sat Jan 15, 2011 10:57 pm

Image

Daniel Shawul
Posts: 3762
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: WinBoard, exotic version

Post by Daniel Shawul » Sat Jan 15, 2011 11:41 pm

How did you get them so beautiful. Mine just displays O and P. I do not how to properly install the fonts in winboard. Is puting the name of the font like below enough

/renderPiecesWithFont="Draughts Ultrecht"
/fontPieceToCharTable="pnbrqkomvtwl"

or

/fontPieceToCharTable="pqPQ"

Daniel Shawul
Posts: 3762
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: WinBoard, exotic version

Post by Daniel Shawul » Sun Jan 16, 2011 2:51 am

My Go and reversi engines are also finished somewhow. But drop moves like f5 are rejected by winboard. Is the format f.i "move f5" for reversi ? I would like to provide decent engines for all of them to demonstrate the new capabilities of winboard. The checkers engine have become strong after I removed null move and fixed other bugs.

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

Re: WinBoard, exotic version

Post by hgm » Sun Jan 16, 2011 8:09 am

Drop-move format in WB protocol is P@f5. So you need to indicate the piece you drop. It is not smart enough to realize that if you only have a single piece type defined in the pieceToCharTable, the piece indicator before @ is redundant. The @ itself would never be redundent as long as WB does not know enough of the rules to know that drops are the only moves allowed. 'f5' would be valid SAN for a move of another Pawn from somewhere on the board to e5.

Of course I could smarten-up the SAN disambiguator to make the mention of a single square in variants go and reversi interpreted as drops. Or perhaps in any game where the piece to char table defines only a single piece type that is not a Pawn. In that case ordinary SAN would never produce moves of the format 'e4', and it is also obvious what piece you mean to drop. WB understands SAN on input. On output it would use the protocollar P@e4 format, even if the engine specified feature SAN=1. To alter that I would have to alter the SAN generator. That is an awful lot of changes, but it would give nicer PGN. So perhaps at some point I might do it. For now, it is better to use the P@f5 format, and refrain from SAN in either direction.

What I will certainly do is make the piece-drop menu smarter: if there is only a single piece type defined in the pieceToCharTable, popping up the menu to choose one on a right click makes no sense, and WB should drop it immediately in response to a right click on an empty square. (Perhaps under control of the option /oneClickMove.)

The "Draughts Utrecht" font has the definition g=black king, h=white king, b=black chip, d=white chip (IIRC), all on white background. (Such fonts typically also have characters for pieces on black background, as they are used for including diagrams in text documents.)

The /fontPieceToCharTable option uses the same mapping of character positions to piece types as the /pieceToCharTable. I.e. first all white pieces, then equally many black. Within each color, last is always King, the others are in order PNBRQ..., as far as you get. (This to provide backward compatibility with Winboard_x versions that support only 6 pieces..) So what you need here is

/fontPieceToCharTable="h...d.g...b."

This to tell WB that the d and b are for Queens, not Knights. The extra period behind d and b indicates the Kings, if they had not been there, d and b would have be taken for Kings, not Queens.

I think WB rejects any pieceToCharTable that is not at least 12 long (or odd).

Daniel Shawul
Posts: 3762
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: WinBoard, exotic version

Post by Daniel Shawul » Sun Jan 16, 2011 11:02 am

Unfortunately no luck with both.
I supported reading and writing of drop moves f.i "P@c4". And it can read them properly from command line of nebiyu but winboard still says illegal move forfeit. I tried to also use "feature san=1", no change.

The draughts ultrecht now displays h and g for reversi pawns not pictures. Is there a step by step procedure I should follow after installing the fonts in c:/windows.

Edit: Also how to resize the board to 9X9 for Go. You mentioned about it for a 10X10 checkers but I have not clearly understood. I tried to look into fairy-max's source but I still dont get it.

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

Re: WinBoard, exotic version

Post by hgm » Sun Jan 16, 2011 11:49 am

To resize the board, use the (volatile) options /boardWidth and /boardHeight. Default values for those are -1, which means the default size far the selected variant is used. The latter is still defined as 8x8 for reversi, go and checkers. Perhaps I should change it to 9x9 for go. When a variant is not played with the default board and holdings size, WB will inform the engine of this by prefixing the variant name with the actual size, like variant 9x9+0_go meaning 9x9 board and no holdings. The engine should really have announced it is able to play this deviating bord size, by sending feature variants="9x9+0_go" at startup.

As to the font: Are you sure you have it installed properly? I.e., if you open MS Word, or WordPad, or other text editors that can handle fonts, can you see "Draughts Utrecht" in your font-selecton combobox? If not, is the TTF file visible in your system's fonts folder? (For me this was F:\WINNT\Fonts.) All I had to do was download the font at the link, and unpack it in the fonts folder. The file ChessMark.ini in the WinBoard folder of the standard install gives an example of how to use a font in WB.

I wil check out the dropping problem.

I have some trouble finding a font that produces a nice thin circle. The closest I got was the upper-case O of Garamond, but it is still much too fat, forcing me to define the perimeter color of the white stones as whitish to not look extremely ugly:

Image

Amazons can be played with normal Chess pieces, so no problems there:

Image

Daniel Shawul
Posts: 3762
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: WinBoard, exotic version

Post by Daniel Shawul » Sun Jan 16, 2011 12:41 pm

Board size still did not change.
ht 2097152 X 64 = 128MB
<COMMAND LINE>
==============================
<000000000500>xboard
<000000000500>protover 2
feature name=1 myname="Nebiyu_07:27:09"
feature sigint=0 sigterm=0

feature variants="9x9+0_go"

feature setboard=1 san=1 draw=0 colors=0
feature smp=0 memory=0 egt="nebiyu"
feature option="log -check 0"
feature option="clear_hash -button"
feature option="resign -spin 800 100 30000"
feature option="smp_depth -spin 4 1 10"
feature option="cluster_depth -spin 1 8 16"
feature option="message_poll_nodes -spin 200 10 20000"
feature option="use_iid -check 1"
feature option="use_null_move -check 1"
feature option="use_singular -check 0"
feature option="singular_margin -spin 30 0 1000"
feature option="futility_margin -spin 125 0 1000"
feature done=1
<000000000500>accepted done
<000000000500>accepted name
<000000000500>accepted myname
<000000000500>accepted sigint
<000000000500>accepted sigterm
<000000000500>accepted variants
<000000000500>accepted setboard
<000000000500>accepted san
<000000000500>accepted draw
<000000000500>accepted colors
<000000000500>accepted smp
<000000000500>accepted memory
<000000000500>accepted egt
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted option
<000000000500>accepted done
<000000000516>new
<000000000547>random

<000000000547>variant go
setup (P...Q.p...q.) 9/9/9/9/9/9/9/9/9 w - - 0 1

<000000000547>level 40 1 0
<000000000547>post
<000000000547>hard
<000000000547>easy
<000000003032>result * {xboard exit}

[FEN "9/9/9/9/9/9/9/9/9 w - - 0 1"]


<000000003032>force
<000000003032>quit
Bye Bye
About fonts, they are properly installed as I can see the 'draughts ultrecht' font in word like the "chess mark" font. But winboard displays letters only.

I like your Go board btw. How did you make the stones to be displayed on the intersections rather than in the squares.

Also before I fotget, in 19x19 go the files are numbered alphabetically but the 9th alphabet is skiped for some weird reason I am not aware of.
We are going to use from 'a' to 's' rather than 'a' to 't', right ?

Edit:
For checkers, I think you said multiple capture moves can not be input to the GUI by clicking. So this is just a remined that clicking the 'from' and final 'to' square does not work. Even a dedicated checkers GUI I have seems to have this trouble of resolving multi-capture ambiguites for human-computer play.

Post Reply