[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Using GNU Go


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Getting Documentation

You can obtain a printed copy of the manual by running make gnugo.ps in the `doc/'directory, then printing the resulting postscript file. The manual contains a great deal of information about the algorithms of GNU Go.

On platforms supporting info documentation, you can usually install the manual by executing `make install' (running as root) from the `doc/' directory. The info documentation can be read conveniently from within Emacs by executing the command Control-h i.

Documentation in `doc/' consists of a man page `gnugo.6', the info files `gnugo.info', `gnugo.info-1', ... and the Texinfo files from which the info files are built. The Texinfo documentation contains this User's Guide and extensive information about the algorithms of GNU Go, for developers.

If you want a typeset copy of the Texinfo documentation, you can make gnugo.dvi, make gnugo.ps, or make gnugo.pdf in the `doc/' directory. (make gnugo.pdf only works after you have converted all .eps-files in the doc/ directory to .pdf files, e.g. with the utility epstopdf.)

You can make an HTML version with the command makeinfo --html gnugo.texi. If you have texi2html, better HTML documentation may be obtained by make gnugo.html in the `doc/' directory.

User documentation can be obtained by running gnugo --help or man gnugo from any terminal, or from the Texinfo documentation.

Documentation for developers is in the Texinfo documentation, and in comments throughout the source. Contact us at gnugo@gnu.org if you are interested in helping to develop this program.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 Running GNU Go via CGoban

There are two different programs called CGoban, both written by William Shubert. In this documentation, CGoban means CGoban 1.x, the older program. You should get a copy with version number 1.12 or higher.

CGoban is an extremely nice way to run GNU Go. CGoban provides a beautiful graphic user interface under X Window System.

Start CGoban. When the CGoban Control panel comes up, select "Go Modem". You will get the Go Modem Protocol Setup. Choose one (or both) of the players to be "Program," and fill out the box with the path to `gnugo'. After clicking OK, you get the Game Setup window. Choose "Rules Set" to be Japanese (otherwise handicaps won't work). Set the board size and handicap if you want.

If you want to play with a komi, you should bear in mind that the GMP does not have any provision for communicating the komi. Because of this misfeature, unless you set the komi at the command line GNU Go will have to guess it. It assumes the komi is 5.5 for even games, 0.5 for handicap games. If this is not what you want, you can specify the komi at the command line with the `--komi' option, in the Go Modem Protocol Setup window. You have to set the komi again in the Game Setup window, which comes up next.

Click OK and you are ready to go.

In the Go Modem Protocol Setup window, when you specify the path to GNU Go, you can give it command line options, such as `--quiet' to suppress most messages. Since the Go Modem Protocol preempts standard I/O other messages are sent to stderr, even if they are not error messages. These will appear in the terminal from which you started CGoban.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 Other Clients

In addition to CGoban (see section Running GNU Go via CGoban) there are a number of other good clients that are capable of running GNU Go. Here are the ones that we are aware of that are Free Software. This list is part of a larger list of free Go programs that is maintained at http://www.gnu.org/software/gnugo/free_go_software.html.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Ascii Interface

Even if you do not have CGoban installed you can play with GNU Go using its default Ascii interface. Simply type gnugo at the command line, and GNU Go will draw a board. Typing help will give a list of options. At the end of the game, pass twice, and GNU Go will prompt you through the counting. You and GNU Go must agree on the dead groups--you can toggle the status of groups to be removed, and when you are done, GNU Go will report the score.

You can save the game at any point using the save filename command. You can reload the game from the resulting SGF file with the command gnugo -l filename --mode ascii. Reloading games is not supported when playing with CGoban. However you can use CGoban to save a file, then reload it in ascii mode.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.5 GNU Go mode in Emacs

You can run GNU Go from Emacs. This has the advantage that you place the stones using the cursor arrow keys or with the mouse, and (provided you have Emacs version 21 or later) you can have a nice graphical display of the board within emacs.

Load the file `interface/gnugo.el' and (if you want the graphical board) `interface/gnugo-xpms.el'. You may do this using the Emacs M-x load-file command.

In detail: Emacs uses Control and Meta keys. The "Meta" key is the Alt key on the PC keyboard. The Control and Meta keys are denoted C- and M-. Thus the M-x is obtained by holding the Alt key and typing `x'. In Emacs, this prompts you for another command. You can then type load-file, hit the Enter key, then type the path to `gnugo.el' and hit Enter again. Then repeat the process for `gnugo-xpms.el'.

