GoRilla


Penguin


Contact Me




Smart Game Format ( SGF )


This page gives information about the SGF implementation and extensions that are used by the GoRilla editor.



SGF Specification

The official specification of the SGF FF[4] standard is located at [ http://www.red-bean.com/sgf/ ]. Please consult this site for more detailed information about the SGF format.

Go,  Othello, Hex,  Kropki

Go, Othello / Reversi, Hex and Kropki have recognised SGF formats. For Hex games, GoRilla accepts ‘[swap-pieces]’ and ‘[swap-sides]’ moves within game files wherever they occur. GoRilla will assume 'GM[1]' ( i.e. Go ) if the SGF GM parameter is not present in a game file. This is consistent with the SGF FF[4] standard. The default size for Go is 19 ( 'SZ[19]' ) and for Hex it is 17 ( 'SZ[17]' ).

For Othello / Reversi and Hex, GoRilla will accept move placements in either the algebraic or Go format ( i.e. 'B[c4'] or 'B[cd]' ).

Kropki. For details about the SGF extensions for Kropki visit [ http://eidokropki.reaktywni.pl/sgf-for-kropki.html ]. GoRilla will use the dot notation inside the SGF parameters W and B to define borders of territory. For composed positions it will use the dot notation inside the TW and TB parameters to define the composed areas of territory. GoRilla will accept the SGF SZ parameter in two formats, numeric or character. Thus, 'SZ[39:32]' or 'SZ[NG]' will indicate a 39x32 size board, 'SZ[N]' or 'SZ[39]' will indicate a 39x39 board. GoRilla supports board sizes up to 45x45.

Unlur,  Havannah

Unlur and Havannah currently have no recognised SGF format. In order to represent these games GoRilla uses a modification to the SGF format for Hex. ‘4000’ or ‘Unlur’ are used to indicate an Unlur game, ‘4100’ or ‘Havannah’ to indicate a Havannah game ( e.g. ‘GM[4000]’, ‘GM[Unlur]’. ) For Unlur the SGF SZ parameter represents the size of the playing board at its maximum width. SZ must be an odd number for Unlur. For Havannah SZ represents the length of the board sides.

Unlur Players.  The nature of the game of Unlur is that the colours are not set at the start of a game. Initially both players play with the black pieces and the colours are decided only once play has started. GoRilla uses the 'PB' parameter to indicate the player who goes first and 'PW' for the second player, and not to indicate which player gets to play with which colour.

Unlur Passing.  'B[]' is used within an SGF file to indicate that a player has taken the black pieces.

Havannah Swapping.  GoRilla accepts ‘[swap-pieces]’ and ‘[swap-sides]’ moves for Havannah wherever they occur inside a game file.

Lower Case Parameter Types

GoRilla will remove any numbers or lower case characters from the SGF parameter types. This will enable files in old SGF versions formats to be read. ( Use of lower case characters was allowed in earlier versions of SGF but is not permitted in SGF-FF[4]. )

SGF Markup

The following SGF markup properties are supported: TR, CR, SQ, MA, LB, TB, TW. GoRilla will convert the old SGF properties M, L, SL into properties MA, LB, SQ.

XS,  XV,  XP,  XB

These are non-standard SGF parameters used by GoRilla.

  • XS[] marks the game in a collection that is to display on initial load of the game file. XS[] can be used only in the SGF header.
  • XV[] marks the node within each game that is to display on initial navigation to that game. GoRilla will use these parameters to open a game file at the exact node and game that was displayed when the game file was saved. This is useful when working with large multi-game, multi-branch game files.
  • XP[] marks the primary position within each game.
  • XB[] is used to store bookmarks. ( 'XB[]', 'XB[2]' ). The numeric value defines the order in which the bookmark appears in the list. Null value bookmarks ( 'XB[]' ) will be placed at the head of the list and will be given a suitable value.