Audamir

part 55

A third player in Lines: what 141,250 games between AI opponents showed

Three in a row, Five in a row and Gravity four end in a draw or a coin toss for three players. A measurement of 141,250 games between AI opponents showed where a third player makes sense.

· 19 min read

On 30 October 2026 it was examined when it makes sense to play Lines with more players; in my view Three in a row is a very clear game, which mostly ends in a draw. The analysis docs/LINES-PLAYERS.md was made the same day, and that evening the first two steps in the code were added as well. On the three boards the game has today, a third player does not improve the game: with three players Three in a row ends in a draw in 100 % of games, Five in a row on the 15 × 15 board in 94 %, and Gravity four in 26 to 33 %. More players make sense on boards the game does not have yet, and what decides it is a thing the rules do not determine: whether a player blocks a threat that anyone else could have blocked.

AI opponents were measured: 141,250 games in 765 cells (board, length of the row, 2 to 6 players) and 34,800 games for testing the fixes of the rules. Humans were not measured. The earlier articles on Lines: Three in a row and When a row stops being played.

What was measured and how

The AI games are played for two only, so the analysis used its own simulator outside the repository: the rules m, n, k for 2 to 6 places on a rectangular board, free or with gravity (stones fall to the bottom). There are two AI opponents. The tactical AI wins if it can, otherwise it blocks the threat; on a board with gravity it does not make available to the opponent the winning tile, it looks for a fork (two winning tiles at once), and it plays 5 % of the moves at random. It does not look ahead (0.17 ms a move). The look-ahead AI searches four moves ahead and takes all the others as one opponent.

The tactical AI has two forms, and both are compared in the whole article. The guard blocks every immediate threat of any player. The last-chance AI blocks only when no other player stands between it and the player who threatens; otherwise it builds. These are two ends of the possible behaviour; where a human plays between them is not known.

Against the AI for two (8 to 20 games per pair) the tactical AI is roughly at level 2 on Three in a row and on Gravity four, but on the Five in a row board it loses all games; the look-ahead AI is roughly at level 2. A game is decided if there are at most 25 % draws. The spread of places is the largest deviation of the winning share of a place from the fair 1/N, multiplied by N: 0 is fair, 1 means twice the share.

State of the game: this article describes the state of 30 Oct 2026; the words "today" and "for now" refer to that day. From version 0.153 (14 Nov 2026) the game sets up and plays Lines for three to five players against the AI, and from 0.175 also with points on the board to the end. What has changed and how the game counts today is in article 091 (forthcoming article no. 91). The measurements and the numbers in this article do not change.

Today's three variants for three players

Variant2 players3 players, guard3 players, last chance
Three in a row, 3 × 3, row 398 % draws100 % drawsnot measured
Five in a row, 15 × 15, row 50 % draws, places 55 / 4594 % draws5 % draws, places 38 / 31 / 31
Gravity four, 7 × 6, row 414 % draws, places 47 / 5326 % draws, one place wins 64 %33 % draws, one place wins 44 %
Draws on three boards: two and three playersShare of draws (%) on three boards: Three in a row on 3 × 3 with row 3, Five in a row on 15 × 15 with row 5 and Gravity four on 7 × 6 with row 4. Columns: two players, three players with the guard and three players with the last-chance AI. Three in a row with the last-chance AI was not measured. The numbers are from the table of the article, analysis docs/LINES-PLAYERS.md of 30 Oct 2026.0 %25 %50 %75 %100 %98 %100 %notmeasuredThree in a row, 3 × 30 %94 %5 %Five in a row, 15 × 1514 %26 %33 %Gravity four, 7 × 6two playersthree, guardthree, last chance
Share of draws on three boards: two players, three players with the guard and three players with the last-chance AI. Three in a row with the last-chance AI was not measured. The numbers are from the table of the article, analysis docs/LINES-PLAYERS.md of 30 Oct 2026.

Three in a row. Each of the three players has three stones on a board of nine places, and all three are needed for a line. The guard does not allow it: 250 games out of 250 ended in a draw. For two it is 98 % draws (the AI makes 5 % random moves), because the game is solved (article on the game tree). The last-chance AI was not measured on 3 × 3; on a 4 × 4 board with row 3 it gives 21 % draws and the first place wins 90 % of the decided games.

