Smart Game Format

Last updated
Smart Game Format
Filename extension
.sgf
Developed byAnders Kierulf (1987, FF1), Martin Mueller (1993, FF3), Arno Hollosi (1997, FF4)
Initial release1987
Latest release
4
1997
Type of formatmark up text
Container for Go (game) record
Open format? yes
Website red-bean.com/sgf/

The Smart Game Format (SGF) is a 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.

Contents

The main purposes of SGF are to store records of played games and to provide features for storing annotated and analyzed games (e.g. board markup, variations). It is a text-only, tree-based format.

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. [1]

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 (e.g. CGOban2,...).
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 (e.g. 58th Honinbō Title Match).
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 (Fuseki), rarely used in any file.
OTOvertime: overtime system.
PBBlack Name: name of the black player.
PCPlace: place where the game was played (e.g.: Tokyo).
PLPlayer: color of player to start.
PWWhite Name: name of the white player.
REResult: result, usually in the format "B+R" (Black wins by resign) or "B+3.5" (black wins by 3.5).
RORound: round (e.g.: 5th game).
RURules: ruleset (e.g.: Japanese).
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 (variation A) is the main branch. [2] This notation stems from Newick format.

Coordinate system for points and moves

The first letter designates the column (left to right), the second the row (top to bottom). 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 (and points) with letters "A"-"T" (excluding "i") 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 [3] are Amazons, Ataxx, Backgammon, Blokus [4] , 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 (Othello), Sahara, Shogi, TAMSK, Tantrix, Trax, Tripples, Tumbling Down, TwixT, Xiangqi, YINSH and ZÈRTZ.

The standard specifies additional game-specific properties for Go, Backgammon, Lines of Action, Hex, Amazons, Octi, Gess, and TwixT.

Format Versions

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

FF[4] is outdated, but has not been replaced by something more recent. For a description of current usage and some recommendations, see. [6]

Limitations

The FF[4] standard has some problems that make it impossible, or at least unreasonable, to adopt it for large game collections. For some discussion, see. [7]

The fact that there is no standard designation for many properties that one might wish to represent is not really a limitation. The system is extensible, one can invent new labels, and of course that has happened already. After a while, the popular ones among the new labels become standard.

See also

Related Research Articles

<span class="mw-page-title-main">Chessboard</span> Any board used in the game chess

A chessboard is a gameboard used to play chess. It consists of 64 squares, 8 rows by 8 columns, on which the chess pieces are placed. It is square in shape and uses two colours of squares, one light and one dark, in a chequered pattern. During play, the board is oriented such that each player's near-right corner square is a light square.

<span class="mw-page-title-main">Algebraic notation (chess)</span> Method to convey chess moves

Algebraic notation is the standard method for recording and describing the moves in a game of chess. It is based on a system of coordinates to uniquely identify each square on the board. It is used by most books, magazines, and newspapers.

<span class="mw-page-title-main">Three-dimensional chess</span> Variants of chess with multiple boards at different levels

Three-dimensional chess is any chess variant that replaces the two-dimensional board with a three-dimensional array of cells between which the pieces can move. In practice, this is usually achieved by boards representing different layers being laid out next to each other. Three-dimensional chess has often appeared in science fiction—the Star Trek franchise in particular—contributing to the game's familiarity.

This glossary of chess explains commonly used terms in chess, in alphabetical order. Some of these terms have their own pages, like fork and pin. For a list of unorthodox chess pieces, see Fairy chess piece; for a list of terms specific to chess problems, see Glossary of chess problems; for a list of named opening lines, see List of chess openings; for a list of chess-related games, see List of chess variants; for a list of terms general to board games, see Glossary of board games.

A fairy chess piece, variant chess piece, unorthodox chess piece, or heterodox chess piece is a chess piece not used in conventional chess but incorporated into certain chess variants and some chess problems. Compared to conventional pieces, fairy pieces vary mostly in the way they move, but they may also follow special rules for capturing, promotions, etc. Because of the distributed and uncoordinated nature of unorthodox chess development, the same piece can have different names, and different pieces can have the same name in various contexts as it can be noted in the list of fairy chess pieces.

