The best kittens, technology, and video games blog in the world.

Sunday, August 23, 2009

Get better at go with gnugo

Go cat by Caramdir from flickr (CC-NC)
Usually I write about things that work quite well - who wants to learn about stuff that doesn't? Or about spectacular failures. Near misses - things that almost work but not really - are a rare subject. This post is about one of such near misses.

I'm sometimes casually playing go at KGS. My account is at 10k now, not too impressive, but then I don't play that much. That's just what my personality is like - I don't do that many things with any regularity, I start something, get really into it, and then a few weeks later my enthusiasm wanes. Not always, but it's quite typical.

So of course I would like to get better at go, without too much effort if possible. I know what's your first thought, but it's not about not losing. You know what's the biggest problem with multiplayer games? For every winner there's a loser, and 50% of people must lose, and the winners tend to be asshats without life who spend all night playing the game, making it impossible for casual players to get anywhere - sure, a casual player like me could slowly learn how to play in multiplayer mode, but losing to asshats a few times too many tends to be too discouraging.

So go is not like that. Everyone has rank assigned, and when people with different ranks are playing the weaker player gets big head start. If you win too much, your rank increases. If you lose too much, your rank decreases. So typically everyone wins half of the time, and loses half of the time - unusually convenient situation for casual players. My rate of wins and loses is pretty much independent of how good I am.

If that's the case, why am I interested in getting better? Mostly because I really hate losing due to spectacularly bad moves. Sure, there are legitimate ways of losing the game - playing too slowly and not getting enough territory, losing a big fight, the normal cases. What is not cool is losing the game by moral equivalent of putting yourself in atari, like this 9dan pro did:



How can one get better at go? First one can play a lot. That definitely helps, but there are quite a few permanoobs - players with way too many games that never progress much. And just by playing and not doing anything else it would take ages to get better.

The second way is doing go problems. They let you get better at fighting and endgame, maybe teach you some common joseki - all very useful things, but they won't teach you any big concepts, or improve your grand strategy. I've seen quite a few players who could win every fight with me, and then lose 20 points by playing some completely useless move, many times during one games.

The third thing is serious studying, like watching games of pros and good amateurs, reading Sensei's Library and books etc. I tried that, but I don't really see what's going on in pro games, and Sensei's Library is mostly targeted at dan players, so it's of limited use to me. And of course it takes a lot of time.

The fourth way, and one that I really like, is reviewing your games. You can review alone or with your fellow player - especially useful in handicap games where White can teach Black something, no matter who won. Or you can send your game to The Go Teaching Ladder, to get a review by a stronger player. Unfortunately that takes ages, and you cannot review every single game this way.

So I thought - bots aren't that horrible at go, some are near shodan level, why not use bots to do a quick review? Now certainly, it won't be as good as a human review, but it's really quick, and hopefully would be of some value.

Gnugo already has some analysis mode - it can take sgf and annotate each step with its idea of what possible moves for Black and White there are and how good they are.

Because its interface is quite inconvenient, I wrote this tiny Ruby script, so I can say annotate_sgf foo.sgf to get annotated-foo.sgf:

level = 15
ARGV.each{|sgf|
annotated_sgf = File.dirname(sgf) + "/" + "annotated-" + File.basename(sgf)
system 'gnugo', '--level', "#{level}", '--output-flags', 'dv',
'--replay', 'both', '-l', sgf, '-o', annotated_sgf
}


And here the problems start. First, while top bots are around shodan level, gnugo is not. It's more like 8k, not horrible (I wouldn't mind a review by an 8k player), but not impressive either. Especially for weak double kyu players it might be pretty attractive.

What gnugo is pretty decent about is noticing groups that were unsettled but both players forgot about them.



Here both players ignore T16, which is obviously vital point for White group if you look at it. I haven't bothered thinking if S6 is another such point, but if gnugo think so, that's at least reason enough to check.



Here's another example - players didn't notice that Black had a ko to mess with White. Gnugo is pretty decent at endgames, and it's surprising how often double digit kyu, and weaker single digit kyu players make such big mistakes.



Gnugo can also point at players making moves that are too small. N1 is a valid move in endgame, where nothing else interesting is going on. At this point it's just small gote reduction. This is extremely common among weak players - territory is real, and influence is vague, so they're willing to fight for scraps of territory instead of grabbing major influence over the board.



Gnugo can also help you stop making unusual fuseki and joseki moves. Unfortunately it's mostly just applying its joseki dictionary without thinking much, so you must think some more if the move is really bad, or gnugo just doesn't like it. Unlike with endgame and semeai, it's hard for you to verify if gnugo is right.

So why don't I like gnugo in spite of all this? Well, I don't really think I'm learning much from it. It doesn't tell me why a move is good or bad, it doesn't create variations showing what are the consequences of different moves (even though it obviously tries them internally). It might tell you which move lost you the fight if you're really curious, but it's difficult to generalize this to new games.

Basically, I don't think I got much better thanks to gnugo. But try it if you want.

9 comments:

Malaclypse said...

What bots do you know of that are near Shodan level? I've seen them cap out at around 8-10 kyu. Unless you're talking about a full 9-stone handicap?

taw said...

Ascendant: That was true before Monte Carlo methods (gnugo is still pre-MC). The new generation of MC-based go bots is around amateur shodan level.

http://senseis.xmp.net/?Zen KGS 2d
http://senseis.xmp.net/?Fuego KGS 2k

More information: http://senseis.xmp.net/?ComputerOlympiad

ChessMasterFlex said...

Or you could play chess, which is by far the superior game.

taw said...

ChessMasterFlex: Chess sucks as it doesn't have a handicap system like go. So I would lose to asshats all the time.

Elias said...

Hi! interesting article! I find studying go proverbs an easy way to improve. Maybe you'll like it too.

Anonymous said...

I'm learning Go, but for Chess you can have a piece advantage at the beginning or play something like Fisher random chess.

taw said...

Anonymous: As far as I can tell almost nobody plays chess online with rank difference being translated into piece advantage, the way everyone plays go.

Blindbraille said...

Only problem I have with your article; you listed taking to long as a way of loosing. There is no such thing as to long a go game.

Anonymous said...

Blindbraille: Did you mean where the article mentions losing by "playing too slowly and not getting enough territory"? I think by "slowly" it meant rate of development on the board, rather than clock time.