WinBoard for Xiangqi

WARNING: this page is under construction, and the info on it might not be entirely accurate yet!


Configuring WinBoard for Xiangqi

Board style

WinBoard has built-in bitmaps for westernized pieces in sizes bulky, middling and petite. When xiangqi is selected, version 4.7.x would automatically 'round' the size to one of these values. Many users might prefer to have the traditional oriental representation of the Xiangqi board and pieces. This can be acheived through extensive configuring of board an pieces.

XBoard has scalable SVG westernized pieces, whic will thus work in any board size. No traditional Xiangqi pieces come with the standard install, however. You would have to provide your own PNG or SVG pieces.

To get a traditional board, where pieces sit on grid intersections rather than inside squares, we must use the WinBoard options for board background textures. This feature is implemented in such a way that, when you select as background a bitmap of exactly the size of the complete board, the individual squares are cut out of it to reproduce the complete image. At least, when you use re-orientation mode 1, so that they are not flipped or rotated. If smaller squares are needed, their cutouts will remain centered on the same points (which should be the grid points), so that a smaller, undistorted board will be obtained. Even when the needed squares are larger, so that the cutouts must overlap, WinBoard tries to do this with minimal distortion. As traditional Xiangqi boards do not color the palace, the same bitmap can be used for light and dark squares. The standard installer of WinBoard comes with two bitmaps designed for the size middling, one evenly colored, the other with a wood texture.

The easiest way to get traditional oriental pieces is to use font-based piece rendering, as this automatically makes the pieces available in all 18 board sizes. A true-type piece font 'XIANGQI', which comes with the WinBoard standard install, can be used for this. The filling colors for the pieces can be set through the View -> Colors dialog.

Installing Engines

WinBoard supports the four major protocols important for Xiangqi engines: WinBoard protocol, UCCI, UCI, and Qianhong. The latter three are supported through adapters. WinBoard supports the automatic invocation of two different adapters, though the options -fUCI/-sUCI and -fUCCI/-sUCCI. The Load Engine dialog has checkboxes UCI and UCCI/USI to activate these. To make this work the option -adapterCommand (invoked by -fUCI) has to be defined as './UCI2WB "%fcp" "%fd"', and the option -uxiAdapter (invoked by -fUCCI) to './UCCI2WB "%fd/%fcp"'. This will then invoke the uci2wb.exe and ucci2wb.exe adapters in the WinBoard folder, with the proper arguments to run the specified UCI or UCCI engine in response to the checkboxes. (In the standard install of WinBoard polyglot.exe is used as UCI adapter, but this cannot handle Xiangqi.)

Many UCI and UCCI engines are non-compliant, and fail to anounce options that they do support. As a consequence WinBoard would not know the options exist, and would for instance not set the hash-table size, and not offer the user the possibility to set the option through the Engine Settings dialog. The UCI2WB and UCCI2WB adapters provide a general work-around for this: when they find a file named 'DefectiveEngineOptions.ini' in the engine folder, they will take the contents of that file as if the engine would have sent it in response to the 'uci' or 'ucci' command.

Qianhong engines can be run through the adapter QH2WB. ...

FEN and SAN dialects

The piece IDs for Horse and Elephants according to the FEN standard of the World Xiangqi Federation are H and E. Many sources of games use the 'westernized' IDs N and B instead, though. One also often sees the use of 'r' (red) in stead of 'w' for the side to move. To allow WinBoard to read such non-compliant FEN or SAN, there are option -pieceNickNames and -colorNickNames. Any incoming piece or color ID is first checked against the applicable one of these options to get its meaning, and only if the meaning is undefined (specified as '.') there, uses the standard -pieceToCharTable or "wb" color ID to interpret the letter. For Xiangqi the -pieceNickNames can best be configured to "SN...MBGsn...mbg", to understand S(oldier) for Pawn, N for Horse, M(andarin) for Adviser, B for Elephant and G(eneral) for King, while the -colorNickNames can be set to "rb". On writing FEN or SAN WinBoard will never use the nick-names, but always uses the standard.

The WinBoard-XQ package

There is an install that pre-configures WinBoard in the ways mentions above. It is supplied with the MaxQi and HaQiKi D WB engines, and the Elephant Eye UCCI engine. (All UCI Xiangqi engines I know are commercial, and distributing copies would be highly illegal.) It also has a few examples for install lines of engines that are not included, (e.g. the UCI engine Cyclone), or how they could be installed without using the -fUCI or -fUCCI options. It contains a pretty old version of WinBoard, however.

Download WinBoard Xiangqi install
Xiangqi engines that can run under WinBoard
My old Xiangqi web pages