TL:DR: Today I had a free day and I spent 14 hours on this bot. It has more and better algorithms and many bugfixes. As a result, it now loses harder than ever before.
As the Dutch saying goes: there’s no shine without friction.
Improved: Connectivity rule
Goal: Incentivise friendly connections that are cuttable by the opponent, by
- Incentive for the connection of two groups
- Add a bonus if one of the groups is low on liberties (‘save a weak group’).
- Add a bonus if one or two of the adjacent stones are from the opponent. Basically: Even an fool defends against a peep.
These additional considerations make it weigh more than saving a single stone, though of course this will not always be the correct choice. @shinuito A future step is indeed to make it reward connecting non-alive groups to alive groups.
>
Added: OpenArea rule @Jon_Ko
Goal: motivate playing in open space.
Each candidate move is checked on the emptyness of the surrounding rings. Rings with distance 1 (adjacent) and 2 (one-space-jumps and diagonals) must be completely empty/open. For the rings with distance/radius 3 and further, it measures the percentage emptyness. These values are summed to determine a value of “openness”, with inner rings (radius 3) counting more than the outer rings. The outmost ring checked is capped at radius 6. It works pretty good, and looks as expected.
The gameplay (white) is, if we are really flattering, a cosmic go opening.
But it lacks direction. So
Fixed: CornerBias rule to reward corners
Goal: Motivate corner and edge plays in the opening.
The distance from the board center is calculated, and the further points are awarded more. (Basically 4-4 > 10-4 > Tengen). It is capped at the 4-4 point, so playing deeper inside the corner (3-4, 2-2 etc) is not worth more than 4-4.
The rule stays active for the first 40 moves (the opening), and then abruptly goes to zero. The idea is to taper it off later, this is easier to tweak.
Fixed: LineRule rewards 3rd/4th line, lightly penalises 1st/2nd line
This is a layer on top of the CornerBias rule. This also abruptly ends at move 40.
These help steer the OpenSpace rule in the right direction, and against it’s older self it looks to do that:
Game: Old Euroton (B) vs New Euroton (W) (B won)
But now it will play 5 moves in one corner before moving on to the next. And black won this game.. So added some more rules:
Added: Liberty safety rule now also penalises moves that reduce liberties
>
Locality rule - made but seems not useful for now.
Goal: Either motivate or discourage local plays
Working: It can either reward or punish plays close to recent plays. The number of previous moves to consider is adjustable, and there is both a spatial decay (closer moves weigh more) and a time decay (recent moves weigh more). However, it doesn’t feel intelligent to always incentivise moving away or closer. Maybe it can serve as a tie-breaker when the other algorithms are more dialed in, for now it stays deactivated
Tweaked values to avoid “fake Ko-fights”
GnoGo and Eurobot are repeatedly playing back and forward captures (without consequences, so not really a Ko), which was very annoying. So I made the penalty on filling your own eye exactly as big as the reward to save a stone from Atari incentive, so they cancel out.
Fixes
So. much. bugfixing. Functions silently failing, different coordinate systems (0-based and 1-based used intertwiningly), 3 different play history databases, debug not actually showing what happens… I don’t know how* I accrued so much technical debt in such a short time.
(*It’s vibe coding).
Game 25: Using open spaces - GnuGo(B) - Euroton (W) - 350pt loss
After tuning the weights to account for the new rules, the bot played something that resembles a decent opening:
At this point the bot is already 50pts behind, but the main thing is that it took corners, sides, center in a somewhat natural looking way. However, it doesn’t have two crucial skills necessary to convert this to points:
- Defend territory. Euroton has no concept or incentive for territory. GnuGo does monkey jumps, and slides and just takes it all away.
- Connect over distances. All these groups look at least decent, but Euroton only responds to losing liberties and 1 space cut/connect options. It doesn’t realise it’s slowly getting its groups cut off and surrounded.
The new rules make it play too widely to rely on the “captures make eyespace”-tactic that worked well before, and thus, nothing lives:
But on the plus side, the current heuristics are still far from optimally tweaked. This is just the first version that looked alright, so I think it has enough room to improve. However, to really purposefully play the game, it has to learn how to claim and defend territory.