Smart Game Format / Discussion

Sub-page of SmartGameFormat

xas? : Is there any news about XGF ?

Frs: What is the easiest way to merge two sgf files into one sgf file? The resulting sgf should contain all comments etc. from both sources. I have added comments, board markup and variants to a sgf file. My opponent has done the same. Our comments etc. are not identicial, but they are based upon the same game.

Arno: As far as I know there is no such software. I looked around for something similar about a year ago and did find nothing.

wms: I have a little command line java app that does just that. Makes the two files into separate variations off the root node. Email me if you want it, I can send it back.

TimBrent The hardball way is to take the two files and copy them, then change the copies' extention from. sgf to .txt. They can now be edited with any text editor that way (copying A.txt and pasting it into B.txt to create C.txt that can be renamed C.sgf.) Do it with copies to be safe,you'll still have the sgf files.

Benjamin Geiger: I am currently writing a sgf Python parser. How common are FF[1]-[3]? Are they likely to be encountered, or is FF[4] exclusively dominant? Is it worth the extra time and code required to load, or generate, the old formats properly?

Arno: If you are writing a general purpose parser you will find no way around FF1-3. It is still in use. Heck, people still use 10 year old GoWrite 1, which produces faulty FF1.

Benjamin Geiger: On the second thought, maybe I'll just use the one that's already out there...

Martin Kelley?: I have recently started reading r.g.g and notice that people post game records in a text format. How do I take that text and make it into a file that my sgf reader can handle? For example, the sgf text posted above; How do I put that into a reader?

Charles The answer may depend on your computer system, naturally enough. For me, I can save text as a plain text file from a word processor; and then change the file name from filename.txt to filename.sgf. Then my SGF reader will automatically open the file when I double-click it, because an association is created. It may be, in general, that an SGF reader can be asked to open any *.txt file: and will succeed.

Martin Kelley? : Thanks, Charles. I used cgoban2 (thanks WMS) and it works for both sgf and text files. Note that there are brackets missing for the komi value in the above example ;-)

Froese: While playing around with SGFs I noticed that there is no unique representation of a given game tree. For example "(;A;B;C)" and "(;A(;B(;C)))" describe the same game tree. Should applications solely work on the defined tree or is it allowed to present data differently depending on the SGF-representation? Has anyone tested applications against the later format? It may overflow parsers...

Arno: your later variant is over-defined, as defining a sub-tree without alternatives is equivalent to having no sub-trees. SGFC normalizes SGF data and produces unique representations. However, there is no unique representation defined in the SGF standard itself. As both your variants are equivalent from their content I don't know how you would "present" them differently.

Froese: Over-defined? I dare to disagree. I would call it the canoncial form (in contrast to the compact form). A node has properties and a list of children (sub-trees). The canonical way to write this is ";properties (child1) (child2)...". The compact form makes a special case out of nodes with a single child (";properties ;child ;child-of-child...").
Regarding "how to present differently": one example is given above - you can write the SGFs in differnt ways, preserve the canonical/compact syntax. Or, insert special "variation" markers in a tree window when seeing a sub-tree.
Sure, I wouldn't want to see an application behave like that. It should only consider the defined tree. But I found nothing in the SGF specs regarding this ambiguity and hence my question, especially the "has anyone tested apps" one. I for example, encountered stack overflows in my parser when given long games in canonical form.

(Sebastian:) You do have a point that it makes a considerable storage difference. But why is that an issue if there is no need for what you call "canonical form"? As far as I can see, this situation can only arise when you

  1. add a variation for every move,
  2. then delete each main variation,
  3. and then your program doesn't clean up nicely.

wms: Froese, I don't know where this "canonical" form term comes from. If you read the SGF spec, it does not use this term. A careful read indicates that either form is acceptable, but if you look at all the examples you will see that when a node has only one child (ie, no variations) none of the examples have the extra parenthesis. Thus, I would say that your form is not "canonical," but instead is a non-standard (but technically correct) variant form.

Froese: Well, I introduced the term "canonical" form :-) I think it fits when talking about n-ary trees as does "compact" form for the representation of degenerated (1-ary) trees. I didn't want to raise a discussion about whether the one is better/worse/more correct then the other. I only noticed that the "compact" form is always used in the examples and wondered if that has any consequences...

Peter Williamson? Can you put move times into a SGF file? For example, if you want to keep track of how much time remaining each player has, can you somehow put the amount of time left for each moves into SGF? I did a quick check of the spec, and I didnt' see any way to do this except comments. Is there a standard way?

axd: to store timing information, see [ext]

see also SGF Wishlist here on senseis wiki (it could be called TS = time spent, a new property, or like in the link: BE/WE black/white time elapsed)

Baz: Is there *any* way anyone knows of to take an SGF and print out a list of the move coordinates (of a particular branch of the SGF)? A friend and I are fans of printing out pro games and replaying them for studying/ideas, but a diagram (or three) of multiple hundreds of moves on them is hard to play out, though visually more helpful to read. A list of coordinates (chess-style), would make replaying a game much faster. It can't be that hard, the SGF itself is a glorified list of coordinates, after all. I just can't find a program to do it.

AshleyF: Baz, check out GoPrintingSoftware.

Antony: Does a program, in whick I can fill or add joseki, exist?

Bette: I was looking at a file SmartGo(1.4) created, and it had a couple tags I couldn't find in the [ext] specification's property index list: DB and DW. What do they mean exactly, and why weren't they listed?

Smart Game Format / Discussion last edited by on December 29, 2009 - 15:20
RecentChanges · StartingPoints · About
Edit page ·Search · Related · Page info · Latest diff
[Welcome to Sensei's Library!]
Search position
Page history
Latest page diff
Partner sites:
Go Teaching Ladder
Login / Prefs
Sensei's Library