Hello! I’m making a digital version of “Dots” — it’s a paper game that’s popular in the CIS and Poland. When I was in school, I played quite a few games of it. I’m writing it in Godot, and the main feature is the opponent — a neural network that I trained from scratch.
I’ll warn you right away: “Dots” is not the same as Dots and Boxes. Although the names are similar, this is a completely different game. The closest relative of “Dots” is Go. “Dots” is played by two people on a grid sheet. Players take turns placing dots of their own color at the intersections of the cells and try to surround the opponent’s dots. Anything that ends up inside a closed chain of your dots, spaced one cell apart (diagonals also count), is considered surrounded. You can learn the rules in two minutes, but learning to play well is not that easy. Each player weaves their own network of dots, and the game turns into a race of traps that the opponents set for each other.
Why can’t a strong opponent be programmed
I’ve long wanted to have a strong AI opponent for “Dots”. At first, it seemed that it would be possible to program an algorithm similar to the one used in chess: iterating through moves plus evaluating the position. It turned out that it wasn’t possible, and the reason was the scale. The chessboard has 64 squares, and in an average position there are about 35 possible moves. To calculate a chain of 4 moves, you need to iterate through approximately 1.5 million options — a feasible task for a computer. The classic “Dots” board is 39×32, i.e., 1,248 cells, and a move can be almost any empty cell. The same 4 moves already yield about 2 trillion options — a million times more. Moreover, a chess position is easy to evaluate based on a simple criterion: who has the stronger pieces left. “Dots” has no such criterion.
How the neural network learned
Since it’s impossible to program the evaluation of a position, let’s try to train a neural network. I took the approach of AlphaZero — a program that was taught to play Go — as a basis. The idea is this: the neural network plays thousands of games against itself and then learns from this data. A new generation of the network enters the “arena” — it plays a series of games against the previous one. If the newcomer wins more often than it loses, it takes the place of the previous one and generates games for the next generation. Currently, the 20th generation is in the game, and while I’m writing this post, an arena is going on against the 21st. I’m training the network on PyTorch using my home graphics card, an RTX 5070 Ti — one generation takes approximately 15 hours.
How it works in Godot
The game itself is written in Godot 4.7 + C#/.NET 10. The rules and game logic are pure C# without external dependencies. The neural network is trained in Python and run in C#. To do this, it is exported to ONNX — a universal format for neural networks. In the game, the model runs on the player’s GPU: DirectML on Windows, CoreML on macOS, CUDA on Linux. A special bonus: the network is convolutional — it doesn’t look at the entire field; it moves a small window across it, like a blur filter over an image in a shader. Therefore, the size of the field doesn’t matter to it: the same model plays both on a 9×9 field and on a classic 39×32 field — the size is chosen before the match. If you have questions about training the network or about integrating ONNX into Godot, ask in the thread, and I’ll share the details.
What’s ready now
The game against the AI is ready, there’s a two‑player mode on one computer, saving and viewing games, two difficulty levels, and the option to choose the board size and starting arrangement. On a 15×15 board, the “Harder” level consistently beats me. On the classic 39×32 board, the network responds in less than a second, but it’s still doesn’t play well: the training hasn’t reached this size yet — I’m gradually expanding the board sizes.
Right now, I’m preparing the game for release on Steam (only Windows for now): Just Dots on Steam. If you like the game, add it to your wishlist. This will be very helpful to me: the more people have it on their wishlist, the higher the game will rank in the Steam ratings, and the more people will see it. I’m planning to release the game in December, but if you’re interested in battling the AI, I can give you access to the beta version — message me privately.