Five in a row. The guard blocks everything, so nobody builds two unstoppable threats, and the games last on average 216 moves out of 225 places. The last-chance AI ends 95 % of the games with a win, on average after 57 moves.

Gravity four. The two stances come close (26 and 33 %), but the game is uneven: one of the three places wins 64 or 44 % of the games. The cause is the gravity (fourth part).

Who blocks? A difference the rules do not decide

With two players the question does not arise: the threat of the opponent is blocked by the only player there is. With three, two may block it, and the one who does loses a turn while the others gain. Blocking is a common good, and each player wants somebody else to pay for it (a reasoning that the measurements confirm). A page on the three-player connection game Qua advises not to block a simple threat of the previous player; one should block only when the next player cannot block it. The variant Points Pente for three and four players shortens the line from five stones to four, because the threat can be blocked by more players (both pages read on 31 Oct 2026).

Board, row, playersdraws with the guarddraws with the last-chance AI
9 × 9, row 4, 336 %0 %
9 × 9, row 4, 498 %1 %
13 × 13, row 5, 398 %15 %
15 × 15, row 5, 394 %5 %
Who blocks: draws with two stances of the AIShare of draws (%) in four cells: the guard blocks every threat, the last-chance AI only when no other player stands between it and the threatening player. Numbers from the table of the article, analysis docs/LINES-PLAYERS.md of 30 Oct 2026.0 %25 %50 %75 %100 %9 × 9, row 4, 3 players36 %0 %9 × 9, row 4, 4 players98 %1 %13 × 13, row 5, 3 players98 %15 %15 × 15, row 5, 3 players94 %5 %guardlast chance
Share of draws in four cells. The guard (blue dots) blocks every threat, the last-chance AI (orange) only when no other player stands between it and the threatening player. Numbers from the table of the article, analysis of 30 Oct 2026.

A player who has N winning tiles at once is unstoppable: between two of his moves each of the N − 1 others places one stone, so he removes at most N − 1 tiles. The measurement shows how large a set of winning tiles the winner had after the last move (share of decided games; a single tile, that is an unstopped simple threat, never happened on the free boards):

Cellguard: 2 to N − 1 / N and morelast chance: 2 to N − 1 / N and more
9 × 9, row 4, 2 players0 / 100 %0 / 100 %
9 × 9, row 4, 3 players14 / 86 %95 / 5 %
15 × 15, row 5, 3 players11 / 89 %100 / 0 %
13 × 13, row 3, 5 players78 / 22 %99 / 1 %

With two players every win is an unstoppable fork. With three and more the guards win only with a set of N tiles, which is rare, and the game lasts until the board runs out. The last-chance AI wins in 82 to 100 % of the decided games with a set that the others together could have stopped and did not: it is a free rider (free rider) made by one line of code. It pays for this with a place before the leader: on a 9 × 9 board with row 4 and four players, the fourth place lost 22 % of its moves to blocks, the others 12 to 15 %.

More players, a larger board

The smallest square board on which draws are at most 25 % (number of places; interpolation between sizes):

Row and AI2 players3456
4, guard2391430> 625> 625
4, last chance23476278102
5, guard71> 625> 625> 625> 625
5, last chance68148221335> 361
The smallest board with at most 25 % draws, by number of playersNumber of tiles of the smallest square board on which draws are at most 25 %, with row 4 and 5, two stances of the AI and two to six players. A value above 625 (the end of the table), with the last-chance AI above 361, is an arrow upwards. Numbers from the table of the article, analysis docs/LINES-PLAYERS.md of 30 Oct 2026.0100200300400500600700tiles23456players> 625> 625239143023476278102> 625> 625> 625> 62571> 36168148221335row 4, guardrow 4, last chancerow 5, guardrow 5, last chance
Number of tiles of the smallest square board with at most 25 % draws: two to six players, two AI stances, row 4 and 5. An arrow upwards marks a value above the limit of the table (625, with the last-chance AI 361). Numbers from the table of the article, analysis of 30 Oct 2026.

With the guard the area at row 4 grows about four times for each further player; with the last-chance AI roughly as N^1.14 × (length of the row)^5.22 (R² 0.988, but only nine cells: a rough rule, not a law). The first estimate of proportionality N × length² was not confirmed in the length: from row 4 to row 5 the area grows about three times (68 / 23 and 148 / 47), not 1.6 times. What happens with a still longer row is described in the article on the length of a row. An estimate of the cause (a reasoning): a stretch of the board is "alive" for a colour as long as there is no foreign stone in it. With the board half filled, 32 % of the stretches of length 4 stay alive with two players, 20 % with three, 15 % with four and 12 % with six (a model; the simulation differs from it by at most 0.01).