To have the files `gnugo.el' and `gnugo-xpms.el' loaded automatically each time you run emacs, copy the files into your `site-lisp' directory (often `/usr/share/emacs/site-lisp') and add lines

 
(autoload 'gnugo "gnugo" "GNU Go" t)
(autoload 'gnugo-xpms "gnugo-xpms" "GNU Go" t)

in your `.emacs' file.

The `.xpm' bitmaps for the default size Go stones are 30 pixels. For a larger board, alternative 36 pixel stones may be found in `gnugo-big-xpms.el'.

You may start GNU Go by M-x gnugo. You will be prompted for command line options (see section Invoking GNU Go: Command line options). Using these, you may set the handicap, board size, color and komi. For example if you want to play white and give a nine-stone handicap, use the options `--handicap 9 --color white'.

By default, Emacs gives you a graphical Go board. You can toggle an alternative ascii board (for example, if you want to paste a diagram into an email) with gnugo-toggle-image-display, which is bound to `i'. If you want a grid, `g' toggles the grid display on or off. The grid is not displayed by default.

You play a move either by moving to the location with the arrow keys, then hitting the SPACE key, or by clicking on an empty location with the mouse. You can save or load a game, and undo moves.

You can get help at any time by typing `?'. This will give a description of the default keybindings. If you want to find out what a particular function does, you can use `C-h f <function-name>' to get documentation on it. For example, after examining the default keybindings with `?' we learn that `v' is bound to gnugo-view-regression. To find out more information about this function we type `C-h f gnugo-view-regression' to view the help string for the function.

You may save the game you are playing as an sgf file with gnugo-write-sgf-file, which is bound to `s'. You may also restore a saved game with gnugo-read-sgf-file, bound to `l'. When the sgf file is loaded, it is assumed to be your move, since typically the game is saved on your move. You may resume play by entering a move.

At the end of the game, after both players pass, GNU Go will run gnugo-venerate to render all dead stones as ghostly shades. You can then type `F' to run gnugo-display-final-score, which will tell you the score. (You may get a score estimate at any time before the end of the game with gnugo-estimate-score, bound to `!'.

You may undo your move with gnugo-undo-two-moves, which is bound to `u'. This takes back your move, and also the last computer move, so it goes back to the position two moves ago. If you undo one or many moves, you may redo them with gnugo-redo-two-moves, which is bound to `r'.

Although if you are playing a game it is most natural to undo or redo two moves at a time, since this does not change the color of the player to move, you may also undo or redo a single move with gnugo-undo and gnugo-redo, bound to `b' and `f'. This is convenient for scrolling forward or backward in a game to review the moves. Note that if you undo once, then play a move (by clicking on the board, or by hitting the space or enter key), you have changed the color of the player to move. GNU Go will begin to generate moves as soon as you play.

You may also use gnugo-jump-to-move, bound to `j' to jump to a particular move in the game. You will be prompted for the game move. After you type the number of the move, Emacs will undo back to that move number. You may then redo or further undo using `f' and `f'. You may also jump to the beginning or end of the game with `<' and `>'.

Another way to undo back to a given move is to move the cursor to a stone (which must be one of your own), then execute gnugo-magic-undo, bound to `U'.

As we have noted, GNU Go normally answers each move that you play by generating a move of its own. If you want to suppress GNU Go's automatic generation of moves, you may toggle an `editing mode' with gnugo-toggle-edit-mode. In the editing mode, GNU Go does not automatically answer each move that you play. For example, you can use the editing mode to write an sgf file from scratch. If you are playing a game, you can turn off GNU Go's automatic responses, play a few moves in editing mode to see what the board position will look like, then back up to the last move, toggle the editing mode off, then resume the game.

You may view a GNU Go regression test with gnugo-view-regression, which will prompt you for the name of a test. You may type (for example) strategy:6. The first time you do this you will be prompted for the path to the `regression/' directory. (Once Emacs knows this path, you will not be prompted again.) This command takes a while to execute since GNU Go will run the regression. When it is completed, Emacs will display the board position (with the grid) and a message below the board such as:

 
 loadsgf games/incident104.sgf 63
 strategy:6 reg_genmove white
 #? [E10]*
 =6 J13

This gives the actual test followed by the move that GNU Go generates when running the test.

You may also ask GNU Go to identify a dragon on the board. Click on one stone to move the cursor to that location. Then type `d'. The dragon in question will then be marked flashing. You may also type `D', which will report the dragon data. You may run other gtp commands with gnugo-command, which is bound to `:'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6 The Go Modem Protocol and Go Text Protocol

The Go Modem Protocol (GMP) was developed by Bruce Wilcox with input from David Fotland, Anders Kierulf and others, according to the history in http://www.britgo.org/tech/gmp.html.

Any Go program should support this protocol since it is a standard. Since CGoban supports this protocol, the user interface for any Go program can be done entirely through CGoban. The programmer can concentrate on the real issues without worrying about drawing stones, resizing the board and other distracting issues.

GNU Go 3.0 introduced a new protocol, the Go Text Protocol (see section The Go Text Protocol) which we hope can serve the functions currently used by the GMP. The GTP is becoming increasingly adopted by other programs as a method of interprocess communication, both by computer programs and by clients. Still the GMP is widely used in tournaments.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7 Computer Go Tournaments

Computer Tournaments currently use the Go Modem Protocol. The current method followed in such tournaments is to connect the serial ports of the two computers by a "null modem" cable. If you are running GNU/Linux it is convenient to use CGoban. If your program is black, set it up in the Go Modem Protocol Setup window as usual. For White, select "Device" and set the device to `/dev/cua0' if your serial port is COM1 and `/dev/cua1' if the port is COM2.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.8 Smart Game Format

The Smart Game Format (SGF), is the standard format for storing Go games. GNU Go supports both reading and writing SGF files. The SGF specification (FF[4]) is at: http://www.red-bean.com/sgf/


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9 Invoking GNU Go: Command line options


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.1 Some basic options


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.2 Other general options


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.3 Other options affecting strength and speed

This single parameter `--level' is the best way of choosing whether to play stronger or faster. It controls a host of other parameters which may themselves be set individually at the command line. The default values of these parameters may be found by running gnugo --help.

Unless you are working on the program you probably don't need these options. Instead, just adjust the single variable `--level'. The remaining options are of use to developers tuning the program for performance and accuracy. For completeness, here they are.

The preceeding options are documented with the reading code (see section Reading Basics).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.4 Ascii mode options


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.5 Development options


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.6 Experimental options

Most of these are available as configure options and are described in Other Options.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by debian-amd64 buildd user on September, 11 2006 using texi2html 1.76.