|
Task Description
This patch adds the sgfbox plugin, a game recorder and viewer for Go/Igo/Weiqi/Baduk. It saves and views SGF ( http://senseis.xmp.net/?SmartGameFormat) files which are pretty much standard in the Go world.
It was developed and tested ONLY on a sansa e280, and there is no specific handling of any other platforms. In particular the button mapping is specific to the e200, and I doubt it will work well on other players (comments on what keys will work well one what players are welcome).
If you don’t know what Go is, try here: http://senseis.xmp.net/?Go
I did not include any SGF files with this patch, but you can easily find some on the internet. Here are some random ones if you’re lazy: http://www.andromeda.com/people/ddyer/age-summer-94/companion.html
The bulk of this patch is ports of needed parts of GNU Go (libsgf and libboard). GNU Go is released under GPL, so there should be no issues with licensing.
Release notes:
This plugin is very much a work in progress and is /not/ ready for SVN inclusion. The porting of GNU Go code was done very sloppily and should probably be redone. A lot of code/data that isn’t being used is probably included in the ported parts, making this plugin use up almost all of the 512 KB available on most ports. It will definitely not build/run on targets with less than this available for plugins.
- No rigorous testing has been done. It seems rather stable, but
I would not be at all surprised if there are huge crashes and
file corruption bugs. Don't depend on this to record games that
you care about, and don't come crying if it magically crashes your
player, deletes all your music, and burns your house down.
- Game results are not handled in any way (neither read nor written) - Game comments and board marks are not handled - Player and place information is not output - The plugin reads and writes files to / for now. - The plugin assumes that /default.sgf is an SGF file that it can use
to store the current game state if no other file is specified
- It has only been used/tested on a sansa e280 - The controls are almost certainly not going to work well on any
other player, but I really have no idea what will.
- It assumes that you have a color bitmap display, which shouldn’t be
necessary
- The code is really ugly and probably breaks every guideline. If
you are brave, the main plugin code is in sgfbox.c, the rest being
mainly ports of GNU Go code. The malloc code seems to be in public
domain.
This plugin could be slimmed down quite a bit, but it’s never going to be small. A board library for Go is fundamentally a non-trivial problem, if you want to be able to undo moves in a timely fashion, for several reasons including: - One move can change a large portion of the board and you have to either keep track of what changed, or replay through the whole game from the beginning - Keeping track of strings of stones is really annoying to do efficiently (which is necessary to handle captures) - There’s a lot of board state that is a little annoying (ko positions, captured stones)
|