Making my own simple bot: Euroton


Probably not! Randomising the starting point is a very good idea that I’ll get into. The issue with my preset openings and bots determinism is, indeed, that the 4 games it plays are very similar, eventually point branching off due to adjusted weights.

I had to think about this one because you are right in that observation, yet on the other hand most weights are pretty continuous in playstyle. So I think I misrespresented the results. Getting 8 wins is not nearly as common as getting 0 wins. However, when the annealer adjusts weights to an extreme point where I wouldn’t call it good Go, then it sometimes flukes (overfits) to an 8 wins, after a set of 0, 1 or 2 win streak with very similar weights.

The main rule that shows non-continous playstyle is “Influence Delta Rule”. This scores each point on how much it flips the total influence on the board the most. Below is an example, ignore the unusual board situation, I was testing vital points.

Influence Delta’s highest scoring move for white is the +061 point (G6). Playing there flips the top right boardpositions, as the white stone is not only closer to them, but it also “blocks” the influence of black stones.

Generally this rule finds places to tenuki to, but crank the weight of this rule up and you get a bot that only plays in opponent controlled spaces. And just sometimes, that leads to 8 wins, though usually it loses every loose stone. TL;DR: It was overfitting and getting lucky.

I think that on 19x19 annealling will be more accurate and less prone to overfitting due to the many more moves it has to do per game, as well as taking on hoctaphs suggestion about random beginning positions.

1 Like

Oroton is now active on main OGS :partying_face:

It currently plays on 9x9 and Live. Rapid and maybe Blitz follow if it’s proven fast enough.

The larger boardsizes follow after more tuning.

6 Likes

Will it be possible to add 5x5 support?

No problem, 5x5, 6x6, 7x7 and 8x8 are now playable.

It seems to play alright, but nothing is specifically tweaked for this size, so let me know if it’s usable.

4 Likes

Thanks!

1 Like

The bot has played about 100 games in the past days. A few issues popped up but nothing major. Therefore, Oroton now plays all board-sizes (min: 5x5, max: 19x19) on all time-settings except blitz.

In its handful of ranked games, it landed at 22k. Judging from the unranked games, its strength on 9×9 seems to be more around 25k-35k. I’m happy with this, it seems to be in a challenging sweet spot for beginners.

There are now two “weights/tunings” active:

  • one set for 19x19, used on boards 13x13 and up,
  • one set for 9x9, on boards 12x12 and below.

The difference is in nuances, such as how heavily playing in the corners is rewarded.
I’ve never played 13x13 (let alone 14x14) so I have no idea if it’s any good at that.

@Clossius1, this has changed 5x5 play, as that used 19x19 weights before, now it uses the 9x9 weights. If this is not an improvement, let me know and I’ll revert it.

Looking at the game-play I saw some issues:

  • In two games, players didn’t realize that the bot won’t pass unless they pass first, or unless it has no legal moves left. They kept filled the board to their last eye and therefore ended up losing completely.
    While this is understandably confusing for them, it is educational: knowing when a game is actually over is a fundamental Go skill.
    That said, this simple approach also makes the bot accept passes too early, when territory isn’t closed off. I’ll try to improve this by adding logic like: if GnuGo (or another trusted engine) would pass AND the user passes, then the bot should pass; otherwise, keep playing.
  • The bot can’t undo. It’s nice to add this.
  • Handicap handling was completely broken so I disabled it. However, this is now fixed. In fact, going a bit overboard, I added a fixed handicap pattern for up to 36 stones (the OGS maximum). Theoretically this brings the 35k bot to just about dan-level.. :stuck_out_tongue:

The first 9 stones follow the standard pattern, the rest you can see here:

Handicap patterns up to 36 stones

then stones 10 to 17 fill up an inner ring,

19 . . . . . . . . . . . . . . . . . . .
18 . . . . . . . . . . . . . . . . . . .
17 . . . . . . . . . . . . . . . . . . .
16 . . . X . . . . . X . . . . . X . . .
15 . . . . . . . . . . . . . . . . . . .
14 . . . . . . . . . . . . . . . . . . .
13 . . . . . . X . . X . . X . . . . . .
12 . . . . . . . . . . . . . . . . . . .
11 . . . . . . . . . . . . . . . . . . .
10 . . . X . . X . . X . . X . . X . . .
 9 . . . . . . . . . . . . . . . . . . .
 8 . . . . . . . . . . . . . . . . . . .
 7 . . . . . . X . . X . . X . . . . . .
 6 . . . . . . . . . . . . . . . . . . .
 5 . . . . . . . . . . . . . . . . . . .
 4 . . . X . . . . . X . . . . . X . . .
 3 . . . . . . . . . . . . . . . . . . .
 2 . . . . . . . . . . . . . . . . . . .
 1 . . . . . . . . . . . . . . . . . . .
   A B C D E F G H J K L M N O P Q R S T

