VR[48.6
e.g. Leela thinks Black is 48.6% to win, Elf thinks Black is 43.6% to win...
By the way, I want to very strongly object to this idea. SGF is an absolute delight both to parse and to write.John Fairbairn wrote:Not all sgf editors read sgf files correctly. In fact, I'm told that very, very few do. Even the Eidogo one used on this forum seems to choke on quite a few things.
So extending the format seems to be a recipe for more confusion. A fresh start using e.g. xml may be wiser.
What if AB[dd][dp][pd][pp] are taken as separate nodes AB[dd]AB[dp]AB[pd]AB[pp]?Amtiskaw wrote:SGF properties can have multiple values attached to them, e.g. AB[dd][dp][pd][pp] so if one wants to have a winrate for a node by multiple bots, you could have something like:
VR[48.67.5:Leela Zero][43.6:900:7.5:Elf]
e.g. Leela thinks Black is 48.6% to win, Elf thinks Black is 43.6% to win...
A semi-colon ; is how SGF specifies a new node has started.deungsan wrote:What if AB[dd][dp][pd][pp] are taken as separate nodes AB[dd]AB[dp]AB[pd]AB[pp]?
There are lots of semicolons in a sgf file, but there is no node in sgf. Perhaps a concept of nodes could be a product of some programmers, used in their sgf parser.Amtiskaw wrote: A semi-colon ; is how SGF specifies a new node has started.
AB or AW is not a key, but a property name in sgf. In my understanding, sgf is a collection of property name and property value pairs. SGF can be parsed without using node or key. In my program, AB[dd]AB[dp]AB[pd]AB[pp] is not "invalid". By the way on what basis you call this valid or invalid?Amtiskaw wrote: Finally, ;AB[dd]AB[dp]AB[pd]AB[pp] is actually invalid because of duplicated keys within a node, although many SGF readers will accept it as being 1 node with 4 values.
There's some terminology confusion that maybe I'm contributing to, but property names are what I'm calling keys."SGF is a text-only format (not a binary format). It contains game trees, with all their nodes and properties, and nothing more."
[...]
Only one of each property is allowed per node, e.g. one cannot have two comments in one node:
... ; C[comment1] B [dg] C[comment2] ; ...
Code: Select all
public moveProperties: MoveProperties = new MoveProperties();
public setupProperties: SetupProperties = new SetupProperties();
public nodeAnnotationProperties: NodeAnnotationProperties = new NodeAnnotationProperties();
public moveAnnotationProperties: MoveAnnotationProperties = new MoveAnnotationProperties();
public markupProperties: MarkupProperties = new MarkupProperties();
public timingProperties: TimingProperties = new TimingProperties();
public miscProperties: MiscProperties = new MiscProperties();
public scoreEstimateProperties: ScoreEstimateProperties = new ScoreEstimateProperties();
My fear is, that once you start messing with the shape of the board, that <1% of software will implement it. The same goes for 3-color-go, circular boards, boards without edges, not to mention 3D shaped boards, ...lightvector wrote:While we're at it, explicit support for non-square board sizes in the format would also be nice, specifying width and height separately.
This isn't so. Firstly, SGF supports up to size 52, e.g. try (;SZ[52];B[XX];W[dW];B[cc];W[Wd]) in a good viewer, e.g. Sabaki.lightvector wrote:If there is going to be a new standard, I hope it will stop using the silly alphabetic encoding for coordinates that only permits board sizes up to 25x25, and just start using zero-indexed or one-indexed integers. That part of the SGF spec confuses me, it specifically reduces the futureproofness and flexibility of the format, increases parsing difficulty (you have to skip the letter 'i'!)
lightvector wrote:While we're at it, explicit support for non-square board sizes in the format would also be nice, specifying width and height separately.
Amtiskaw wrote:This isn't so. Firstly, SGF supports up to size 52, e.g. try (;SZ[52];B[XX];W[dW];B[cc];W[Wd]) in a good viewer, e.g. Sabaki.lightvector wrote:If there is going to be a new standard, I hope it will stop using the silly alphabetic encoding for coordinates that only permits board sizes up to 25x25, and just start using zero-indexed or one-indexed integers. That part of the SGF spec confuses me, it specifically reduces the futureproofness and flexibility of the format, increases parsing difficulty (you have to skip the letter 'i'!)
Secondly, one does not "skip the i" when parsing. The viewer itself may or may not display coordinates like that, but the SGF format has no concept whatsoever that i is skipped. Try (;SZ[19];B[ii])
Is it possible you're talking about GTP rather than SGF? The two aren't related.
As for spook's ideas, certainly JSON is far nicer to deal with than XML but I'm not exactly seeing the need. SGF is not "hard to parse", it is easy to parse. It is not hard to create collections, it is trivial.
Oh, sorry, yep that would be GTP rather than SGF. But yeah, the fact that GTP has these encoding restrictions is really annoying. Looks like SGF is actually a bit nicer, so ignore my previous post.Bill Spight wrote:lightvector wrote:While we're at it, explicit support for non-square board sizes in the format would also be nice, specifying width and height separately.
(;FF[4]ST[2]GM[1]CA[UTF-8]AP[GOWrite:3.0.15]SZ[5:7]PM[2]FG[259:]PB[ ]PW[ ]GN[ ]
)
5x7 board.
If we get a little more technical it may become obvious.Amtiskaw wrote:As for spook's ideas, certainly JSON is far nicer to deal with than XML but I'm not exactly seeing the need. SGF is not "hard to parse", it is easy to parse. It is not hard to create collections, it is trivial.
Code: Select all
info move Q16 visits 33 winrate 4346 prior 1673 lcb 4299 order 0 pv Q16 D4 D16 Q4 C6 C14 R6 R14 O3 info move D16 visits 33 winrate 4347 prior 1662 lcb 4298 order 1 pv D16 Q4 Q16 D4 C6 C14 R6 R14 O3 info move Q4 visits 33 winrate 4349 prior 1663 lcb 4293 order 2 pv Q4 D16 D4 Q16 R14 R6 C14 C6 O17 info move D4 visits 29 winrate 4340 prior 1644 lcb 4280 order 3 pv D4 Q16 D16 Q4 O17 F17 O3 F3 R6Code: Select all
stats: [
{
move: "Q16",
visits: 33,
winrate: 43.46,
priority: 1673,
lcb: 42.99,
order: 2
prediction: [Q16 D4 D16 Q4 C6 C14 R6 R14 O3]
},
{
move: "D16",
visits: 33,
winrate: 43.47,
priority: 1662,
lcb: 42.98,
order: 1
prediction: [D16 Q4 Q16 D4 C6 C14 R6 R14 O3]
},
...
]Code: Select all
stats: [
{
move: "Q16",
winrate: 43.46,
},
{
move: "D16",
winrate: 43.47,
},
...
]Code: Select all
botStats: [
{
bot: "LeeLa Zero",
version: "0.16 weightXyZ",
stats: [ ... ]
},
{
bot: "AlphaGo",
version: "Master",
stats: [ ... ]
}
]
Last year I might have gone for XML.John Fairbairn wrote:Not all sgf editors read sgf files correctly. In fact, I'm told that very, very few do. Even the Eidogo one used on this forum seems to choke on quite a few things.
So extending the format seems to be a recipe for more confusion. A fresh start using e.g. xml may be wiser.
One simple solution for the OP seems to be to use the C[ ] property. The info he wants can be considered a kind of comment anyway, but he can also bracket it in some coded way within the C[] text so that the info can be used or extracted programmatically.
When writing, only ] and \ need to be escaped. When reading, just accept whatever follows a \ character as being part of the comment.spook wrote:each one of these has small variations and trade-offs in how they handle ";[]\/()" characters in comments.