Gravity

With gravity it is different. With two players 86 % of the wins are a gift: the winning tile was not yet playable and someone had to play under it; with three to six players such wins are 96 to 100 %. A tile on which no stone can yet be placed cannot be blocked, and therefore the stance of the AI hardly matters: the columns of the guard and the last-chance AI differ on average by 3.0 points of draws (155 cells), while on free boards by 21 points (185 cells). Draws (guard / last chance), row 4:

Board3 players45
7 × 626 / 33 %78 / 76 %90 / 88 %
12 × 90 / 0 %9 / 1 %17 / 14 %
15 × 120 / 0 %1 / 0 %2 / 0 %

The parity of the board decides, that is, who is forced to play under someone else's threat; that is why one of the three places wins up to 64 % of the games on 7 × 6.

A stronger AI draws more

The tables belong to the tactical AI, which makes mistakes. The look-ahead AI draws much more on the same boards: the free 15 × 15 board with row 4 for three players 15 % (guard 0 %), gravity 8 × 7 for three 57 % (10 %), gravity 12 × 9 for four 60 % (9 %). Every limit in this article is therefore optimistic. Deeper search is not a better AI for more players either: on the boards with gravity it won 0.6 to 1.0 of the fair share against the tactical AI, and for five on the free 9 × 9 board with row 3 only 0.3.

Order, teams and rule fixes

Place at the table. On free boards the first place wins 1.3 to 1.9 times the fair share (1.29 with the guard for three players, 1.70 with the last-chance AI), later places with the last-chance AI 0.6 to 0.9. A fair place is therefore not a property of the rules, but of the board and the number of players.

Decisions without a chance (in English kingmaking): a player who has no live stretch left can decide who wins. In 219 cells with at most 2 % draws this happened in 0.25 % of games; in 316 cells with at least 90 % draws such a player is in 99 % of games, because that is a property of a dead board. The exception is an overcrowded board with gravity: with six players on 7 × 6 (the guards), in 61 % of the decided games a player without a chance had to face a threat, and in 15 % another move of his would have changed the winner.

Teams do not add a rule. Two players with a common colour who sit alternately (A B A B) play exactly the game for two: on 7 × 6 with gravity 54 / 46 % against 52 / 48 %, in both cases 11 % draws and 32 moves. When they sit one after another (A A B B) it is a double move, and on 9 × 9 with row 4 the first side wins 85 % of the games (95 % with the last-chance AI). A team is only a way to give a table of four people two sides.

Fixes of the order. Six changes of the order and of the number of stones were tried. The only one that makes a draw-prone free board decided without making places worse is the order from the game Connect-6 (the first move one stone, the next moves two): on a 9 × 9 board with row 4 and four players it reduces the draws from 98 % to 0 % with a spread of places of 0.25 (unchanged 1.00), and on a 13 × 13 board with row 5 for three from 95 % to 0 % with a spread of 0.50. With the last-chance AI it is unnecessary, and on boards with gravity it gives mixed results. The other changes of place make things worse: turning the order every round (spread 1.51 and 1.00), two stones a move for everybody (0.57 and 0.64, elsewhere up to 2.63) and an extra stone for the later places (3.00 and 1.00).

Four new variants can be written as data (board, row, gravity, a list of player counts) and they have a reserve for a stronger AI (hence 15 × 15 instead of 13 × 13 and 12 × 9 instead of 8 × 7). The draws are for the tactical (guard) and the look-ahead AI:

Working nameBoard and rowPlayersDraws
triofree 15 × 15, row 42 to 3for three 0 % / 15 %
wide-dropgravity 12 × 9, row 42 to 3for three 0 % / 20 %
big-dropgravity 15 × 12, row 43 to 4for three 0 % / 0 %, for four 1 % / 35 %; the places about 23 px on a phone
partyfree 13 × 13, row 34 to 5for five 17 % / 17 %

The state of 30 Oct 2026: the three variants did not change and were not offered for three players; from version 0.153 they are offered for three players (article 091).

