twogtp

twogtp - Go Text Protocol adapter for playing games between two Go programs.

Synopsis

twogtp -black command -white command [-alternate] [-auto] [-config file] [-estimate-score] [-force] [-games] [-komi komi] [-referee command] [-sgffile prefix] [-size n] [-verbose]
twogtp -help
twogtp -analyze file.dat [-force]
twogtp -compare file.sgf...
twogtp -version

Description

Adapter program for playing games between two Go programs supporting GTP (Go Text Protocol).

An optional third GTP Go program can be used as a referee for observing the game and answering commands related to the final game score. TwoGtp forwards the following commands to all programs:

  • boardsize
  • black
  • komi (if supported)
  • loadsgf
  • quit
  • scoring_system (if supported)
  • time_settings (if supported)
  • undo
  • white
The following commands are forwarded to the referee program, if existing, otherwise to first program that implements them (Black is tried first):
  • final_score
  • final_status
  • final_status_list
The commands genmove_black and genmove_white are forwarded only to the program of the corresponding color, the other program (and the referee) is informed about the move with a black or white command. GTP extension commands implemented by exactly one of the programs are forwarded to the program. The special comment line # interrupt used by GoGui to interrupt commands is forwarded to all programs.

If the option -sgffile is used, the games are saved after they are finished and a result text file in table format is created with some statistics. If the program(s) support the GTP command cputime these statistics include CPU times. The errors of the statistics are calculated by the standard deviation of the results divided by the square root of the number of unique games, which is correct only for a sufficiently large number of games (especially if the percentage of wins is close to 0% or 100%).

Options

-alternate

Alternate colors. Black and White are exchanged every odd game. The scores saved in the results table if -sgffile are still using the name Black and White as given with -black and -white.

-analyze file.dat

Analyze the result file file.dat. Creates a HTML file file.html with links to the games and summary statistics. Also creates a text file file.summary.dat with a table row containing the most important summary statistics.

-auto

Automatically play games. Use this option if you want to run TwoGtp as a standalone program without a program like GoGui which controls the move generation with genmove_black and genmove_white commands. If a result file already exists (as specified with -sgffile) and contains less games than specified with -games, the remaining games will be played. Use -force to overwrite existing result files.

-black command

Command for black program.

-compare

Compare a list of SGF files given as arguments an exit. Works only with SGF files with alternating moves and without setup stones.

-config file

Read command line options and arguments from file.

-estimate-score

Send an estimate_score command to all programs after each move and save them to a file after the game. The responses to estimate_score must begin with a score in the form B+ or W+. The file is a table with valid scores translated to floating point numbers (positive for program -black).

-force

Overwrite existing files.

-games n

Number of games to play (0 means no limit).

-help

Display help and exit.

-komi komi

Komi. If this option is not used, the komi can be set with the komi command or default komi 5.5 will be used with option -auto.

-referee command

Command for referee program.

-sgffile prefix

Save games after they are finished with filename prefix-n.sgf with n being the game number. The results are appended to the file prefix.dat.

-size n

Board size for games. If this option is not used the size will be set with the boardsize command or default size 19 will be used with option -auto.

-verbose

Print debugging messages.

-version

Print version and exit.

-white command

Command for white program.

GTP Extensions

gogui_interrupt

Indicate interrupt ability for GoGui. TwoGtp will forward the interrupt to both programs with the appropriate method if they implement either gogui_interrupt or gogui_sigint. See Chapter 5, Interrupting Commands of the GoGui documentation.

gogui_title

Return a title for the current game consisting of the game number (if option -sgffile was used) and the player names.

twogtp_black command

Send command to black player.

twogtp_referee command

Send command to referee program.

twogtp_white command

Send command to white player.