This is not an official KGS page.

Connecting a Go-playing program to KGS

If you have a Go-playing program, and you want it to play on KGS, you will need to set it up as a "bot". This page outlines what this involves.

You will need an internet connection from a Windows, Linux, or Mac system. The system will have to be one of these as you will need to run the KGS bot-client on it.

You should start by registering an account on KGS for your bot. You do this in the same way as you would register an account for a human. But there is a further complication: a bot cannot join a room for itself; so while you are logged in with the bot's account, join any room or rooms that you will want the bot to play in. Then when the bot itself connects, it will find that it is "already in" the room that it needs to play in.

A human who plays on KGS uses the "human" client CGoban3. A Go-playing program, or "bot", uses instead, the bot-client kgsGtp. This is written in Java (like CGoban2), so it should run on any sytem with a recent version of Java installed. So you will need to download kgsGtp and install it on your system. It is available, free, from http://www.gokgs.com/download.jsp. It comes with an html file documenting its use.

You will need to add some code to your program, so that it can communicate in GTP, "Go Text Protocol". This protocol includes all the features of GMP, "Go Modem Protocol", and new features which are used for such things as agreeing the overtime system. Code to implement GTP in C, and documentation for GTP, are available at http://www.lysator.liu.se/~gunnar/gtp/.

If your program already supports GMP, you need not add GTP support, you can just use a GMP to GTP convertor. This is available from http://lists.gnu.org/archive/html/gnugo-devel/2003-07/msg00195.html, as C source code. Presumably if you use this method of adding GTP support, you will be restricted to using those features that are also supported by GMP, and therefore your bot won't understand, for instance, how overtime applies to its games.

Many versions of GNU Go that support GTP and play on KGS. As GNU Go source is public, you can examine it, and see how it supports GTP. It is available from http://www.gnu.org/software/gnugo/gnugo.html.

If you want your bot to play in bot-tournaments on KGS, you must also read kgsGtp and tournament play.