The AI for three and more is meant to be tactical without look-ahead, with a vigilance that depends on the level: level 1 blocks only at the last moment, level 2 in half of the cases, and level 3 blocks everything and watches the forks of the others. The decisive property of the AI is vigilance, not depth, and the tactical AI is cheap too: 0.17 ms a move against about 140 ms for the AI of level 3 on the 15 × 15 board for two players.

So it was decided, in brief:

  • more players only narrowly: three as the standard, four on one board with gravity, five on one board "party", six never (six players draw with the guards in 54 to 100 % of the games on free boards);
  • no teams in the first version; Three in a row stays a game for two;
  • the AI is tactical with vigilance that depends on the level; each level I am to play ten times before the release;
  • the closing card shows the result of the human and the name of the winner, without a ranking;
  • no rule against the free rider, and for now not the order of Connect-6 either.

What is built: P0 and P1

The game was written for two: the constant SEATS = 2 and eleven readings of it in the rules, the AI written as a two-sided search (about 480 lines), and about eight places of the screen and the wrapper. The steps are split and merged one by one:

StepContentStatus on 31 Oct 2026
P0the number of players as data, the game for two byte for byte the samedone (30 Oct)
P1rules for three to five playersdone (30 Oct)
P2tactical AI with vigilance, the tool --players Nnot built
P3choice of the number of players, panel, closing card with the name, texts in 9 languages, four variantsnot built
P4 to P7statistics for three and more; the table of verdicts as data; optionally the order of Connect-6 and teamsnot built, P6 and P7 postponed

A player will see the game for three only with step P3. Today he sees nothing: the screen offers two players, the AI plays only for two, and the game for three cannot be started from the screen.

P0 replaced the constant with the table ChainsData.PLAYERS (the smallest, the largest and the default number). The field cfg.players in the settings of the game is missing when there are two players: a saved game, a record and a Restart must stay byte for byte the same for two, and a field that would always be written would change every saved state by one key. Every variant has players: [2]; that is what the screen offers while the rules know more.

P1 raised the highest number of players to 5 (a sixth is refused, because that is what was decided). A saved game is checked by places: the place s has floor(moves / n) stones, and one more if its order from the starting player is smaller than the rest moves mod n. The AI refuses three or more players with an error that points to step P2; it does not invent a move that the two-sided search would make for the third place.

In the browser panel it was verified that a game saved by the old build (Gravity four, round 4) was restored on the same board in the new one and finished.

At P1 a finding also came up: the analysis claimed that an older build refuses a saved game with three players as any damaged state. A measurement with the old code showed that it refuses it from the second stone, but restores a game for three with no stone or with one stone as a game for two. Nothing offers more than two players, so today this cannot be reached; P3 has to close the gap (with a revision mark in the saved game).

What remains and what was not measured

  • No human. How a human blocks, what he does on a dead board, and whether he enjoys the game after 15 moves or after 77, was not measured; this is the largest uncertainty. The two stances only bound it.
  • The AI of the analysis is not the AI of the game. The tactical AI is weaker than the level 2 of the game on Five in a row, and the AI of the game for three and more does not exist (P2). The vigilance by level is a proposal.
  • Phone. The boards 12 × 9 and 15 × 12 have places of about 29 and 23 px on a 375 px wide screen; legibility was not measured.
  • Not built is everything the player will see: the AI for three and more, the choice of the number of players, the closing card with the name of the winner, the four new variants and the statistics (P2 to P5).

Sources and notes

  • Analysis and decisions: docs/LINES-PLAYERS.md (30 Oct 2026, game version 0.62.3) and docs/ROADMAP.md, chapter 28. The answer is retold, not quoted word for word.
  • Measurement: 141,250 games in 765 cells and 34,800 games for testing the fixes of the rules. The scripts and the raw outputs are in the notes of the analysis, not in the repository of the game. When this was written, the counts, draws, shares of places and the fixes of the order were calculated again from the raw outputs.
  • State of the code: docs/DESIGN.md §92 (state of 30 Oct 2026, game version 0.65.6). The code was read; the tests and the tools were not run.
  • Other games: the rules of Pente and Qua, read on 31 Oct 2026.

What could not be verified: the behaviour of humans (no measurement), the agreement of the analysis with the AI of the game and the cost of a move (from the analysis), the other statements of the analysis about other games and works (not opened, not used in the article), the legibility of the boards on a phone, and the state of steps P2 to P7 after 31 October 2026.