Abstract

Dotball Beat The Ball is easy to understand because each turn moves the ball through a visible field of dots. It becomes difficult because every move is also a graph decision: a player chooses an edge, changes the local geometry of the position, and creates future access or denial for both players. A small board can feel casual, but the underlying problem quickly becomes a search problem with combinatorial growth.

The current iOS design makes this more concrete: 9-by-7 arenas keep the field readable on mobile, Beat the Bot defaults to a stronger brutal mode, Game Center enables online play, and visual choice markers help first-time players understand where they can move next.

This paper describes why the game can become difficult, what kinds of algorithms can be used to produce strong or perfect play, and how changing board length and width creates different families of tactical possibilities. The goal is not only to make the bot stronger, but to understand how board design can make the game more fun, fair, accessible, and replayable.

The board as a graph

The cleanest way to model Dotball is as a graph. Each dot is a node. Each legal move between nearby dots is an edge. The ball's current location is the active node. A turn selects one legal edge from the current node to a next node. Goal lines or goal regions are terminal areas where scoring can occur.

If an edge can be used only once, the game becomes a dynamic graph where every move removes or marks an edge. If dots can become blocked, occupied, or directionally constrained, the state must also track those restrictions. The full state is therefore more than the ball position. It includes the board dimensions, the used edges, any blocked nodes, the score, the player to move, penalty-kick spots, Game Center side assignment, and match rules such as first-to-3.

This matters because two positions that place the ball on the same dot may not be equivalent. The surrounding path history can completely change whether the next player has a winning route, a trap, or no meaningful attack.

Why the game becomes difficult

The difficulty comes from branching. If the ball has several legal moves at each turn, the number of possible future lines grows quickly. A position with six plausible moves per turn has 6 to the power of 10 possible ten-move lines before pruning. Many of those lines are bad, illegal later, or strategically redundant, but the raw tree becomes large fast.

The game also has delayed consequences. A move that looks defensive may open a scoring lane three turns later. A move that looks aggressive may trap the player by giving the opponent a forced sequence. This makes Dotball more interesting than a simple race to the goal, because the best move is often the one that improves future geometry rather than the one that moves closest to scoring immediately.

Difficulty also depends on the scoring rule. Automatic scoring when the ball reaches the opponent's goal makes threats clearer and faster. It reduces the need for a separate shoot action, but it increases the importance of preventing forced arrival routes. In other words, the strategic question shifts from can I shoot now to can I force the ball into a scoring node before the opponent can redirect it.

The latest move-choice design also changes perceived difficulty. Replacing ambiguous colored dots with pulsing choice rings makes legal moves easier to read. That does not reduce the mathematical complexity, but it reduces cognitive friction, which is important for a game where the strategy should be hard but the interface should not be.

Perfect play as a search problem

A perfect-play algorithm tries to answer one question for every position: with best play from both sides, is this state winning, drawing, or losing, and which move gives the best outcome. For very small boards, this can be solved by exhaustive search or retrograde analysis. The algorithm enumerates all reachable states, labels terminal scoring states, and works backward to classify earlier states.

For realistic mobile boards, exhaustive search may be too expensive. The engine should then use minimax: the bot assumes it chooses moves that maximize its result while the opponent chooses moves that minimize it. Alpha-beta pruning can remove branches that cannot change the decision, making the search much faster without changing the final answer at a fixed depth.

A practical scoring function can evaluate non-terminal positions by combining distance to the opponent goal, number of available routes, defensive coverage, trap risk, center control, forced-move opportunities, and whether the opponent has an immediate scoring threat. This lets the bot search several turns ahead and still make a decision before the player feels a delay.

A production mobile bot should also use rule-aware terminal detection. If a move creates an immediate goal, it should be evaluated before positional heuristics. If a player has no legal move, the evaluator should test whether a penalty kick is available. If the marked PK spot is also blocked, the awarded player receives the goal automatically. If the center has no unused exit and no scoring or PK continuation exists, the round can end because the graph is locked.

Candidate algorithms

The simplest strong algorithm is heuristic minimax with alpha-beta pruning. It searches possible move sequences to a fixed depth and scores the leaf positions. It is predictable, tunable, and good for difficulty levels. Easy mode can search shallowly with a noisy evaluation. Clever mode can search deeper. Brutal mode can search deepest, check immediate tactics first, and use better ordering to prune faster.

A practical brutal mode should use a priority stack before ordinary search: first take a guaranteed goal, then prevent an opponent goal, then prefer moves that force a penalty kick, then prefer moves that reduce the opponent to one or zero exits, and only then optimize ordinary territory. This makes the bot feel intentional because it wins through visible pressure rather than random-looking movement.

Monte Carlo tree search is a second path. Instead of evaluating every branch evenly, it simulates many possible continuations and spends more time on promising moves. This can work well when the board becomes large or when the heuristic is hard to write perfectly. It can also make the AI feel more human because it discovers practical threats through rollouts.

Reinforcement learning is a third path. A model can play many games against itself and learn which board states lead to wins. This is attractive for future versions, but it needs careful training, evaluation, and guardrails. For an early App Store game, a tuned minimax engine is more explainable and easier to ship reliably. A hybrid approach may be best: minimax for tactics, Monte Carlo or learned evaluation for strategic judgment on larger boards.

Penalty kicks, center locks, and edge cases

The penalty-kick rule is important because it gives no-move positions a tactical consequence instead of treating them as dead ends. If a player blocks the opponent so completely that the opponent cannot move, the opponent does not simply lose the turn. The blocking player earns a marked PK opportunity, and that PK becomes part of the search tree.

