1<chapter id="compatibility">
2
3<title>Compatibility</title>
4
5<indexterm>
6<primary><acronym>Go Text Protocol</acronym></primary>
7</indexterm>
8
9<para>
10GoGui will work with all programs that can understand the most basic commands
11of version 1 or 2 of the
12<ulink url="http://www.lysator.liu.se/~gunnar/gtp/">Go Text Protocol</ulink>.
13</para>
14<para><!-- Empty paragraph to enforce space in JEditorPane --></para>
15
16<section>
17<title>Required Commands</title>
18
19<para>
20It is required that the Go program can handle the following commands:
21</para>
22
23<itemizedlist>
24<listitem>
25<simpara>
26<command>boardsize</command>, <command>clear_board</command>
27(<command>boardsize</command>)
28</simpara>
29</listitem>
30<listitem>
31<simpara>
32<command>play</command>
33(<command>black</command>, <command>white</command>)
34</simpara>
35</listitem>
36<listitem>
37<simpara>
38<command>genmove</command>
39(<command>genmove_black</command>, <command>genmove_white</command>)
40</simpara>
41</listitem>
42</itemizedlist>
43
44<para>
45The commands in parentheses are used if the program supports
46the <command>protocol_version</command> command and responds with 1.
47</para>
48
49<para>
50If the Go engine does not support generating moves, because it provides
51only other functionality, it is recommended that it implements
52<command>list_commands</command>, so that GoGui can detect that
53<command>genmove</command> is not supported.
54In this case, GoGui will always set the computer color by default to None, so
55that the engine should not be made playing moves automatically.
56Since the user can still issue play commands, it is recommended that the
57engine responds to a <command>genmove</command> command with a meaningful
58failure response.
59</para>
60
61<para><!-- Empty paragraph to enforce space in JEditorPane --></para>
62</section>
63
64<section>
65<title>Optional Commands</title>
66
67<para>
68The following other commands are used by GoGui:
69</para>
70
71<itemizedlist>
72<listitem>
73<simpara>
74<command>name</command>
75</simpara>
76</listitem>
77<listitem>
78<simpara>
79<command>final_status_list dead</command>
80</simpara>
81</listitem>
82<listitem>
83<simpara>
84<command>gg-undo</command>
85</simpara>
86</listitem>
87<listitem>
88<simpara>
89<command>list_commands</command>
90(<command>help</command>)
91</simpara>
92</listitem>
93<listitem>
94<simpara>
95<command>kgs-genmove_cleanup</command>
96</simpara>
97</listitem>
98<listitem>
99<simpara>
100<command>komi</command>
101</simpara>
102</listitem>
103<listitem>
104<simpara>
105<command>set_free_handicap</command>
106</simpara>
107</listitem>
108<listitem>
109<simpara>
110<command>time_left</command>
111</simpara>
112</listitem>
113<listitem>
114<simpara>
115<command>time_settings</command>
116</simpara>
117</listitem>
118<listitem>
119<simpara>
120<command>undo</command>
121</simpara>
122</listitem>
123<listitem>
124<simpara>
125<command>version</command>
126</simpara>
127</listitem>
128<listitem>
129<simpara>
130<command>quit</command>
131</simpara>
132</listitem>
133</itemizedlist>
134
135<para>
136If the Go program does not understand them, you will still be able to play
137games, but you cannot use all of the functionality of GoGui.
138If <command>undo</command> is not supported, the position will be
139synchronized with the Go program after an undo by sending the complete
140game from the beginning.
141If <command>set_free_handicap</command> is not supported, GoGui
142will transmit handicap stones with <command>play</command> commands.
143</para>
144
145<para>
146The command <command>gg-undo</command> is en extension command used by GNU Go,
147which differs from <command>undo</command> by an optional integer argument
148to undo multiple moves.
149</para>
150
151<para>
152The following GoGui specific GTP extension commands are used if supported by
153the program:
154</para>
155
156<variablelist>
157<varlistentry>
158<term><command>gogui-analyze_commands</command></term>
159<listitem>
160<para>
161See <xref linkend="analyze"/>.
162</para>
163</listitem>
164</varlistentry>
165<varlistentry>
166<term><command>gogui-interrupt</command></term>
167<listitem>
168<para>
169See <xref linkend="interrupt"/>.
170</para>
171</listitem>
172</varlistentry>
173<varlistentry>
174<term><command>gogui-sigint</command></term>
175<listitem>
176<para>
177See <xref linkend="interrupt"/>.
178</para>
179</listitem>
180</varlistentry>
181<varlistentry>
182<term><command>gogui-title</command></term>
183<listitem>
184<para>
185For providing a window title, which may be game specific, or include
186a player name that is not known at program creation time.
187The title is queried and set after a new game is started.
188</para>
189</listitem>
190</varlistentry>
191<varlistentry>
192<term><command>gogui-play_sequence</command></term>
193<listitem>
194<para>
195This is an extension to the standard <command>play</command> command which
196can take a sequence of moves.
197If the Go program supports it (together with GNU Go's
198<command>gg-undo</command> for multiple undo), then navigating in games
199will be much faster, because only a single command is used instead of a
200large number of <command>play</command> and <command>undo</command> commands).
201Note that the command line length can become large for this command; the Go
202program should not use a limit for the command length.
203The Go program is expected to return a failure and not to change its current
204board state if it cannot execute all of the moves in the sequence.
205</para>
206</listitem>
207</varlistentry>
208<varlistentry>
209<term><command>gogui-setup</command></term>
210<listitem>
211<para>
212See <xref linkend="setup"/>.
213</para>
214</listitem>
215</varlistentry>
216<varlistentry>
217<term><command>gogui-setup_player</command></term>
218<listitem>
219<para>
220See <xref linkend="setup"/>.
221</para>
222</listitem>
223</varlistentry>
224</variablelist>
225<para><!-- Empty paragraph to enforce space in JEditorPane --></para>
226</section>
227
228</chapter>
229