stones 18 to 25 fill in the outer ring…

19 . . . . . . . . . . . . . . . . . . .
18 . . . . . . . . . . . . . . . . . . .
17 . . . . . . . . . . . . . . . . . . .
16 . . . X . . X . . X . . X . . X . . .
15 . . . . . . . . . . . . . . . . . . .
14 . . . . . . . . . . . . . . . . . . .
13 . . . X . . X . . X . . X . . X . . .
12 . . . . . . . . . . . . . . . . . . .
11 . . . . . . . . . . . . . . . . . . .
10 . . . X . . X . . X . . X . . X . . .
 9 . . . . . . . . . . . . . . . . . . .
 8 . . . . . . . . . . . . . . . . . . .
 7 . . . X . . X . . X . . X . . X . . .
 6 . . . . . . . . . . . . . . . . . . .
 5 . . . . . . . . . . . . . . . . . . .
 4 . . . X . . X . . X . . X . . X . . .
 3 . . . . . . . . . . . . . . . . . . .
 2 . . . . . . . . . . . . . . . . . . .
 1 . . . . . . . . . . . . . . . . . . .
   A B C D E F G H J K L M N O P Q R S T

then add stones to the 3rd line:

19 . . . . . . . . . . . . . . . . . . .
18 . . . . . . . . . . . . . . . . . . .
17 . . X . . . . . . . . . . . . . X . .
16 . . . X . . X . . X . . X . . X . . .
15 . . . . . . . . . . . . . . . . . . .
14 . . . . . . . . . . . . . . . . . . .
13 . . . X . . X . . X . . X . . X . . .
12 . . . . . . . . . . . . . . . . . . .
11 . . . . . . . . . . . . . . . . . . .
10 . . . X . . X . . X . . X . . X . . .
 9 . . . . . . . . . . . . . . . . . . .
 8 . . . . . . . . . . . . . . . . . . .
 7 . . . X . . X . . X . . X . . X . . .
 6 . . . . . . . . . . . . . . . . . . .
 5 . . . . . . . . . . . . . . . . . . .
 4 . . . X . . X . . X . . X . . X . . .
 3 . . X . . . . . . . . . . . . . X . .
 2 . . . . . . . . . . . . . . . . . . .
 1 . . . . . . . . . . . . . . . . . . .
   A B C D E F G H J K L M N O P Q R S T

at the OGS max of 36 you get:

19 . . . . . . . . . . . . . . . . . . .
18 . . . . . . . . . . . . . . . . . . .
17 . . X . . . . . . X . . . . . . X . .
16 . . . X . . X . . X . . X . . X . . .
15 . . . . . . . . . . . . . . . . . . .
14 . . X . . . . . . . . . . . . . X . .
13 . . . X . . X . . X . . X . . X . . .
12 . . . . . . . . . . . . . . . . . . .
11 . . . . . . . . . . . . . . . . . . .
10 . . X X . . X . . X . . X . . X X . .
 9 . . . . . . . . . . . . . . . . . . .
 8 . . . . . . . . . . . . . . . . . . .
 7 . . . X . . X . . X . . X . . X . . .
 6 . . X . . . . . . . . . . . . . . . .
 5 . . . . . . . . . . . . . . . . . . .
 4 . . . X . . X . . X . . X . . X . . .
 3 . . X . . . . . . X . . . . . . X . .
 2 . . . . . . . . . . . . . . . . . . .
 1 . . . . . . . . . . . . . . . . . . .
   A B C D E F G H J K L M N O P Q R S T

Sidenote: @anoek, @greenasjade, OGS allows you to set the handicap to 25, or even 36, on a 5x5 board. This currently trips/hangs/loops the bots I’ve tried, and probably also humans :upside_down_face:

4 Likes

I think it might still be disabled

Can you give an example? It works over here:

Are you aware that all bot games are forced to Chinese rules, and that if you play black, you must freely place all your stones before the game starts?

Bot is greyed out when a handicap is selected (whether set to automatic, or some other value):

But when set to “None” it becomes available:

I also am not able to select 5x5 games, although I see other people have previously played such games against it.

1 Like

Thanks for the screenshots. I have no idea what’s up. I only have one interface to OGS (gtp2ogs), and if I allow 5x5, 19x19, handicaps, etc., in there (which it does, as the bot shows), then that’s all I can do, I think. I did restart the bot, but no change.
For now you can directly challenge the bot by clicking on its name.

Maybe the OGS front-end needs to update, although the bot has been accepting 5x5 for a couple of days now. My best guess is I have a typo in the gtp2ogs config file that allows the bot to play but trips up the front end. I tried some things but I’ll continue tomorrow.