If the awarded PK spot is full or has no legal continuation, the cleanest rule is to count an automatic goal for the awarded player. This avoids ambiguous ties and rewards the player who created the pressure. It also gives the bot a concrete objective: force no-move states that convert into PKs or automatic goals.

Center lock is different. If the center has no unused exit, the game should not stop while the ball is still in a live attack or while a PK or goal can still happen. The round should end only when there is no legal ball move and no remaining scoring or PK resolution. This distinction keeps the rules fair and avoids ending a point before the visible strategy has resolved.

Toward the highest score

If the match is first-to-3, the highest score in a single match is bounded by the rules. The optimization problem is therefore not infinite scoring, but maximizing expected scoring advantage: win as quickly as possible, allow as few opponent goals as possible, and avoid risky lines that turn a likely 3-0 into a 3-2.

The algorithm should treat a goal as a terminal reward and score differential as part of the match state. A move that wins the current point is usually best, but if no immediate goal is available, the best move is the one that maximizes expected future goals while minimizing opponent arrival routes. In tournament or ranking modes, the objective can expand to expected win rate, average goal differential, shortest win length, or resilience against different player styles.

A perfect solver for a fixed board could produce an opening book: for common early positions, the bot already knows the best move without searching. This would make high-difficulty play feel crisp while preserving battery life and responsiveness on mobile.

What changes when length changes

Increasing the board length makes the game more about tempo and long-term route control. The ball has farther to travel before scoring, so a single move rarely decides the point. Players can recover from small mistakes, and the bot needs stronger planning to choose between advancing, redirecting, and building future pressure. The current 9-by-7 arena family is a practical mobile compromise: long enough for route planning, but short enough that a point still resolves quickly.

Shorter boards make the game sharper. The distance to goal is small, so immediate threats are more common and mistakes are punished quickly. This can be exciting for casual play, but if the board is too short, first-player advantage or forced scoring lines may dominate. Short boards need careful balancing, such as symmetric starting positions, restricted opening moves, or wider lateral space.

A longer board also expands the search horizon. If the goal is many moves away, a shallow bot may undervalue moves that create future attacks. This makes board length directly connected to AI difficulty: longer boards require better evaluation, not only deeper brute-force search.

What changes when width changes

Increasing width creates more lateral choices. This usually increases creativity because players can route around blocks, set traps on one side, or switch fields. Wide boards support more strategic variety, but they also increase the branching factor, which makes perfect play harder to compute. On mobile, width also has a user-interface cost: too many columns can make touch targets smaller and legal choices harder to see.

Narrow boards create forced races. There are fewer escape routes, so blocking and direct pressure matter more. This can produce fast, tense games, but it may reduce replayability if too many positions collapse into the same forced paths. A narrow board works best when the game wants speed, pressure, and easy readability.

Width also affects fairness. If one lane becomes obviously dominant, a bot or experienced player may repeatedly force that route. Good board design should make multiple lanes viable, with some routes faster but riskier and others slower but safer.

The combined possibility space

Changing length and width together creates different game families. A short and narrow board is tactical and fast. A short and wide board becomes a quick puzzle with many lateral tricks. A long and narrow board becomes a pressure corridor. A long and wide board becomes a strategic territory game where route planning matters most.

From a complexity perspective, the number of nodes grows roughly with length times width, while the number of potential edges grows with the movement rules around each node. Because each turn changes which edges or nodes remain useful, the reachable state space grows much faster than the visible board size suggests.

This means a small adjustment in dimensions can have a large effect. Adding one column may create several new legal paths from many rows. Adding one row may lengthen every scoring race. The best way to tune the game is to measure not only board size, but average legal moves per turn, average point length, first-player win rate, comeback rate, and how often games end by forced routes versus creative decisions.

Recommendations for making Dotball more fun

The game should keep multiple arena identities while controlling the board dimensions carefully. Different city themes can change the feel of the match without making the rules harder to learn. Each arena should be tested for first-player advantage, average point length, comeback rate, and how often goals come from route skill versus accidental traps.

Beat the Bot becomes more interesting when difficulty changes behavior, not only search depth. Easy should make understandable mistakes. Clever should block obvious threats and set short traps. Brutal should search deeper, defend first, hunt PK pressure, and recognize forced scoring routes. This makes the bot feel like three opponents rather than one opponent with different delay settings.

The highest-value improvement is analysis after scoring. The board should stay visible, the winning route should remain readable, and the user should be able to pause long enough to understand how the point happened. That turns Dotball from a simple mobile game into a learnable strategy experience, which helps players improve and gives the game a stronger identity.

For online multiplayer, Game Center should reduce setup friction. Quick Match is naturally strong because it starts with minimal coordination. Invites require clearer acceptance state, player identity, and board orientation so both players understand whether they are Player A, Player B, red, blue, attacking up, or attacking down.

Conclusion

Dotball's appeal comes from the gap between simple rules and deep consequences. A player sees dots and a ball, but the engine sees a changing graph with threats, traps, forced moves, and terminal scoring states. That makes the game a strong candidate for AI opponents and research-driven tuning.

For small boards, perfect play may be reachable through exhaustive search or retrograde analysis. For larger boards, the practical path is a hybrid: alpha-beta minimax for immediate tactics, strong heuristics for positional judgment, and optional Monte Carlo or learned evaluation for larger possibility spaces. The current 9-by-7 mobile board, automatic scoring, PK resolution, center-lock handling, and clearer move choices make the game more playable while preserving the hard search problem underneath.

Board length and width are not cosmetic settings. They reshape the entire strategic character of the game. The right version of Dotball is therefore not only a game implementation, but an ongoing balance problem: adjust the graph, observe player behavior, tune the bot, and keep the rules transparent enough that every loss feels explainable.