2

When I save a 2-stone handicap game with qGo 2.0.0 using GNU Go 3.9.1 as engine and then open it with the same software, the handicap stones are missing. This is quite annoying, as one has to imagine the missing stones and the scoring function will count them as territory or dame or treat the position as unsettled.

I can add them to the SGF file by hand, in which case they appear as unnumbered stones when I click the button for the first move, followed by white’s first move numbered 1.

It is evident that either the save or the load function is incorrect, and I suspect that it is the former, as handicap stones need not be on hoshi.

  • Does the file format prescribe how handicap stones should be saved?
    • If so, does qGo+GNU Go do it right?
  • Is this function performed by qGo or GNU Go?
  • Is the manual addition of the stones the best workaround?

Here is an example of an SGF-file saved and edited, with the handicap stones added by hand (AB[pd][dp] at the end of the second line):

(;GM[1]FF[4]AP[qGo:2.0.0]ST[1]
SZ[19]HA[2]KM[0]PW[Human]PB[Computer]AB[pd][dp]

;W[pp];B[cd];W[ed];B[hd];W[fc];B[np];W[qm];B[cg];W[cc];B[bc]
;W[dc];B[dk];W[cn];B[en];W[cq];B[cp];W[bp];B[bo];W[bq];B[bn]
;W[dq];B[gq];W[eq];B[oq];W[pg];B[nd];W[bb];B[pq];W[qq];B[qr]
;W[rq];B[qf];W[qg];B[pe];W[qc];B[rd];W[rb];B[pj];W[pb];B[nb]
;W[qd];B[re];W[rc];B[sc];W[ri];B[gb];W[gc];B[hc];W[fb];B[hb]
;W[ef];B[bd];W[nc];B[mc];W[oc];B[sb];W[mb];B[lb];W[md];B[ma]
;W[od];B[ne];W[oe];B[kc];W[of];B[me];W[ld];B[le];W[qe];B[jq]
;W[mg];B[eg];W[gf];B[fg];W[ff];B[rr];W[sr];B[qp];W[rp];B[qo]
;W[ro];B[po];W[qn];B[hj];W[gg];B[ep];W[mj];B[ml];W[ok];B[kk]
;W[on];B[mn];W[oo];B[op];W[pn];B[fi];W[gr];B[fr];W[fq];B[hr]
;W[gp];B[hq];W[fp];B[hp];W[er];B[cm];W[ho];B[go];W[fo];B[gn]
;W[fn];B[fm];W[gm];B[hn];W[hm];B[io];W[in];B[ho];W[fk];B[im]
;W[em];B[fl];W[el];B[gl];W[hl];B[gk];W[dn];B[dm];W[eo];B[fj]
;W[ek];B[dj];W[dg];B[dh];W[df];B[cf];W[ij];B[ji];W[ii];B[ik]
;W[jj];B[kj];W[jh];B[ki];W[hh];B[gs];W[co];B[nj];W[nk];B[pp]
;W[mk];B[kh];W[jg];B[mi];W[ni];B[nh];W[oi];B[mh];W[oh];B[lg]
;W[ng];B[nl];W[ol];B[ab];W[il];B[jk];W[cb];B[je];W[if];B[nm]
;W[om];B[ie];W[ll];B[lk];W[nn];B[mm];W[mo];B[mp];W[ln];B[jn]
;W[lp];B[lq];W[kp];B[kq];W[lf];B[kf];W[mf];B[no];W[lm];B[ko]
;W[kn];B[jp];W[jm];B[lo];W[in];B[hk];W[jo];B[ge];W[fe];B[ob]
;W[kg];B[jf];W[lh];B[li];W[ig];B[hi];W[gh];B[ih];W[lg];B[mn]
;W[mm];B[gd];W[gi];B[gj];W[de];B[fh];W[ce];B[be];W[rs];B[pr]
;W[ao];B[bm];W[an];B[am];W[ap];B[dl];W[oa];B[ej];W[en];B[jl]
;W[im];B[ii];W[nf];B[ke];W[ga];B[ha];W[fa];B[jn];W[km];B[qs]
;W[es];B[fs];W[hf];B[sq];W[sp];B[ss];W[rn];B[sq];W[lc];B[mb]
;W[sr];B[jo];W[sq];B[mo];W[ac];B[ad];W[dd];B[rs];W[ba];B[ac]
;W[aa];B[af];W[pa];B[he];W[na];B[fd];W[kl];B[lj];W[tt];B[tt]
TB[ae][ag][ah][ai][aj][ak][al][bf][bg][bh][bi][bj][bk][bl][ch]
  [ci][cj][ck][cl][di][eh][ei][gr][hs][ia][ib][ic][id][ij][ip]
  [iq][ir][is][ja][jb][jc][jd][jj][jr][js][ka][kb][kd][kp][kr]
  [ks][la][lc][ld][lp][lr][ls][md][mq][mr][ms][nq][nr][ns][or]
  [os][ps]
TW[aq][ar][as][br][bs][ca][cp][cr][cs][da][db][do][dp][dr][ds]
  [ea][eb][ec][ee][ep][hg][ml][nj][nl][nm][og][oj][pc][pd][pe]
  [pf][ph][pi][pj][pk][pl][pm][qa][qb][qf][qh][qi][qj][qk][ql]
  [ra][rd][re][rf][rg][rh][rj][rk][rl][rm][sa][sb][sc][sd][se]
  [sf][sg][sh][si][sj][sk][sl][sm][sn][so]
)
6
  • An annoying bug, and good analysis in the answer. But this does not pertain to Go as a game, only to a specific implementation, and thus is not a core topic on this site. How about posting this on their issue tracker instead? It seems to be located at sourceforge.net/p/qgo/bugs
    – mafu
    Commented Feb 25, 2018 at 7:14
  • @mafu: I wondered whether it was on-topic, but was unsure; it seemed to me that it could be useful for anyone wanting to play Go. The site tour did not clear it up for me. I see this as a practical question about coping with unreliable equipment, like “How can I deal with the tendency of my much used Flingle set to reveal the Bloppers?”. The reason given (computer-based games) does not seem to hold up, because it goes on to say “except for computer-based versions of board or card games”. I suppose I ought indeed to report it, though I also thought it could not be too hard for me to fix.
    – PJTraill
    Commented Feb 26, 2018 at 12:31
  • It is definitely useful research you did. It felt too technically advanced to me (and others, it seems) even for a "computer-based version of a board game", more like what I would expect from SO. But the question can be reopened if most people like the question - I have no strong opinion on this issue.
    – mafu
    Commented Feb 27, 2018 at 9:12
  • @PJTraill Though the question is related to Go, the issue itself is just about a specific bug in a specific program. If you look at the other computers tagged questions you can see that they are usually pretty general. That said, this is a good question and a good answer. If you would like to propose a change to what is on and off topic you are welcome to make a meta post.
    – Malco
    Commented Feb 27, 2018 at 14:59
  • @Malco: At the moment I do feel that questions about the practicalities of using computers where they are really just another bit of equipment one wants to get the best out of in order to play the game one enjoys should be on topic, so I hope to find time to formulate this in a metaquestion.
    – PJTraill
    Commented Mar 1, 2018 at 0:00

