1. Why should I implement GTP in my go program?

Because it is easy, and because it saves you doing many other tasks. Once you have implemented it, you have a big choice of GUIs with which you can use your program. You can have your program play on any of NNGS, IGS, KGS by using one of the existing client. You can use existing test suites. Or you can use the existing tools (as, for example, distributed with GNU Go) with your own test suite. You can easily play matches against other GTP engines.

You can also use GoGui and its GTP-to-GMP bridge to take part in tournaments that require the GMP protocol.

2. Why should I implement GTP in my graphical go client?

GTP is a convenient way to connect to go programs, and it is superior to the older GMP: For example, GMP lacks good support to resume games. There are many other ways to use GTP; for example, it is very easy to write an automatic scoring mode by connecting to a GTP engine.

3. I heard GTP is hard to implement. Is that right?


"qGo only supports GTP, not GMP. GTP looks much better and was very easy to implement." Peter Strempel, author of qgo, gGo, glGo.

"Implementing it was trivial and simple." " was easy to get it right." Don Dailey, author of several go programs.

"Now that I've finally written the GTP client for KGS, I wish I'd done it sooner - it was much easier than I'd expected." William Shubert, programmer of KGS and kgsGtp.

4. In what setups can GTP be used?

While other setups are possible, here are the commonly used ones. You can find links to programs implementing the controller side of each setup from the GTP home page.

5. How to set up the communication stream between controller and engine? (engine side implementation)

GTP does intentionally not specify this, as it depends on the setup you want to use. The only requirement is a bidirectional stream to communicate text messages.

Magnus Persson has written several explanatory e-mails to the computer-go mailing list about implementing the GTP stream under Windows: Connecting kgsGTP with a Delphi console. A working example (an example with code), Named pipes in Windows work well with kgsGTP, Implementing and using GTP (in windows) (also containing example code).

6. How can I play matches between different programs with GTP?

On a Unix platform with both engines accepting GTP via stdin/stdout, you can use one of the twogtp scripts coming with GNU Go. (In fact, you can use them on any platform provided you have Pike, Python or Perl installed, respectively.)

GoGui comes with java scripts to do the same.

7. Can I play GTP matches between programs on different computers?

Yes. Assuming that the computers are connected with a network, you can do the following (assuming you have Java and GoGui):

In a post to the computer go mailing list, Gunnar Farneback describes a different setup in a Unix environment using tcplisten and mkfifo.

Another way is to use "ssh -c ..." on the controller machine to connect to another computer and start the GTP engine there.

[1] These programs are all part of GoGui.