Gtp2ogs is a tool allows AI Go engines (bots) that support GTP (Go Text Protocol) to communicate with OGS (Online-Go.com Server) and play games with players or other bots.
Before you get started you'll need to setup a bot account on online-go.com. To do that, you'll need to have your human account and create a new separate account for your bot account, then contact a moderator to request that your bot account be flagged as a bot account. Give them both your human account and your bot account. Once that has been done, log in with your human account, search for your bot account to view the bot profile, on that page you'll be able to generate an API key which you'll use to connect the bot.
To get started quickly, you can download a pre-built executable for Windows, Mac, and Linux from the releases page.
If you have node.js installed you can install the gtp2ogs
package
using npm
npm install -g gtp2ogs
To build from source you will need to have node.js installed on your system.
You will also need to have yarn
installed. Then, run
yarn install
yarn exec -- gulp
to run the build process. The resulting compiled javascript file will be located
in dist/gtp2ogs.js
which you can then run with
node dist/gtp2ogs.js
To build a standalone binary that doesn't depend on node, use pkg:
yarn exec -- pkg -C brotli .
If you do not want to install node.js and yarn locally, another option is
docker run --rm -it -v "$PWD":/usr/src -w /usr/src node:slim yarn install
docker run --rm -it -v "$PWD":/usr/src -w /usr/src node:slim yarn exec -- gulp
docker run --rm -it -v "$PWD":/usr/src -w /usr/src node:slim yarn exec -- pkg -C brotli .
Once you have your API Key and gtp2ogs
installed, you can connect your bot to OGS
like so:
gtp2ogs --apikey YOURKEYHERE -- /path/to/your/bot --arguments --to your bot
Note that everything after the --
will be considered a command used to run your
bot, so any gtp2ogs arguments you use needs to come before the --
.
For more advanced configuration, see the example_config.json5
for a configuration
template, and pass in the --config yourconfig.json5
argument to gtp2ogs
.
If you'd like to connect your bot to the beta.online-go.com site simply follow all of the
previous steps for setting up a bot account on the beta site and use the --beta
command
line argument.
gtp2ogs-dev
discord channel specifically for this project.