1 Answer 1

3

Summary

The specification shows that the file is wrongly saved and can be corrected by adding the AB property. The game seems to be saved by qGo.

Details

How to do it correctly

We can find the specification from Sensei’s Library SGF, which refers us to [SGF on Red Bean]http://www.red-bean.com/sgf/; there the specific properties for Go link to https://www.red-bean.com/sgf/go.html. There we see:

Property:   HA
Propvalue:  number
Propertytype:   game-info
Function:   Defines the number of handicap stones (>=2).
        If there is a handicap, the position should be set up with
        AB within the same node.
        HA itself doesn't add any stones to the board, nor does
        it imply any particular way of placing the handicap stones.
Related:    KM, RE, RU

So we conclude that the standard does specify how to set up handicap stones and that qGo (or GNU Go) does it wrong. Moreover, adding the AB property by hand is correct, as it yields the file as it should have been saved.

For n conventionally placed handicap stones, copy the line above n up to and including the “]” above the n from:

AB[dp][pd][dd][pp][jj]
         2   3   4   5
AB[dp][pd][dd][pp][dj][pj][jj]
                         6   7
AB[dp][pd][dd][pp][dj][pj][jd][jp][jj]
                                 8   9

Which code is in error

We can start GNU Go with a command-line interface with gnugo -level 20 (for example, and see in the help text that save file saves the game. Testing this, I see that the saved game (with two moves) includes the AB property:

(;GM[1]FF[4]
SZ[19]
GN[GNU Go 3.9.1 Random Seed 1519478141 level 20]
DT[2018-02-24]
KM[0.0]HA[2]RU[Japanese]AP[GNU Go:3.9.1]AB[pd][dp]
;W[pp];B[dd])

I conclude that qGo implements its own save function and does it wrong; perhaps it implements this in order to include the player names (PW & PB), territory (TW & TB) and something called style (ST[1]) which is described at https://www.red-bean.com/sgf/properties.html#ST:

Property:   ST
Propvalue:  number (range: 0-3)
Propertytype:   root
Function:   Defines how variations should be shown (this is needed to
        synchronize the comments with the variations). If ST is omitted
        viewers should offer the possibility to change the mode online.
        Basically most programs show variations in two ways:
        as markup on the board (if the variation contains a move)
        and/or as a list (in a separate window).
        The style number consists two options.
        1) show variations of successor node (children) (value: 0)
           show variations of current node   (siblings) (value: 1)
           affects markup & list
        2) do board markup         (value: 0)
           no (auto-) board markup (value: 2)
           affects markup only.
           Using no board markup could be used in problem collections
           or if variations are marked by subsequent properties.
           Viewers should take care, that the automatic variation
           board markup DOESN'T overwrite any markup of other
           properties.
        The  final number is calculated by adding the values of each
        option. Example: 3 = no board markup/variations of current node
                 1 = board markup/variations of current node
        Default value: 0
Related:    C, FF, GM, SZ, AP, CA

Not the answer you're looking for? Browse other questions tagged .