Tinkering with Winboard
by Alessandro Scotti

Last update: March 22, 2005.

This readme is about some modifications I made to Winboard 4.2.7. Some will work in Xboard too, while others are for Winboard only. Regardless, everything here is absolutely experimental and has been tested very little... so no warranties ok?

All modified sources are included in this archive, the rest can be downloaded from Tim Mann's Xboard page. Please feel free to take my changes and use them as you like, they are released under the GPL.

Game adjudication

User can adjudicate a game between two machines, using the "Action" menu. Note that this only works if two machines are playing.

Also, it is possible to adjudicate a game automatically with this parameter:

/adjudicateLossThreshold=-700

if set to a negative value, Winboard will adjudicate a game if a engine can't get a score above the specified threshold for 3 full moves (6 plies). Note that both engines must agree on the score value, and also the game is only adjudicated after the last move from the losing engine.

Adjudication is still under test!

Background textures

Add the following to winboard.ini:

/liteBackTextureFile="sandstone_w.bmp"
/darkBackTextureFile="sandstone_b.bmp"
/liteBackTextureMode=1
/darkBackTextureMode=1

Of course you can choose any file you like for texturing the light and dark squares, as long as it's a valid BMP (Windows bitmap) file.

Valid texture modes are 1 (default) and 2. In mode 1 the squares are taken from portions of the texture bitmap and copied without further processing. In mode 2, squares can also be rotated, mirrored and so on in order to provide a little more variety to the texture. The operations are selected at random so the board will look slightly different every time the program is run.

Note: to "comment out" a filename, put an asterisk in front of it, i.e. "*sandstone.bmp" will be skipped.

Additionally it is possible to override the size of the "gap" between the squares, which is otherwise selected automatically. Add this to winboard.ini:

/overrideLineGap=2

I have added this because textures usually look better with a smaller or no gap. Any negative value will ignore the override and use the standard value from Winboard.

The combination of these parameters can produce very interesting effects, see for example Alex Guerrero's page.

Font-based rendering of chess pieces

It is possible to use chess fonts to draw pieces, in place of the usual bitmaps. You have to specify the font name by adding the following to winboard.ini:

/renderPiecesWithFont="Chess Leipzig"

Chances are the program will automatically recognize the font and select the proper mapping, i.e. the correspondence between a chess piece and the corresponding font character. So if the board looks good you're set and there's nothing else to do, otherwise you'll have to find the proper mapping and tell it to the program with  this setting:

/fontPieceToCharTable="phbrqkojntwl"

The piece are in order: white pawn, knight, bishop, rook, queen, king and black pawn, knight, bishop, rook, queen, king. So the example above tells the program to use the letter "p" for a white pawn, the letter "h" for a white knight, the letter "t" for a black rook and so on.

Note: to "comment out" a font name, put an asterisk in front of it, i.e. "*Chess Merida" will be skipped because of the asterisk.

It is possible to customize the font foreground and background color, with these settings:

/fontPieceBackColorWhite=#ffffcc
/fontPieceForeColorWhite=#402010
/fontPieceBackColorBlack=#ffffcc
/fontPieceForeColorBlack=#301008

Colors are expressed in RGB notation. If you are not familiar with the RGB notation  I would suggest to leave them alone until I manage to update the GUI. In this case, the program will take the board settings as for the usual piece set.

It is also possible to control the size of the piece with respect to the square, for example this entry:

/fontPieceSize=80

tells the program to make the pieces about 20% smaller than a square (i.e. the piece size is 80%). Note that different fonts may require different values for this parameter. Usually values in the 70-80 range provide the best values, however the program accepts anything from 50 to 150.

Font-based pieces are automatically given a "roundish" look. For now, this option is not mapped to a user-definable setting.

Fast clipboard pasting

Press Ctrl-V to paste a PGN game or a FEN position from the clipboard, the program will try to autodetect the proper type.

Thread initialization bug

I've tried to fix a bug reported (and fixed) by Anastasios Milikas (of AICE), where a thread could try to access a not yet initialized variable. I've used a different approach here, where threads are started in a "suspended" state and then released only when the variable has been initialized (this has the advantage of putting all the required fix code in one place, and the disadvantage of not having been tested by Anastasios).

Protection from some buffer overflows

In just a few cases, I've tried to put some guard against buffer overflows. These are just quick attempts... a lot more work would be needed to provide some measurable benefits. I hope that bug **353 is finally fixed now. The buffer overflows were propagated across several functions so as soon as one was fixed another would crash!

Absolute scores can be converted to relative

Some engines (e.g. Crafty, Delphi) always report scores from the white side (i.e. absolute), rather than the engine side (i.e. relative). This leads to confusion and breaks features such as automatic adjudication. In order to convert the scores to relative add the following to winboard.ini:

/firstScoreAbs=false

If true, the score of the first program is absolute and will be negated when playing black. And similarly:

/secondScoreAbs=false

if true, the score of the second program is absolute and will be negated when playing black.

Engine search info can be saved in a PGN file

Add the following to winboard.ini:

/pgnExtendedInfo=true

If true, and the PGN save game option is enabled, each move will be followed by a comment  containing the engine score and thinking depth (when available).

Note: can also be set from the General options dialog.

Engine search info can be hidden in human-computer games

When "show thinking" is disabled, engine thinking is not generated at all, rather than simply hidden. It is now possible to generate the think lines (e.g. for logging or saving in the PGN) yet hide them when the engine is playing against a human player. Add the following to winboard.ini:

/hideThinkingFromHuman=true

Note: can also be set from the General options dialog.

Asymmetric time controls

Very experimental! You can enter two time controls in the usual dialog, separated by "/". If so, white will be assigned the first time and black the second. So for example "0:30/2:00" will give 30 seconds to white and 2 minutes to black.

Note: for now these times stay with black and white, rather than the corresponding player.

User interface

Options to "hide thinking from human" and "save extended info in PGN" now appears in the "General" options dialog.