X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=engine-intf.html;h=42525528485ede242cb3ab7d1567f30887793e6f;hb=bc9927eb7497911debdd6bc80cab75dba837f7bc;hp=3fac3643087a46296fb010aee81f9506af577da5;hpb=05bc30b15e31c427ce208495a889e9ff36e6642b;p=xboard.git diff --git a/engine-intf.html b/engine-intf.html index 3fac364..4252552 100644 --- a/engine-intf.html +++ b/engine-intf.html @@ -1,4 +1,3 @@ - Chess Engine Communication Protocol @@ -9,7 +8,7 @@

Chess Engine Communication Protocol

Tim Mann

-Last modified on Mon Feb 5 23:23:16 PST 2001 by mann
+$Id$
Version 2; implemented in xboard/WinBoard 4.2.1 and later.
Changes since version 1 are indicated in red.


@@ -21,7 +20,7 @@ Changes since version 1 are indicated in red.
  • 4. How it got this way
  • 5. WinBoard requires Win32 engines
  • 6. Hints on input/output -
  • 7. Interrupts +
  • 7. Signals
  • 8. Commands from xboard to the engine
  • 9. Commands from the engine to xboard
  • 10. Thinking Output @@ -69,10 +68,10 @@ statements, let me know.

    I'd like to hear from everyone who is trying to interface their own -chess engine to xboard/WinBoard. Please email me, tim.mann@compaq.com. Also, please join +chess engine to xboard/WinBoard. Please email me, +tim@tim-mann.org. Also, please join the mailing list for authors of xboard/WinBoard compatible chess -engines. The list is now hosted by egroups.com; you can join at http://www.egroups.com/group/chess-engines, or you can read the list there without joining. The list is filtered to prevent spam. @@ -173,8 +172,8 @@ features can be selected by the feature command in version 2, including the "ping" command (recommended for all engines), the "setboard" command, and many optional parameters. Additional features will probably be added in future versions. -

    +

    5. WinBoard requires Win32 engines

    @@ -420,9 +419,9 @@ user input, you must turn off the prompt and output a newline when the "xboard" command comes in.

    - -

    protover N -
    Beginning in protocol version 2 (in which N=2), this command will +
    protover N +
    +Beginning in protocol version 2 (in which N=2), this command will be sent immediately after the "xboard" command. If you receive some other command immediately after "xboard" (such as "new"), you can assume that protocol version 1 is in use. The "protover" command is @@ -443,10 +442,10 @@ options added in later protocol versions may be accepted.

    - -

    accepted -
    rejected -
    These commands may be sent to your engine in reply to the "feature" +
    accepted +
    rejected +
    +These commands may be sent to your engine in reply to the "feature" command; see its documentation below.

    @@ -629,9 +628,9 @@ error message so that xboard can retract it and inform the user; see the section "Commands from the engine to xboard".

    - -
    usermove MOVE -
    By default, moves are sent to the engine without a command name; +
    usermove MOVE +
    +By default, moves are sent to the engine without a command name; the notation is just sent as a line by itself. Beginning in protocol version 2, you can use the feature command to cause the command name "usermove" to be sent before the move. @@ -656,9 +655,9 @@ or other commands while the engine is on move.

    - -
    ping N +
    ping N
    + In this command, N is a decimal number. When you receive the command, reply by sending the string pong N, where N is the same number you received. Important: You must not reply to a "ping" @@ -728,9 +727,9 @@ particular, you won't get one in local chess engine mode when the user stops playing by selecting Reset, Edit Game, Exit or the like.

    - -
    setboard FEN -
    The setboard command is the new way to set up positions, beginning +
    setboard FEN +
    +The setboard command is the new way to set up positions, beginning in protocol version 2. It is not used unless it has been selected with the feature command. Here FEN is a position in Forsythe-Edwards Notation, as defined in the PGN standard. @@ -877,9 +876,9 @@ are known. Example:
    rating 2600 1500

    - -

    ics HOSTNAME -
    If HOSTNAME is "-", the engine is playing against a local +
    ics HOSTNAME +
    +If HOSTNAME is "-", the engine is playing against a local opponent; otherwise, the engine is playing on an Internet Chess Server (ICS) with the given hostname. This command is new in protocol version 2 and is not sent unless the engine has enabled it with @@ -892,10 +891,9 @@ the "feature" command. Example: "ics freechess.org" their playing style when they receive this command.

    - -

    pause -
    resume -
    (These commands are new in protocol +
    pause +
    resume +
    (These commands are new in protocol version 2 and will not be sent unless feature pause=1 is set. At this writing, xboard actually does not use the commands at all, but it or other interfaces may use them in the future.) @@ -957,10 +955,12 @@ were previously not assigned a meaning.

    - -
    feature FEATURE1=VALUE1 FEATURE2=VALUE2 ... +
    +feature FEATURE1=VALUE1 FEATURE2=VALUE2 ... + -
    Beginning with version 2, the protocol includes the "feature" +
    +Beginning with version 2, the protocol includes the "feature" command, which lets your engine control certain optional protocol features. Feature settings are written as FEATURE=VALUE, where FEATURE is a name from the list below and VALUE is the value to be @@ -1028,71 +1028,123 @@ depend on be rejected.

    Here are the features that are currently defined.

    +
    -
    ping (boolean, default 0, recommended 1) -
    If ping=1, xboard may use the protocol's new "ping" command; +
    +ping (boolean, default 0, recommended 1) + +
    +If ping=1, xboard may use the protocol's new "ping" command; if ping=0, xboard will not use the command. + -
    setboard (boolean, default 0, recommended 1) -
    If setboard=1, xboard will use the protocol's new "setboard" command +
    +setboard (boolean, default 0, recommended 1) + +
    +If setboard=1, xboard will use the protocol's new "setboard" command to set up positions; if setboard=0, it will use the older "edit" command. + -
    playother (boolean, default 0, recommended 1) -
    If playother=1, xboard will use the protocol's new "playother" command +
    +playother (boolean, default 0, recommended 1) + +
    +If playother=1, xboard will use the protocol's new "playother" command when appropriate; if playother=0, it will not use the command. + -
    san (boolean, default 0) -
    If san=1, xboard will send moves to the engine in standard algebraic +
    +san (boolean, default 0) + +
    +If san=1, xboard will send moves to the engine in standard algebraic notation (SAN); for example, Nf3. If san=0, xboard will send moves in coordinate notation; for example, g1f3. See MOVE in section 8 above for more details of both kinds of notation. + -
    usermove (boolean, default 0) -
    If usermove=1, xboard will send moves to the engine with the +
    +usermove (boolean, default 0) + +
    +If usermove=1, xboard will send moves to the engine with the command "usermove MOVE"; if usermove=0, xboard will send just the move, with no command name. + -
    time (boolean, default 1, recommended 1) -
    If time=1, xboard will send the "time" and "otim" commands to +
    +time (boolean, default 1, recommended 1) + +
    +If time=1, xboard will send the "time" and "otim" commands to update the engine's clocks; if time=0, it will not. + -
    draw (boolean, default 1, recommended 1) -
    If draw=1, xboard will send the "draw" command if the engine's opponent +
    +draw (boolean, default 1, recommended 1) + +
    +If draw=1, xboard will send the "draw" command if the engine's opponent offers a draw; if draw=0, xboard will not inform the engine about draw offers. Note that if draw=1, you may receive a draw offer while you are on move; if this will cause you to move immediately, you should set draw=0. + -
    sigint (boolean, default 1) -
    If sigint=1, xboard may send SIGINT (the interrupt signal) to +
    +sigint (boolean, default 1) + +
    +If sigint=1, xboard may send SIGINT (the interrupt signal) to the engine as section 7 above; if sigint=0, it will not. + -
    sigterm (boolean, default 1) -
    If sigterm=1, xboard may send SIGTERM (the termination signal) to +
    +sigterm (boolean, default 1) + +
    +If sigterm=1, xboard may send SIGTERM (the termination signal) to the engine as section 7 above; if sigterm=0, it will not. + -
    reuse (boolean, default 1, recommended 1) -
    If reuse=1, xboard may reuse your engine for multiple games. If +
    +reuse (boolean, default 1, recommended 1) + +
    +If reuse=1, xboard may reuse your engine for multiple games. If reuse=0 (or if the user has set the -xreuse option on xboard's command line), xboard will kill the engine process after every game and start a fresh process for the next game. + -
    analyze (boolean, default 1, recommended 1) -
    If analyze=0, xboard will not try to use the "analyze" command; it +
    +analyze (boolean, default 1, recommended 1) + +
    +If analyze=0, xboard will not try to use the "analyze" command; it will pop up an error message if the user asks for analysis mode. If analyze=1, xboard will try to use the command if the user asks for analysis mode. + -
    myname (string, default determined from engine filename) -
    This feature lets you set the name that xboard will use for your +
    +myname (string, default determined from engine filename) + +
    +This feature lets you set the name that xboard will use for your engine in window banners, in the PGN tags of saved game files, and when sending the "name" command to another engine. + -
    variants (string, see text below) -
    This feature indicates which chess variants your engine accepts. +
    +variants (string, see text below) + +
    +This feature indicates which chess variants your engine accepts. It should be a comma-separated list of variant names. See the table under the "variant" command in section 8 above. If you do not set this feature, xboard will assume by default that your @@ -1103,37 +1155,57 @@ correct value for your engine (just "normal" in most cases) rather than leaving the default in place, so that the user will get an appropriate error message if he tries to play a variant that your engine does not support. + -
    colors (boolean, default 1, recommended 0) -
    If colors=1, xboard uses the obsolete "white" and "black" +
    +colors (boolean, default 1, recommended 0) + +
    +If colors=1, xboard uses the obsolete "white" and "black" commands in a stylized way that works with most older chess engines that require the commands. See the "Idioms" section below for details. If colors=0, xboard does not use the "white" and "black" commands at all. + -
    ics (boolean, default 0) -
    If ics=1, xboard will use the protocol's new "ics" command +
    +ics (boolean, default 0) + +
    +If ics=1, xboard will use the protocol's new "ics" command to inform the engine of whether or not it is playing on a chess server; if ics=0, it will not. + -
    name (boolean, see text below) -
    If name=1, xboard will use the protocol's "name" command +
    +name (boolean, see text below) + +
    +If name=1, xboard will use the protocol's "name" command to inform the engine of the opponent's name; if name=0, it will not. By default, name=1 if the engine is playing on a chess server; name=0 if not. + -
    pause (boolean, default 0) -
    If pause=1, xboard may use the protocol's new "pause" command; +
    +pause (boolean, default 0) + +
    +If pause=1, xboard may use the protocol's new "pause" command; if pause=0, xboard assumes that the engine does not support this command. + -
    done (integer, no default) -
    If you set done=1 during the initial two-second timeout after +
    +done (integer, no default) + +
    +If you set done=1 during the initial two-second timeout after xboard sends you the "xboard" command, the timeout will end and xboard will not look for any more feature commands before starting normal operation. If you set done=0, the initial timeout is increased to one hour; in this case, you must set done=1 before xboard will enter normal operation. -
    +

    Illegal move: MOVE @@ -1238,9 +1310,9 @@ Machine Black, or Two Machines mode, the offer is considered valid until your engine has made two more moves.

    - -

    tellopponent MESSAGE -
    This command lets the engine give a message to its opponent, +
    tellopponent MESSAGE +
    +This command lets the engine give a message to its opponent, independent of whether the opponent is a user on the local machine or a remote ICS user (Zippy mode). MESSAGE consists of any characters, including whitespace, to the end of the line. When the engine is @@ -1297,9 +1369,9 @@ bar" to the engine. The user can cancel the dialog and send nothing. of any characters, including whitespace, to the end of the line.

    - -

    tellicsnoalias MESSAGE -
    In Zippy mode, xboard sends "xMESSAGE\n" to ICS, where "x" is a +
    tellicsnoalias MESSAGE +
    +In Zippy mode, xboard sends "xMESSAGE\n" to ICS, where "x" is a character that prevents the ICS from expanding command aliases, if xboard knows of such a character. (On chessclub.com and chess.net, "/" is used; on freechess.org, "$" is used.) MESSAGE consists of any @@ -1526,15 +1598,14 @@ following commands while in analyze mode:
  • Any legal move, as in force mode
  • undo   Back up one move and analyze previous position.
  • new   Reset position to start of game but stay in analyze mode. - -
  • setboard if you have set feature setboard=1; otherwise edit. Exiting edit mode returns to analyze mode. +
  • setboard if you have set feature setboard=1; otherwise edit. Exiting edit mode returns to analyze mode.
  • exit   Leave analyze mode.
  • .   Send a search status update (optional); see below. -
  • +
  • bk   Show book moves from this position, if any; see above. -
  • +
  • hint   Show the predicted move from this position, if any; see above.