3 Likes

After hours of trying things, it is “fixed”. The bot shows up as available in 9x9, 13x13 and 19x19 with handicaps available, in Rapid and Live. Although unadvertised, it can also still play 5x5.

I tried every combination of:

  • beta vs prod
  • gtp2ogs 8.0.4 vs 9.01
  • configs: rich json5, rich strict-json and bare-bones json-strict.

None of the combinations yield a 100% match of what is advertised in the “Pick your computer opponent” screen, and what is actually accepted when the bot is challenged.

I am 99% certain there are issues in how the “Pick your computer opponent” view works in production, that cannot be fixed by me. For example, currently:

  • It incorrectly shows up as accepting rapid, which it will then correctly block upon game start.

  • It incorrectly shows that there are no bots capable of playing 5x5. However, if you select Oroton when board size is 9x9, then change the board_size to 5x5, you get:


    then you can still press Play, and you do get a 5x5 game.

  • I can’t make it accept correspondence games without breaking the availability in “Pick your computer opponent”. It will then fall back to the default of showing it only available for “only 9x9, live, no handicap”, despite in actuality accepting all current settings and correspondence.

The combination I have now used on prod is gtp2ogs 8.0.4. with a barebones config file, letting most of the things be OGS defaults. I’ll do more testing, and if the issue is indeed not on my side of the screen, then I’ll work this out into a detailed bugreport, which I’ll hopefully get to tomorrow.

4 Likes

FWIW I’m sending it challenges on Tsumego Dragon using api to play the 5x5 and it works no problem for me.

1 Like

I’ve seen this kind of thing happen with a lot of bots. I remember trying to play some bots a while ago and having most of the games rejected, even though the game settings appeared to be acceptable to the bots. I searched the forums for the issue and most people seemed to think it was because the bots were poorly configured. I was surprised that so many bots were not configured correctly, but given what you’ve said here it makes a lot more sense that this is an issue with the sites rather than, or in addition to, poorly configured bots.

2 Likes

Issue filed: Pick your computer opponent screen (PYCO-UI) ignores Config on Beta and Production · Issue #3324 · online-go/online-go.com · GitHub

To summarise: I retraced my steps, starting out from the most vanilla-est setup, and then trying all sorts of combination of things. Always restarting the bot, always ctrl+F5-ing the browser. The result is that I cannot find a way to make the Pick your computer opponent screen (PYCO-UI) follow my config. Direct challenges on the other hand always follow the config, despite all the variables. So I still suspect the issue in the OGS code and not gtp2ogs or my setup.

It will always show either one of two sets of capabilities:

  • the default set of 19x19, 13x13, 9x9, all handicaps, all timesettings except correspondence.
  • a restricted default set of 9x9, Live, no handicaps, and the rest greyed out “bot can’t play …”

The swap from the default set to the restricted set happened at random; I triggered it with a known “bad” config, however restoring my known-good config did not restore the UI. So right now it is stuck in 9x9, Live, No handicaps.

Beta is similar in that it doesn’t follow the config, but:

  • The default set is slightly different, and
  • The restricted set hasn’t triggered there (but I can’t be sure it won’t of course)

I did look at the OGS code but I don’t really know where to begin. If I find time I’ll try if I can join the fixing effort.

On the plus side: there is no reason to nerf the bots capabilities, so it’s playing anything and everything again, even if it’s not always advertised as such. :slight_smile:

4 Likes

So I found a bug or I have a feature request. When you pass the bot always passes. Can it have a minimum number of moves per board size before it passes? Maybe Size*2?

1 Like

After almost a week, it looks like people have found the bot. It now plays roughly 300–400 games a day, with a peak of 513 games on Saturday.

Whether players like the bot or find it more human is hard to say, I haven’t received feedback, but several regulars return daily to try beating it, which is a good sign.

The bot currently sits around 30–37k, though that rank isn’t very meaningful. Most people play it unranked first and only try a ranked game once they feel confident. A more telling metric is the winrate: about 70%. Strong enough to be interesting while leaving room for a weaker companion bot…


A second bot, Tiger, is now live. :slight_smile: Tiger runs on the same engine as Oroton but is tuned for contact-play and aggression. Two rules are removed:

  • OpenArea (play in open spaces)
  • InfluenceDelta (play where influence is largest)

With these gone, Tiger has no sense of “big” moves. It only sees “urgent.”
What remains:

  • liberty rules (increase yours, reduce theirs)
  • connection and cutting
  • eye-making
  • anti-blunder rules (ladders, sealing territory)

