Draft: SGF Style Guide (FF)
The goal of this guide is to provide a uniform look and feel
for building game collections.
If you have any suggestions or comments, please mail me:
Game tree structure
The first branch is the main branch!
The first (leftmost) branch of the game tree should always be the real
game. Variations should go into other branches.
Correct: The game comes first
Wrong: the variation comes first, the game is in the side branch
Comment Antoine de Maricourt:
Omit extra pass plays and empty nodes at the end of the game. The last node
of the game should contain the last move on the board. Do not put game
information such as
'Black wins and connects Ko' into the comment field, rather add another move
to the game which connects the Ko. In this case, two consecutive moves by
the same color should be used, rather than a 'capture Ko, Pass, Connect'
sequence. Pass plays which are in the game record and followed by
non-pass plays should be given.
Differences between current SGF viewers
A good summary can be found in Bill Hosken's
on the teaching ladder.
Move and Setup properties
Do not mix move and setup properties in the same node.
A setup property indicates
a radical change in the board position. If a move suffices, use a move.
Setup props will rarely be used after moves have already been played, except
for a 'what-if' type of analysis (see below).
The usual usage will be:
Especially, the AddEmpty property will rarely be used.
- Maybe some empty nodes, e.g. to organize a problem collection
- A setup node with AddBlack and AddWhite properties
- Moves starting from the setup position
Antoine de Maricourt mentions one possibility:
- variation diagrams, i.e. something like 'what if black stone were
there instead of there'
Variations and alternative moves
There are many ways to display variations on the screen.
You can show alternatives to the current move, or different follow-up moves.
There is only one way, however, to store variations
in an SGF file: use the
Put alternative moves at the same tree level
Some popular SGF viewers
seem to do the following: To show alternatives to the current move,
they add a child node (i.e. a follow-up move), remove the current move by
using an AddEmpty property and put the other move into the node.
Correct: Both black moves are on the same level
Wrong: the second black move is on the wrong tree level
Comment Antoine de Maricourt:
Please use the ISO-standard format "YYYY-MM-DD" for the date field.
Dates in this format can be sorted alphanumerically.
Do not use other separators such as "/", " " or ".".
For games that last more than one day, we recommend adding the other
dates as follows:
Use "YYYY-MM-DD,DD" if the month is the same.
Use "YYYY-MM-DD,MM-DD" if the month is different, year is the same.
Use "YYYY-MM-DD,YYYY-MM-DD" if the year is different.
Use "0" (zero) for a draw (jigo), "B+score" for a black win,
and "W+score" for a white win, e.g. "B+2.5", "W+64". Use .5, not 1/2.
For half point results, the format "B+0.5", "W+0.5" is suggested.
"B+R" and "W+R" for a win by resignation. Please do not write
"Black resigns", as a sorting algorithm may think Black is the winner.
Use "B+T" and "W+T" for a win on time,
"B+F" and "W+F" for a win by forfait, "?" for unknown result.
Event, ID, etc.: Identifying a game
The EV tag
When exchanging pro games we could compile a list of "official"
EV events. We can use the indices which I created for the WWW
pages for the major Japanese titles to start with:
When encoding a Tengen game, the appropriate entry for the EV
key would be one of the entries in the list:
Other titles similarly.
The ID tag
I like the way you used it, although I would add the century to it.
Another story is the league games. How to classify them? I have no
Comment MM: I used 'YY/Round' as an ID tag. For some leagues (Honinbo, Meijin)
there is a
canonical number (as in Kido yearbook), so the ID might be YYYY/L/number,
with the L indicating the league. For other tournaments,
sort by some canonical order? E.g. date, black placer, white player.
Names, events, and
places should be spelled consistently in all games.
**** Use canonical spelling page on WWW, Jan?
Last modified: Mar 9, 1995
Martin Müller, email@example.com