Smart Game Format

Definition
Smart Game Format (SGF) is a plain‑text file format used to record the moves, comments, and variations of board games, most notably the game of Go (also called weiqi or baduk). Files using this format typically carry the “.sgf” extension.

Overview
SGF was created to provide a flexible, extensible way to store game records that could be easily shared and processed by software. While originally devised for Go, the format has been adopted for other abstract strategy games such as chess, Othello, Reversi, Hex, and Shogi. SGF files are human‑readable and can be parsed by a wide variety of game‑review programs, archival tools, and online repositories. The format supports not only the sequential list of moves but also branching variations, timestamps, player information, and free‑form annotations.

Etymology/Origin
The term “Smart Game Format” reflects the intention to design a “smart” (i.e., versatile and information‑rich) way of representing game records. SGF was first introduced in 1993 by a group of Go enthusiasts on the Usenet newsgroup rec.games.go. The initial specification was circulated informally before being formalized and made publicly available under an open license.

Characteristics

Feature Description
Plain‑text syntax SGF files consist of a series of property identifiers followed by values enclosed in square brackets, e.g., ;B[dd] for a black move at coordinate “dd”.
Tree structure The format encodes the game as a parse tree, allowing multiple branches (variations) to be represented within a single file using parentheses.
Extensible properties Standard properties (e.g., GM for game type, FF for file format version, SZ for board size) coexist with user‑defined properties, enabling custom metadata without breaking compatibility.
Versioning The FF property indicates the SGF version (e.g., FF[4] denotes version 4, the most widely used).
Unicode support Property values may contain UTF‑8 characters, allowing comments and player names in various languages.
Compatibility Nearly all major Go and board‑game software (e.g., Drago, GoGui, KataGo, SmartGo, SGF4M) can import and export SGF files.
Compression Though inherently plain text, SGF files are often compressed (e.g., with gzip) for efficient storage and transmission.

Related Topics

  • Portable Game Notation (PGN) – a text format used primarily for chess game records.
  • Go (board game) – the abstract strategy game for which SGF was originally designed.
  • Kifu – a Japanese term for a written record of a Go game; SGF serves as a digital counterpart.
  • Game record databases – online repositories such as Go4Go, KGS Archive, and OGS that store and share SGF files.
  • Game analysis software – programs like Leela Zero, KataGo, and Apophysis that read SGF files to provide engine analysis.

Smart Game Format remains a de‑facto standard for the archival and exchange of board‑game records across multiple platforms and communities.

Browse

More topics to explore