Portable Game Notation (PGN) is a standard plain text format for recording chess games, which can be read by humans and is also supported by most chess software.

Forsyth–Edwards Notation (FEN) is a standard notation for describing a particular board position of a chess game. The purpose of FEN is to provide all the necessary information to restart a game from a particular position.

Chess notation systems are used to record either the moves made or the position of the pieces in a game of chess. Chess notation is used in chess literature, and by players keeping a record of an ongoing game. The earliest systems of notation used lengthy narratives to describe each move; these gradually evolved into more compact notation systems. Algebraic notation is now the accepted international standard, with several variants. Descriptive chess notation was used in English- and Spanish-language literature until the late 20th century, but is now obsolescent. Portable Game Notation (PGN) is a text file format based on English algebraic notation which can be processed by most chess software. Other notation systems include ICCF numeric notation, used for international correspondence chess, and systems for transmission using Morse code over telegraph or radio. The standard system for recording chess positions is Forsyth–Edwards Notation (FEN).

A Go game record is an archival record for a game of Go.

Fast Infoset is an international standard that specifies a binary encoding format for the XML Information Set as an alternative to the XML document format. It aims to provide more efficient serialization than the text-based XML format.

<span class="mw-page-title-main">Shane's Chess Information Database</span> Software application for viewing and maintaining databases of chess games

Shane's Chess Information Database (Scid) is a free and open source UNIX, Windows, Linux, and Mac application for viewing and maintaining large databases of chess games. It has features comparable to popular commercial chess software. Scid is written in Tcl/Tk and C++.

An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be compressed or uncompressed. If the data is compressed, it may be done so using lossy compression or lossless compression. For graphic design applications, vector formats are often used. Some image file formats support transparency.

Portable Draughts Notation (.PDN) is the standard computer-processable format for recording draughts games. This format is derived from Portable Game Notation, which is the standard chess format.

X-FEN is an extension of Forsyth–Edwards Notation (FEN) introduced by Reinhard Scharnagl in 2003. It was designed to be able to represent all possible positions in Fischer random chess (FRC) and Capablanca random chess (CRC). It is fully backward compatible with FEN.

Sensei's Library is an Internet website and wiki, dedicated to articles about, and discussion of, the game of Go. It was started in September 2000, by the Go players Morten Pahle and Arno Hollosi. Hollosi is also known for designing version 4 of Anders Kierulf's popular SGF file format and for his work with the Austrian Citizen Card project.

<span class="mw-page-title-main">Go software</span> Software playing the board game Go

There is an abundance of go software available to support players of the game of Go. This includes software programs that play Go themselves, programs that can be used to view and/or edit game records and diagrams, programs that allow the user to search for patterns in the games of strong players and programs that allow users to play against each other over the Internet.

<span class="mw-page-title-main">Zillions of Games</span> General game playing software

Zillions of Games is a commercial general game playing system developed by Jeff Mallett and Mark Lefler in 1998. The game rules are specified with S-expressions, Zillions rule language. It was designed to handle mostly abstract strategy board games or puzzles. After parsing the rules of the game, the system's artificial intelligence can automatically play one or more players. It treats puzzles as solitaire games and its AI can be used to solve them.

<span class="mw-page-title-main">Shogi notation</span> Notation system for Shogi

Shogi notation is the set of various abbreviatory notational systems used to describe the piece movements of a shogi game record or the positions of pieces on a shogi board.

<span class="mw-page-title-main">Chess variant</span> Games related to, derived from or inspired by chess

A chess variant is a game related to, derived from, or inspired by chess. Such variants can differ from chess in many different ways.

References

  1. "SGF file format FF[4]". red-bean.com. 6 August 2006. Retrieved 2 June 2023.
  2. "SGF - Variations". red-bean.com. 7 January 1999. Retrieved 2 June 2023.
  3. https://homepages.cwi.nl/~aeb/go/misc/sgf.html
  4. https://github.com/enz/pentobi/blob/master/libpentobi_base/Pentobi-SGF.md
  5. "Definition of the Smart Game Format". British Go Association . Retrieved 2 June 2023.
  6. "The SGF Format".
  7. "Notes on the SGF format".