Smart Game Format


The Smart Game Format is a computer file format used for storing records of board games. Go is the game that is most commonly represented in this format and is the default. SGF was originally created under a different name by Anders Kierulf for his SmartGO program. The current version of the format is 4.
The main purposes of SGF are to store records of played games and to provide features for storing annotated and analyzed games. It is a text-only, tree-based format. The tree structure makes the addition of variations simple. It is also text-based instead of binary for the sake of portability.
Games stored in SGF format can easily be emailed, posted or processed with text-based tools. Most Internet Go servers and Go software from 1990 support this format.

About the format

An SGF file is composed of pairs of properties and property values, each of which describes a feature of the game. A partial list of properties appears below.
ABAdd Black: locations of Black stones to be placed on the board prior to the first move
AWAdd White: locations of White stones to be placed on the board prior to the first move.
ANAnnotations: name of the person commenting the game.
APApplication: application that was used to create the SGF file.
Ba move by Black at the location specified by the property value.
BRBlack Rank: rank of the Black player.
BTBlack Team: name of the Black team.
CComment: a comment.
CPCopyright: copyright information.
DTDate: date of the game.
EVEvent: name of the event.
FFFile format: version of SGF specification governing this SGF file.
GMGame: type of game represented by this SGF file. A property value of 1 refers to Go.
GNGame Name: name of the game record.
HAHandicap: the number of handicap stones given to Black. Placement of the handicap stones are set using the AB property.
KMKomi: komi.
ONOpening: information about the opening, rarely used in any file.
OTOvertime: overtime system.
PBBlack Name: name of the black player.
PCPlace: place where the game was played.
PLPlayer: color of player to start.
PWWhite Name: name of the white player.
REResult: result, usually in the format "B+R" or "B+3.5".
RORound: round.
RURules: ruleset.
SOSource: source of the SGF file.
SZSize: size of the board, non-square boards are supported.
TMTime limit: time limit in seconds.
USUser: name of the person who created the SGF file.
Wa move by White at the location specified by the property value.
WRWhite Rank: rank of the White player.
WTWhite Team: name of the White team.

There is no strict checking of the contents of these tags, so it is possible to put any text into the result tag for example.
Variations are nested in brackets, and also usually assigned letters. The first branch is the main branch.

Coordinate system for points and moves

The first letter designates the column, the second the row. The upper left part of the board is used for smaller boards, e.g. letters "a"-"m" for 13*13.
The author intentionally broke with the tradition of labeling moves with letters "A"-"T" and numbers 1-19. Two lower-case letters in the range "a"-"s" were used instead, for reasons of simplicity and compactness.
The upper left corner as origin of the board corresponds to the way most modern computers represent screen coordinates to simplify integration of text and graphics.

Supported games

Games currently supported are Amazons, Ataxx, Backgammon, Blokus, Byte, Chase, Chess, DVONN, Exxit, Focus, Gess, GIPF, Go, Gobblet, Gomoku+Renju, Hex, Hive, Hnefatafl, Jungle, Kropki, Kuba, Lines of Action, Neutron, Nine men's morris, Octi, Philosopher's Football, Plateau, PÜNCT, Quadrature, Reversi, Sahara, Shogi, TAMSK, Tantrix, Trax, Tripples, Tumbling Down, TwixT, Xiangqi, YINSH and ZÈRTZ.

Format Versions

The first version of SGF, FF, was conceived by Anders Kierulf in 1987. It is Appendix A in his Ph.D. thesis. FF was written by Martin Müller in 1993. The current version of the SGF is FF by Arno Hollosi, and is supported by most current SGF readers. FF was never made public. The format has been published under the Open Content License. Current development status is "not active".

Limitations