The result is a fighting-heavy style. It loves capturing groups, so while it is overwhelming at first, beginners who learn to tenuki will be able to beat it, especially on larger boards. In my testing it’s stronger than Oroton on 5×5, roughly even on 9×9, and weaker as the board grows.

Despite its flaws (same unnecessary eye-making as Oroton), it’s fun to play. Give it a handicap and try out-fighting it.

Early statistics, after one day, show a winrate around 60%.


Great suggestion, I added size*2 boardmoves as a requirement for passing to both bots.

Passing when the player passes is a design choice, so that players learn how/when to pass, without a bot always taking care of it. But letting incomplete games go to scoring is an unintended consequence. I have fixing that on my to-do list, but this is already a nice patch.

9 Likes

Making a weaker but natural bot
The two current bots are turning out to be similar in strength, and there are many players who have played them over 30 times without a single win. It’s therefore time to make a weaker bot. The goals:

  • Be fun.
  • Be understandable and consistent. Not alternating great play with blunders to even it out.
  • Be simple. No complex fights, and at the beginner level, every fight is complex, so rather avoid fighting altogether.
  • Be beatable.
  • and for me: Be little effort. :slight_smile:

To begin, let’s down or disable the rules that contribute to attacking moves. Those are:

  1. reduce opponent liberties
  2. cut opponent groups
  3. do a Monkey Jump / slide
  4. play Vital Points
  5. InfluenceDelta - play there where the influence swing is largest

At first I thought to just remove the first one. But without the incentive to reduce opponent liberties, the play becomes very contactless, which is unnatural. Example is playing F8 below (left).
At the same time, cuts still happen (right image, the playtester (my gf) plays black, bot is white), so it’ll start a complex fight nonetheless. Along multiple games my gf remarked she didn’t think this bot was any easier than the other ones, and definitely not the calm game she was promised.

So lets turn rule 1 back on, and disable 2. More natural contact-play was back, and cuts occur but not often. Monkey Jumps make the bot suprisingly sharp and intimidating, so that was disabled as well. After that we get a bot that’s pretty docile, playing a wall-builder type of game. My playtester remarked she had fun and didn’t feel pressured.

An example is below, the bot is white. There’s no cut in the game, just some calm area claiming.

>>

A bug occured..

However, at some point the bot played B9 instead of D9…This is a "stupid blunder"™. The “Seal Own Territory”-rule prefered this point over anything else, and it this bug had to be fixed.

Details of the issue and fix

The issue: The “Seal own territory” rule is basic to keep cpu cost down. It has some checks to detect a hole in a wall or near to it. Then from there it casts rays in all directions, and sums how much of “own territory” it sees. The more it sees, the bigger the area it seals off, and the more the move is rewarded. The rays stop when they meet the edge of the lake, which is either a neutral point or an opponent.
The problem here is how the rays are cast from D9:

  • to the left, it sees C9. C9 is still more or less a neutral point, as it is in white area, but black E9 casts influence on it as well. And therefore, D9 doesn’t ‘see’ the area on the left, the ray stops there.

  • to below, there are stones, they don’t count as territory.

  • to diagonally left down (in multiple angles), where they do see some territory, but much less than B9 and C9 stones hit more territory with their rays, and thus they are prefered.

The fix: the code is adjusted that IF there is a candidate territory-edge point (D9), then also check if neighbouring stones (B9 and C9) see a larger lake. Then take the largest of those. Basically: also ray-cast from a little side-stepped position.
This seems to work. B9, C9 and D9 see the same area, and D9 wins because it is closest to friendly stones (the wall).

This is computationally cheaper than floodfilling, which is more accurate at determining a territory size. And floodfilling can still fall into the same trap of neutral points counting as an edge.

Note: a different fix would to be to only consider holes in a wall, but this function also works to claim edges of a territory that are not almost completed walls.

Next steps

I can now say that this version of the bot is calm. But I can’t claim that it is easy. The issue I run into is that I can’t play as the intended audience. Humble brag, I know :grimacing:, but it’s hard to get into the mindset and skill of a true beginner.

And I won’t always bother my gf to playtest, nor is she representative of all other players. So I’ll tweak some more, and once I think this bot is docile and without stupid play, then I’ll deploy it. Based on how people react to it, I can tweak from there.

8 Likes

Maybe have a 5% chance to self atari when one is available :stuck_out_tongue:

Maybe prioritize attacking liberties from the lowest line (closest to the edge) first instead of the highest line.

1 Like

So great, so interesting. It seems really nothing so obvious to make an interesting bot for beginners. I hope you will reach something.

1 Like

Ohh it already feels painful to implement purposefully bad moves. :grinning_face_with_smiling_eyes: But those are good ideas, spoonfeed the player their captures.

Thank you :slight_smile: