<chapter id="compatibility">
  
<title>Compatibility</title>
  
<indexterm>
<primary><acronym>Go Text Protocol</acronym></primary>
</indexterm>

<para>
GoGui will work with all programs that can understand the most basic commands
of version 1 or 2 of the
<ulink url="http://www.lysator.liu.se/~gunnar/gtp/">Go Text Protocol</ulink>.
</para>
<para><!-- Empty paragraph to enforce space in JEditorPane --></para>
  
<section>
<title>Required Commands</title>

<para>
It is required that the Go program can handle the following commands:
</para>
    
<itemizedlist>
<listitem>
<simpara>
<command>boardsize</command>
(<command>boardsize</command>, <command>clear_board</command>)
</simpara>
</listitem>
<listitem>
<simpara>
<command>black</command>, <command>white</command>
(<command>play</command>)
</simpara>
</listitem>
<listitem>
<simpara>
<command>genmove_black</command>,
<command>genmove_white</command>
(<command>genmove</command>)
</simpara>
</listitem>
</itemizedlist>
    
<para>
The commands in parentheses are used if the program supports
the <command>protocol_version</command> command and responds with 2.
</para>
    
<para>
In particular the Go program is not required to support the
<command>loadsgf</command> command.
GoGui translates all moves, setup and handicap stones into a series of
<command>black</command>, <command>white</command>
(<command>play</command>) commands.
</para>
<para><!-- Empty paragraph to enforce space in JEditorPane --></para>
</section>
  
<section>
<title>Optional Commands</title>
    
<para>
The following other commands are used by GoGui:
</para>
    
<itemizedlist>
<listitem>
<simpara>
<command>name</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>final_status_list dead</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>gg-undo</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>genmove_cleanup</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>help</command>
(<command>list_commands</command>)
</simpara>
</listitem>
<listitem>
<simpara>
<command>kgs-genmove_cleanup</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>komi</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>scoring_system</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>time_settings</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>undo</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>version</command>
</simpara>
</listitem>
<listitem>
<simpara>
<command>quit</command>
</simpara>
</listitem>
</itemizedlist>
    
<para>
If the Go program does not understand them, you will still be able to play
games, but you cannot use all of the functionality of GoGui.
</para>
<para><!-- Empty paragraph to enforce space in JEditorPane --></para>
    
<note>
<simpara>
The command <command>scoring_system area/territory</command>
(from an early draft of GTP version 2) is used for setting Chinese/Japanese
rules, if the command is supported by the program.
Otherwise the rule settings are quietly ignored.
</simpara>
</note>

<para>
The following GoGui specific GTP extension commands are used if supported by
the program:
</para>

<variablelist>
<varlistentry>
<term><command>gogui_analyze_commands</command></term>
<listitem>
<para>
See <xref linkend="analyze"/>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>gogui_interrupt</command></term>
<listitem>
<para>
See <xref linkend="interrupt"/>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>gogui_sigint</command></term>
<listitem>
<para>
See <xref linkend="interrupt"/>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>gogui_title</command></term>
<listitem>
<para>
For providing a window title, which may be game specific, or include
a player name that is not known at program creation time.
The title is queried and set after a new game is started.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>play_sequence</command></term>
<listitem>
<para>
This is an extension to the standard <command>play</command> command which
can take a sequence of moves.
If the Go program supports it (together with GNU Go's
<command>gg-undo</command> for multiple undo), then navigating in games
will be much faster, because only a single command is used instead of a
large number of <command>play</command> and <command>undo</command> commands).
Note that the command line length can become large for this command; the Go
program should not use a limit for the command length.
The Go program is expected to return a failure and not to change its current
board state if it cannot execute all of the moves in the sequence.
</para>
</listitem>
</varlistentry>
</variablelist>
<para><!-- Empty paragraph to enforce space in JEditorPane --></para>
</section>
  
</chapter>
