             _
  __ _  ___ | |__   ___ _ __
 / _` |/ _ \| '_ \ / _ \ '_ \
| (_| | (_) | |_) |  __/ | | |
 \__, |\___/|_.__/ \___|_| |_|
 |___/ v0.1.1


Goben implements a resizeable Go board that you can use to play Go
against humans or applications that talk GTP, such as GNUGo. If you
are as new to Go as I am, you may find that GNUGo is too strong an
opponent for you; there are some other less strong GTP-talking Go
players such as Amigoplus and Wallyplus linked to on the GNUGo
homepage.

Goben isn't the world's greatest front end to Go programs, but it is
functional. Critically, for me as a beginner, it allows you to choose
the boardsize and take a handicap. You can also save games in SGF
format, can load and browse SGF files, and can play on from any
position reached in an SGF file.

New In 0.1.1
============

* Reads and writes cfg file in $(HOMEDIR)/.gobenrc. File is created on
  first run and can be saved through settings dialog. Close with
  unsaved settings is queried.
* Says 'calculating score' when calculating score

Features
========

Goben knows about fixed handicaps, capturing and simple ko, and
doesn't allow suicide moves. You can also change the boardsize to
anything between 5x5 and 19x19, have normal or hicontrast style
stones, toggle visual co-ordinates, toggle IGS style coordinates (set
by default to omit the 'i'), set the komi value, edit the displayed
names of players, and set neither, either or both of black or white to
be played by an arbitary application with an arbitary command line, in
my case something like:

gnugo --mode gtp --quiet --level 1

Goben detects whether the application is speaking GTP1 or GTP2 and
does the Right Thing accordingly. (If not, please let me know...) If
the application does not appear to speak GTP at all, Goben will not
attempt to use it.

Goben also has support for SGF (Smart Game Format). Games played using
Goben can be saved in SGF format, and a reasonable subset of existing
SGF files can be loaded and viewed using Goben. Additionally, you can
play on from any position reached in an SGF file.

Fixed handicaps are supported for all boards between 7x7 and 19x19. Up
to four fixed handicap stones can be placed on 7x7 or even sized
boards, and up to nine fixed handicap stones can be placed on other
boards, following, I hope, GnuGO's behaviour.

Goben writes a configuration file to $(HOMEDIR)/.gobenrc on first run.
The settings dialog has a 'save' option, and if you quit the game without
saving your settings, you are given an option to save them then.

Caveats
=======

Orientation Problem
-------------------

Goben currently follows GnuGO in putting the third handicap stone of
three in the top left hand corner rather than the bottom right hand
corner or the middle. I am still confused as to what the correct
position should be, since all available rules sources seem to say it
should be at the bottom right hand corner. It is unlikely that GnuGO
has got it wrong; it is simply using a different orientation here, so
Goben has almost certainly got it wrong, and I've got my gtp support
upside down. Unfortunately, GnuGO and Goben seem not to disagree on
orientation when loading SGF files, which has confused hell out of
me. I don't yet know how to fix this.

Missing Features
----------------

Three major aspects of the game are currently missing:

- Free handicaps, allowed suicides, Ko rules involving more than one
  move.
- Scoring, other than whatever the Go engine you are using does when
  you call final_score, if you are using one.
- Timing

No actual rulesets are yet explicitly supported, though the idea is to
tweak the extent of the rules settings options until all the major
rulesets currently in use are capable of being supported. For now,
there is no option to permit suicide, no option to set free handicaps,
nor an option to vary the way the ko rule is implemented.

Many more SGF properties can be read than can be written; only the
minimal subset of SGF required to save games can currently be written.

Install
=======

./configure
make
make install

NB - You'll need GTK+1.2.x - I think it should work with 1.2.7 or
greater - please let me know if you find different.

NB2 - If you want to play against a computer, you'll need GNUGo
(http://www.gnu.org/software/gnugo/) and/or something else that talks
GTP (the GNUGo homepage has a good list).

NB3 - The default computer player, if no config file is found, is
/usr/local/bin/gnugo --mode gtp --quiet --level 1

If this makes no sense on your system, feel free to edit GNUGO_PATH
and/or GNUGO_OPTIONS in game.h before compiling. However, you can now
save settings changed through the GUI, so there is no longer a need to
edit game.h unless you really want to.


TODO
====

Core:
- Free handicaps
- Get the rulesets *right*. See eg http://home.snafu.de/jasiek/bascomp.html
  (free handicaps, allowed suicide, different ko rules, different komi settings)
- Scoring all games, not just games with gnugo
- Timing

IO:
- GTP only partially implemented
- SGF only partially implemented
- Network support

System:
- Make it compile on as many systems as possible
- Internationalise properly

Bugs / Issues
=============

- Quitting app while computer is thinking dumps core

- There is a nasty board orientation issue. Goben and GnuGo agree on
  board orientation when loading SGF files, but disagree when setting
  fixed handicaps. It is unlikely that GnuGo is getting this wrong,
  but I cannot yet figure out what Goben should do to fix it. Current
  behaviour follows what GnuGo appears to do, which is to appear to
  flip the board when handicap is set, by placing the third handicap
  stone in the top left rather than the bottom right.

- Bad things can happen with after attempts to load strange SGF files
  fail. I'll be more concerned about fixing this when SGF support is
  complete, though, or at least more advanced than it is.

- Bad things happen when you change boardsize with an SGF file loaded

- File management is awkward. Not clear what file is loaded, what
  current filename is, or whether a save is required or suggested.

- Occasional game glitches remain, eg bad things happen with programs
  that make illegal moves (wallyplus did this once and attempted
  suicide.) This can now be investigated with SGF.

Wishes
======

Gui:
- Should have internal resize slider between board and panel, for when
  overlong strings push it out of kilter.
- Should be able to toggle comments window off.
- Option to mark last moved stone
- Multiple game background images
- Toggle for Alphanumeric / Japanese numbering
- Should be able to toggle auto/click ai/ai game behaviour

SGF:
- Should be able to ffw and rw to next and previous variation / comment / etc
- Should be able to navigate multi-game trees.
- Non-obvious missing SGF stuff from ff4_ex.sgf - allowed suicide
- Should have default sgf save directory as setting, not just current dir

GTP:
- It would be *really* good to have a gtp debug window with a text box
  and an entry box, so we can watch the gtp communication in real
  time, and optionally be able to insert arbitrary commands by hand.
- Should 'know' about all GTP Go playing programs on the system and be able
  to select between them

System:
- Multiple Gobens on a network should be able to talk to each other with GTP

GTP Notes
=========

Implemented:

GTP 1 and 2:
 name
 version
 quit
 boardsize <int>
 komi <float>
 final_score
 protocol_version
 fixed_handicap <int>
 loadsgf <filename> <int>

GTP 1
 genmove_white
 genmove_black
 white <move>
 black <move>

GTP2
 genmove <colour>
 play <colour> <move>
 clear_board

Unimplemented:

Core
 known_command (GTP 2 only)
 list_commands (GTP 2 only)
 help (GTP 1 only - aka list_commands in 2)

Tournament:
 place_free_handicap (2 only)
 set_free_handicap (2 only)

Regression:
 reg_genmove (2 only - 1 would use genmove followed by undo)

Other:
 undo (1+2, need this for when we disagree with AI about legality of moves)

GTP2 protocol draft specification lists many more - eventually there
should be some notion of support for all commands listed by help or
list_commands, and a nice popup window to display the GTP stream and
allow insertion of arbitrary commands.

QUERY - There is an orientation issue which I do not yet understand -
for some reason, GnuGO seems to place its handicap stones rotated
through 180 degrees. Perhaps it is always rotating everything through
180 degrees and I haven't fixed it yet. Sadly, loadsgf seems to give
the same orientation we do. I don't understand what I am doing wrong
here.

GTKGoboard Notes
================

Two bugs found and fixed (so far), plus the elimination of compiler
warnings (all spurious).  Should write to Changwoo Ryu saying thankyou
and including a patch.  Should also write to author of Baduki with
same information (my version of Baduki contains the finalise bug at
least, though I haven't done a diff against mine or the original yet).

SGF Notes
=========

Goben now has a partial implementation of SGF FF[4]. Games played with
Goben can be recorded in SGF FF[4] format, and a limited subset of SGF
files can be read and played back.

The SGF parser has been written with full SGF compliance in mind,
although this is clearly some way off. For now, while Goben will
attempt to read all SGF properties, it can only actually use a subset
of them. Also, while it will (or at least should) read multi-tree
collections, there is not yet a way of navigating beyond the first
tree found.

Actual SGF editing is still extremely primitive - it's enough to save
games with but that's about it.


Can read:
---------
All 67 FF[4] properties (including Go specific ones), though elists
and composed data may not yet be read properly + 2 recommended common
obsolete properties.

Text and SimpleText are now handled according to the spec, with the
caveat that unlimited size text fields are not supported; rather there
is a cap of 64K on all fields. I haven't yet found an SGF file that
requires more than 64K in a single field; if I do, I'll change this.

Can write (15/69):
----------
Root: FF, GM, AP, SZ (4/6)
Gameinfo: KM, HA, PB, PW, RU, GC, GN, DT, RE (9/23)
Move: B, W (2/4)

54 missing.

Can use (40/69):
----------------

Go: HA, KM (2/4)
Move: B, W (2/4)
Setup: AB, AE, AW, PL (4/4)
Node annotation: C, DM, GB, GW, HO, N, UC, V (8/8)
Move annotation: BM, DO, IT, TE (4/4)
Markup: (0/9)
Root: SZ, (1/6)
Gameinfo: PB, PW, HA, KM, GN, RE, AN, BR, BT, CP, DT, EV, GC, ON, OT,
	  PC, RO, SO, US, WR, WT (21/23)
Timing: (0/4)
Misc: (0/3)
Obsolete: (0/2)

29 missing.

Go: TB, TW (2/4)
Move: KO, MN (2/4)
Setup: (0/4)
Node annotation (0/8)
Move annotation (0/4)
Markup: AR, CR, DD, LB, LN, MA, SL, SQ, TR (9/9)
Root: AP, CA, FF, GM, ST (5/6)
Gameinfo: TM, RU (2/23)
Timing: BL, OB, OW, WL (4/4)
Misc: FG, PM, VW (3/3)
Obsolete: M, L (2/2)


SGF Plan
--------
* Add visible support for V property
* Support GM so we don't bother reading non-Go games, add syntax
  checking so we eliminate Bad Things in the SGF file not in the data
  structure.
* Handle multi-tree collections, ST property
* Add all markup properties but lines and arrows, GUI interface
  to write any of these properties, set up positions, etc. This will
  require most of the remaining parser flaws to be fixed.
* Add free handicaps, clocks, timing properties, etc. Playback
  according to notated timing would be a cute feature to add in here.
* Implement FG, PM, VW and FF, together with some reasonable subset of
  FF[1] and FF[3] handling, to ensure that we can read as many SGF
  files as humanly possible.
* Last, add lines and arrows support to gtkgoboard.c, so we can
  support that markup too. After a quick look, I have no idea at all
  how to do this.


SGF To Do
---------
 1 - Syntax checking i   - uniqueness of properties in a node
 2 - Syntax checking ii  - allowedness of properties in a node
 3 - Syntax checking iii - further property specific syntax
 4 - Elist unsupported?
 5 - Composed data unsupported
 6 - Composed points unsupported
 7 - Composed point:text unsupported
 8 - Proper handling of unknown properties unsupported

Author/Thanks
=============

Wayne Myers, waz@easynet.co.uk, http://www.waz.easynet.co.uk/

gtkgoboard widget by Changwoo Ryu - see gtkgoboard.h for details.

Many thanks are due to the following people (in no particular order)
for their various help, code, links, encouragement and bug reports:

Frank Boehme
Daniel Bump and the GnuGo team
Wolfram Fischer
Changwoo Ryu
Jan van der Steen
Dan Stromberg

License
=======

Goben is a GUI for the game of Go.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
    
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

