Geschrieben von: / Posted by: Christian at 06 July 2000 22:52:51:
may be helpful for some of the new kids on the block:
Technical side of the Winboard Interface
Dear chess software developer,
Fritz 5.32, Nimzo99, and ChessBase 7.0 support the Winboard interface. If you would like to make your engine compatible with those programs, please have a look at the below specifications.
Here's what you need:
Mandatory:
"new" (some programs don't have that, they won't work)
"edit" - "#" - "c" - "."
"force"
"go" - "?"
"level"
"quit"
Special cases:
- "hard" - "easy" (pondering has to be off; you may ignore it if this is the default)
- "post" (only if this isn't default; you may ignore it if this is the default)
Additional:
- "analyze" - "exit" (print an error message like: "Error (unknown command): analyze" if you don't have it)
- "white" - "black" (may be ignored if Tim Mann's way works)
- "ponder" (new command, only used if activated through initfile)
- "fritz" (sent once as first command, engine may switch state to be better support our interface)
- "reset" (clear the hashtables, and other chess related information)
If you don't support some of the winboard keywords, please don't implement them with a different meaning. Please read Tim Mann's Chess Engine Communication Protocol from Jun 12 1998 for further information.
Please note that the Fritz interface has a different logic compared to Winboard. Before any computation is started the engine will receive a "new", "edit" (if it's a position), "force" (if there are moves), and all moves of the game. Then the engine will receive "level n t p" (n=moves left for next time control, t=time left for next time control, p=additional time per move). Then "hard", "easy" to switch off pondering ("new" may trigger it again, I want to be sure). The analysis is started with "go", or "analyze". "?" is used to stop a search if necessary. To be sure, "white" or "black" is sent before "go", but you may ignore it. If black is to start, the interface also uses Tim Mann's way of "new", "a2a3", "edit", furthermore it will always leave "edit" with the colour to move.
You should switch off the logfile (Crafty starts a new logfile with every "new" otherwise). You shouldn't implement Winboard commands with different meanings (Some engines use "exit" to quit the program, and "?" to show help).
There is a special command for pondering which was suggested by Crafty. If the engine doesn't support this command a suboptimal pondering will be used. A standard search will be started in this, so the opponent time may not be fully used.
Enhancements:
1. For coding of mate values please use Steven J. Edwards' proposal in his EPD specification. (mate value is 32767; 32767-1 is #1, -32767+2 is -#1, 32767-3 is #2, -32767+4 is -#2, etc.)
2. The first command sent to the engine is "fritz", the second is "xboard".
3. I introduced a new command "ponder e2e4"; this command is sent instead of "go" if the engine should start pondering. The engine should execute the move and start pondering on it. If the user plays that move, the move is sent.
4. There are two new edit commands "castle " and "ep "; castleright is one of the following: +w00, -w00, +w000, -w000, +b00, -b00, +b000, -b000; the "+" commands are superfluous since there's only a point in disabling a possible castle, but sent anyway. is the targetsquare of the ep move, so it's a3..h3 if black to move and a6..h6 if white to move. You have to activate this through the init-file.
5. Please don't clear the hashtables with "new", otherwise the engine may lose information. There's a specific command to clear the hashtables and other chess related information: "reset", which is used in tactical test suites, not during games or analyzing. Please note that current versions of Fritz 5.32 won't send this command yet. We will introduce it in the future because some programmers critisized that Fritz never actively resets the hash tables by himself and so tactical test suites might become indeterministic.
Shortcomings:
1. We found no way to set the ep square or the castle flags. So after "edit" it's always assumed that all possible castle are legal, and ep is always reset. The former may actually cause illegal moves in Fritz (which are detected and cause no further problems), but that can't be helped. Luckily these cases are rare. And most games will start from the starting position anyway.
2. Pondering may stop before the opponent made a move and if the ponder command is not supported. This won't cause problems, but the thinking time is not used optimal. In most cases it doesn't matter.
3. Some engines may not be suited perfectly to get the whole information with every position to search, they where written to work best incrementally. For example hashtables may be cleared with "new". Solution: Simply do not clear your hashtables when you know you are in Fritz mode (first command was Fritz, see above).
Initfile:
[Parameter]
CommandLine = {add command line parameters, if any}
Author = {insert your name}
Engine = {the name displayed in Fritz}
Debug = True/False {if True, a console window with the output of the engine is opened}
[Support]
AnalyzeMode = True/False {if True, engine supports "analyze", i.e. infinite mode}
PonderMode = True/False {if True, engine supports new command "ponder e2e4"}
CastleAndEP = True/False {if True, engine supports new edit commands castle and ep}
This is a draft of the interface, comments of chess programmers are very welcome.