A companion to the game: four shells, a planner that plays out every way to spend a turn, a small network that judges where it ends, how that network learned from its own games, and the deals players make
Chowka Bhara is a race game with four players, cowrie shells for dice and pawns that send one another home. Its computer does not look many turns ahead. It plans its own turn exactly and averages over the throws it has yet to make. Then it asks a small neural network how well placed each possible end of the turn leaves it. This companion follows one turn of a real game between Hard computers through every part of that decision: the odds of the shells, the planner and its chance nodes, the network’s inputs and arithmetic, how self-play training taught it, how strength is measured, how the Easy level and the personalities differ, how deals and grudges enter the choice, and how the bar above the board turns the network’s judgement into each player’s chance of winning.
1 A turn of Chowka Bhara
What does the computer have to decide on its turn?
Four players race their pawns from their own edge of a five-by-five board to the centre. Each pawn follows its player’s path: anticlockwise round the outer ring, then clockwise round the inner ring, and in. The picture shows the red player’s path, its steps numbered from 0 (the home square) to 24 (the centre). The dashed part is the inner ring. Every player’s path is this one turned to their edge. The crossed squares are safe.
A turn starts with a throw of four cowrie shells, which gives a number. The player then moves one pawn that many steps. A plain turn is no more than that. Six more rules shape the choice:
Hits
A pawn that lands on an opponent’s lone pawn, off a safe square, sends it back to its home square. A hit earns another throw.
Bonus throws
A 4 (chowka) or an 8 (bhara) earns another throw, so a turn can hold several values to spend, in any order, on any pawns.
The gate
Until a player has hit someone, their pawns stop at step 15, the last outer square. The first hit opens the inner ring.
Pairs
Two pawns meeting on the first inner square may go on as a pair. A pair moves half the throw, and only another pair can hit it.
Rolling back
If a player holds values but can use none of them, the game undoes the whole turn, moves and all, as if it had been missed.
Places
The game goes on until three players are home. They take first, second and third places, and the last player takes fourth.
The example in this companion is turn 17 of a seeded game between four Hard computers. The red player threw 8, a bhara, so it threw again and got 2. It now holds an 8 and a 2, and has 5 different first moves. The rest of this companion works out which one it plays, and why.
2 Four shells
How likely is each throw, and how often does a turn hold more than one value?
Each shell lands mouth up or mouth down, about equally often, and the four land independently. So there are equally likely ways for them to fall, drawn here with mouth-up shells filled. The number of shells mouth up is the throw, except that none mouth up counts as 8. Six of the sixteen ways show two shells up and only one shows four, so a 2 is six times as likely as a 4.
Lemma 1 (The odds of a throw). With four fair shells, a throw of has probability , so and ; chowka (4) and bhara (8) each have probability .
Proof. The patterns of mouth up and down are equally likely, since each shell is fair and independent. A throw of is a pattern with exactly shells up, and there are of them; bhara is the single pattern with none up, chowka the single one with all four. ∎
In words
In symbols
the chance of a throw of (1 to 3)
the chance of a bonus throw
throws in a turn, before any hit
its expected value
Proposition 1 (Throws per turn). Leaving hits aside, a turn holds at least two values with probability , and , which is .
Proof. The turn throws again exactly when a throw is chowka or bhara, which happens with probability each time, independently of the throws before. So , and the expectation of a count is the sum of these tail probabilities, which form a geometric series. ∎
So one turn in eight, like the example’s, gives the player a real choice of order. On the seven-by-seven board there are six shells, throws 1 to 6 and 12, and only of throws earn another. throwOdds in rules.ts works out the odds once from the board, and the planner uses them at every chance node.
Figure 1: Throw the shells and watch each throw’s share approach its chance. Chowka and bhara throw again.
3 Expected placing
What number should the computer try to make as large as possible?
A race with four players is not a win for one player and a loss for the rest. Second place is better than third. The computer measures a position by the place it expects to finish in, on a scale where first is 1 and last is 0.
Definition 1 (Placing score and expected placing). With players, finishing in place (1 for first) scores : for four players 1, , and 0. A player’s expected placing in a position , , is the average of over every way the rest of the game can go from , with the players playing as they do.
Proposition 2 (Expected placings add up to ). In any position, : for four players, 2.
Proof. However the game ends, the places are shared out once each, so in every outcome. The average of a constant is that constant. ∎
The bars are the network’s estimates of each player’s expected placing at the start of the example turn. They add up to 2.021, close to the 2 that Proposition 2 requires. Nothing in the network forces this sum. The network judges each player’s value separately, from that player’s side. Red, at 0.498, is about even. Green, with a pawn on the inner ring, leads.
The differences that decide a move are small. A gain of 0.01 in expected placing means, for example, finishing one place higher in three games out of a hundred. Over a game of about 201 turns, many such gains add up to the difference between a strong player and a weak one.
4 Planning the turn
Holding an 8 and a 2, which pawn should move, and how far?
The computer looks for the way of spending its turn that leaves it best placed when the turn is over. Two things make that harder than trying each move once. The player can spend the values in either order, on any pawns. A hit earns a throw whose result is not yet known, so a move that hits leads to five positions, one for each throw.
4.1 Throw first
Lemma 2 (Throwing first is never worse). When a throw is owed and values are held, taking the throw before moving gives at least the expected value of any plan that moves first.
Proof. A throw’s result does not depend on the board, a held value never expires, and there is no penalty for holding many. So any plan that moves and then throws can be played as a throw followed by , with the same results. Throwing first can only add choice. With the value of moving when the throw is , , because for every , for the move best on average. ∎
So the computer throws while it owes throws, and only then chooses a move. Line 1 of the planner below does this, so every move is chosen knowing all the throws made so far.
4.2 A chance node
Definition 2 (Chance node and expected value). A chance node is a point where the next event is a throw. Its value is the average of the values after each throw, weighted by the throw’s probability: . A choice node is a point where the player picks a move. Its value is the largest of its moves’ values.
Algorithm 1: The turn planner. Lines 1–4 are chooseAction in src/games/chowka-bhara/ai.ts, and lines 5–11 are planOptions in plan.ts.
Require: the position at the start of the turn, the values in hand , a judge of end-of-turn positions
Ensure: the move to play now
1while a throw is owed do throw, and add the value to never worse than moving first
2for each value in and each distinct move with do
3, plus the deal side of a hit: the position after
4return the move with the highest score
5function
6if values are held but none can be used then returnthe turn rolls back
7if a throw is owed then returna chance node
8if is empty, or a further throw is owed then returnthe turn is over: ask the judge
9for each value in and each distinct move with do
10play to get ; a hit owes a throw;
11returnremembered for this position and hand
Figure 2: The 5 first moves, each drawn along red’s path, best first, with the planner’s value. Pawn and square numbers are the ones used in the text.
Require: the position at the start of the turn, the values in hand , a judge of end-of-turn positions
Ensure: the move to play now
1while a throw is owed do throw, and add the value to
2for each value in and each distinct move with do
3, plus the deal side of a hit
⋮
The 8 was bhara, so red threw again and got a 2. Nothing is owed now. Either value can move any pawn. The rings are where a first move can land: pawn 1 with the 2 to square 4 or the 8 to square 10; pawn 2 with the 2 to square 9 or the 8 to square 15; pawn 3 with the 8 to square 8. Pawns 3 and 4 share the home square. Moving either leaves the same board, so the planner counts them once. Pawn 1 with the 8 lands on green’s pawn 3 .
2Every first move, then the other valueAlgorithm 1
⋮
1while a throw is owed do throw, and add the value to
2for each value in and each distinct move with do
3, plus the deal side of a hit
⋮
8if is empty, or a further throw is owed then return
9for each value in and each distinct move with do
10play to get ; a hit owes a throw;
11return
After a first move, the planner spends what is left the same way. After pawn 1: 2, square 2 → 4, the 8 has 3 moves. Each one ends the turn, and the judge scores the position where it ends. The first move is worth the best of them, 0.514.
6if values are held but none can be used then return
7if a throw is owed then return
8if is empty, or a further throw is owed then return
9for each value in and each distinct move with do
10play to get ; a hit owes a throw;
11return
The hit sends a green pawn home and earns a throw, so the 2 stays in hand and a new value will join it. For each throw the planner finds the best way to spend the 2 and the new value. The move’s value is the average, each throw weighted by its chance out of 16: ( + + + + ) / 16 = 0.517.
The hit is worth 0.517 from the board, plus 0.0039 for the deal side of hitting green (Section 12), so 0.521 in all. That makes it the best first move by 0.007. The planner plays it, throws, and plans again with what it then holds.
The planner scores the throws of 4 and 8 in the chance node lower than the others. Each of them owes another throw, and the planner expands only one throw after a hit. Past that throw, it judges the board as it stands, with the values unspent. This underrates two branches that together happen one time in eight. It is the cost of a fast plan, explained in the note below.
Theorem 1 (The planner is exact for its judge). For a position and hand , is the largest expected judge value of the end of the turn that any way of finishing the turn can achieve, where a way of finishing may choose each move after seeing the throws before it, and throws beyond the planned one end the turn.
Proof. By induction on the number of values held plus throws still to be planned, which every step lowers: a move spends a value, a planned throw uses up the allowance. If the turn is over, the only way to finish it is to stop, worth , or when it rolls back. At a choice node, the best way to finish starts with some move and then finishes best from there, so its value is the largest of the moves’ values. At a chance node, a way of finishing may act differently after each throw, and the best one is best after each, so its value is the probability-weighted average of the best values after each throw (Definition 2). ∎
The value of a point of the turn depends only on the board and the values in hand, never on how the turn got there. So the planner remembers each pair of board and hand it has solved, and each end of the turn it has judged. Spending the 2 then the 8 and the 8 then the 2 on different pawns reaches the same board. The tree has 73 paths to an end of turn but only 44 different end positions, and the planner asks the network about each once. The whole plan took 2.51 milliseconds here.
Figure 3: The planner’s value for every first move, computed on the page. Change the throws in hand. Point at a move to see it on the board and what follows it: the best way to spend the rest of the hand or, after a hit, the value of each throw.
5 Why stop at the end of the turn
Chess programs look many moves ahead. Why does this one look no further than its own turn?
Looking further means planning the other players’ turns too. From each of red’s 44 possible ends of turn, blue’s next turn, with its throw, any bonus throws and every way to move, leads to 7.0 positions on average, or 308 in all. At that rate a whole round of four turns is about fifteen thousand positions and two rounds tens of millions. The bars use a logarithmic scale.
The cost is only part of the answer. Three further reasons make the end of the turn the right place to stop:
Others want other things
In a two-player game, the opponent’s best move is the worst for you, and a search can assume it. With four players, each plays for their own placing, makes deals and holds grudges. A search would need a model of all three opponents to predict their moves, and searches that assume everyone is against you play too defensively.
Luck between turns
Every turn starts with a throw, and an opponent’s best reply depends on it. Most of what happens after the turn is decided by throws nobody controls, which a search can only average over.
The judge already averages
The network is trained to predict the placing at the end of the game, which is an average over every future turn (Section 8). A look-ahead that averages over the next turn and asks the same network would mostly reproduce what the network already says.
Matches support this. With a hand-written judge, a search that looked further, within the turn and beyond it, changed match results by less than the matches could detect. The strength came from the judge. Planning the turn exactly paid off only once the judge was cheap, because an exact plan asks about tens of end positions per decision instead of a handful. So the design puts its effort into a judge that is both good and cheap, and plans exactly to the end of the turn.
6 What the network sees
How does a position become something a network can read?
A network reads a list of numbers. The judge’s list, its inputs, describes one end-of-turn position from the side of one player, the player whose placing is being judged. The board is turned so that player’s home edge is at the bottom, and the players are listed in turn order from them. The same network can then judge for any seat. A position judged for blue is laid out for blue exactly as one judged for red is laid out for red.
The first and largest part says where pawns stand. For every square and every player there are three on-off inputs: at least one of that player’s pawns is there, two or more are, a pair is. The four small boards are those inputs at the start of the example turn, from red’s side: a dot where an input is on, a ring where two or more pawns share a square.
Table 1: The judge’s inputs on the five-by-five board, from the side of the player being judged. There are 359 in all, and 647 on the seven-by-seven board.
In words
In symbols
three per square and player: one pawn, two or more, a pair
six per player: waiting, home, has hit, finished, progress, on the inner ring
who moves next
seven per other player: a deal, a truce together, my truce’s target, their truce’s target is me, my grudge, their grudge, their trust in me
the setup: how pawns enter, four players or fewer
The numbers are between 0 and 1. Progress is the share of the path covered, and a grudge is divided by its maximum of 3. Inputs for a player who is not in the game stay at 0, so one layout serves two, three and four players.
The inputs are raw facts, not judgements. No input says “this pawn is in danger” or “this player leads”. Hand-written judges for this game used such features, and they were slow to compute. Knowing whether a pawn is in danger means generating every opponent’s moves for every throw, at every position judged. Raw inputs cost almost nothing to fill in, and the network learns for itself which patterns of them matter. The on-off counts for one pawn and for two or more follow the encoding that the backgammon program TD-Gammon used for its checkers.
7 How the network judges
What does the network compute from those inputs?
The network has one hidden layer of 64 units between the inputs and the output. Each hidden unit multiplies each input by a weight of its own, adds up the products and a bias, and keeps the result only if it is positive. Otherwise it outputs 0. This rule is called ReLU. It lets a unit detect one pattern, because the unit outputs 0 until enough of its inputs are on. The output adds up the hidden units, each with a weight, and maps the sum into the range 0 to 1 with the logistic function .
Definition 3 (The value network). For inputs , first-layer weights and biases , output weights and bias , the hidden layer is , taken unit by unit, the output’s sum is , and the network’s value is , the judged player’s expected placing.
Figure 4: Hidden unit 35 at the start of the example turn. The bars show what each input that is on adds to it, largest first. Green bars raise the sum and red bars lower it. With its bias the sum is 1.089, which is positive, so the unit passes it on.
Proposition 3 (The cost of a judgement). If inputs are non-zero, computing takes multiply-adds, however many inputs the network has.
Proof. , where is the -th column. Inputs that are 0 contribute nothing, so only the columns of the inputs that are on are added, 64 numbers each. The output then takes 64 more. ∎
Figure 4 takes one hidden unit apart. Nobody designed what it detects. In this position it responds most to the trust two opponents place in red and to how far the players have come. Its sum is positive, so it fires with strength 1.089, and the output weighs it by −0.0759.
At the example position 28 of the 359 inputs are on, so the judgement costs 1,856 multiply-adds, which take a few microseconds. Only 3 of the 64 hidden units fire. The output’s sum before the logistic function is , and . Red is a little below even. The planner asked this network about 44 end positions to choose one move. The weights are stored by input, with each input’s 64 weights side by side, so the sum over the inputs that are on reads memory in order.
Figure 5: Choose a first move and, after a hit, the next throw. The planner finishes the turn, and the network judges where it ends. Pawn inputs that changed are outlined or faded. Watch which hidden units switch on and off and how the output moves.
8 Learning from its own games
Where do the network’s weights come from?
Nobody wrote the weights. The network learned them from games the computer played against itself, by temporal-difference learning (TD). The idea is that the value of a position should agree with what follows it. If the network said 0.5 at one turn and 0.6 a turn later, the first number may have been too low, and training moves the weights to raise it.
The training tool, tools/train.ts, repeats one round a few hundred times:
Play
Four copies of the computer play 480 games with the network being trained.
Targets
Every end-of-turn position gets a target, from every player’s side.
Fit
The weights move to bring each position’s value nearer its target.
Check
Every ten rounds, the network plays a match against the starting network, and the run keeps the best one.
Play. Worker threads play games exactly as the shipped Hard computer does, with the same planner and the same deals, but with the network being trained. Three moves in a hundred are chosen at random instead, so the network also sees positions its own preferences would avoid. Most games have four players, a few two, with every rule for bringing pawns in. Playing as the shipped computer plays matters. A network learns to judge the positions it is shown, and these are the positions it will meet.
Targets. At the end of a game every player’s real placing is known. Training works backwards through the game’s end-of-turn positions and gives each a target that blends what the network said one turn later with what happened after that.
Definition 4 (The λ-return). Let be a game’s end-of-turn positions, the network’s value of for one player, and that player’s final placing score. The targets are and for , with . Training uses .
Proposition 4 (What a target is made of). , and the weights add up to 1. So a target is a weighted average of the network’s later values and the real result. The result’s weight, , shrinks the further away the end is.
Proof. By induction from backwards. At the formula gives . If it holds at , substituting it into multiplies every later weight by and adds for . The weights are . ∎
Figure 6: The example game: the network’s value for one player at each of its 201 turns (), the targets built from it () and the real result (). The dashed line is the example turn. Choose the player and slide λ.
In Figure 6, red finished third. Near the end of the game the targets move towards the real result. Earlier, they follow the network’s own later values, smoothed. With a target is the next value. That target varies little, but it is only as right as the network already is. With a target is the real result. That is right on average but carries the luck of every later throw. A in between lets the targets use the real result while damping the luck of the throws.
Fit. Training then adjusts the weights to bring each position’s value nearer its target. For each batch of 256 positions, it works out how the squared error would change if each weight moved a little. That rate of change is the weight’s gradient. Training then moves every weight a small step in the direction that lowers the error. The Adam optimizer scales the steps. It divides each weight’s step by a running measure of its gradient’s size, so the weights of rarely used inputs still move. Each round makes one pass over the positions of the last three rounds.
Check. Every ten rounds the network plays the network the run started from, in matches arranged as in Section 10. The run writes the best network that scores over 50% to the game’s data. The shipped five-by-five network is round 140 of its run, after 67,200 games of training, and scored 66.1% ± 3.7% against the network the run began with.
9 What training needs
Why this way of learning, and not a simpler one?
Each choice in the training above avoids a way that training a judge for a dice game can fail. Each simpler approach below looks reasonable, and each fails for the reason given.
Fitting to results alone
A network fitted only to final placings learns the big signal, which is who is ahead. It does not learn the small differences between the end positions of one turn, and a move is chosen by those differences. With dice, they are a tiny part of why games end as they do, and the noise in the results hides them. Such a network predicts winners well and chooses moves badly.
Learning from another player’s games
A judge trained on positions from a different, weaker player learns to judge positions its own play rarely reaches, and misjudges the ones it does reach. Training on the games of the computer that will use the network keeps the two matched, and improves both together.
Tuning by trial
Nudging the weights at random and keeping the nudges that win more games needs many games per nudge to see a gain of a point or two through the dice. With more than a few dozen weights it makes no progress, and this network has over twenty thousand. A gradient gives the direction for every weight at once, from every position played.
Starting from random weights
From random weights, TD learns slowly here. A game has about 201 turns, and the real result reaches a target 201 turns before the end with weight , which is close to zero. The early values are learned from later values that are still noise. So the network was first fitted to a hand-written judge’s scores on positions from thousands of games. That gave it most of its strength in minutes, and TD then improved on it.
The bars are , the weight of the real result in a target turns before the end (Proposition 4). After ten turns it is 0.028, and the rest of a target is the network’s own later values. TD from a reasonable start works because those values already carry information. From random weights they carry none, and the weight of the result falls near zero long before the start of the game.
10 Measuring strength
How can you tell whether one computer is better than another, when the dice decide so much?
A single game says almost nothing, and even a few hundred games leave a wide margin of error. The arena tool, tools/arena.ts, uses two arrangements that make matches far more informative.
Same dice, every seat. The arena plays each dice seed, which fixes the sequence of throws, four times. The computer under test, drawn dark, takes a different seat each time, and the other computer takes the remaining three. Good or bad dice and the advantage of a seat then fall on each player in turn and mostly cancel.
Proposition 5 (Identical players score exactly one half). If both computers are the same deterministic player, the rotated games of a seed give the tested one an average placing score of exactly .
Proof. With identical players, the four games of a seed are the same game. The tested player’s placings over the four rotations are therefore the placings of the four seats in that one game, whose scores add to 2 (Proposition 2). Their average is . ∎
The match of Hard against Hard scored exactly 50.0% in 40 games, as the proposition requires. This checks that the arrangement is fair.
Figure 7: Average placing score of the first player named, one seat against three, over 240 games on rotated seats. An even share is 0.5, and the margins are about ±0.05.
Stopping early. The arena plays seeds in batches and runs a sequential probability ratio test after each batch. The test compares how likely the results are if the two computers are level with how likely they are if the tested one is two points better. It stops as soon as either is clearly more likely. A clear difference is settled in a few dozen seeds, and a close one gets as many seeds as it needs.
11 Easy, Hard and personalities
How do the levels and the personalities change the move?
Every computer runs the same planner with the same network. The levels and personalities change only the final step, how the options’ values are compared.
Hard plays the option with the highest value. Easy adds random noise to each option’s value before comparing. The noise is a number drawn from a normal distribution with standard deviation 0.008, in units of expected placing. Two options whose values differ by much less than that are often swapped. An option worse by several times that is almost never chosen. Easy therefore makes small mistakes and rarely large ones.
In words
In symbols
Hard’s choice
Easy’s choice
its noise, fresh for every option
The bars are the example’s first moves with their values (Section 4). The gaps between them are about the size of Easy’s noise. In 20,000 draws of its noise, Easy plays the hit 58% of the time, and plays each other move less often the further its value is below the hit’s. The worst move, 0.015 below the best, is still chosen 4.1% of the time. Matches set the size of the noise. With it, Easy scores 38% against Hard and 62% against a player that always goes furthest and hits when it can (Section 10).
Figure 8: Let a computer choose among the example’s first moves a thousand times, with no noise as Hard plays, with Easy’s noise, or with more.
Personalities adjust the judge’s score. Each has hand-set preferences, in points for progress, for pawns on safe squares, for pairs, for having hit and for reaching the centre. The score of an end of turn gains the difference between the personality’s points and the balanced player’s, scaled so that a 400-point difference moves the score by 0.55. The adjustment is small next to the network’s value, so it decides between near-equal moves and rarely overrides a clear one.
aggressive
It likes hits more and safe squares less. It chose differently from the balanced player in 38 of the example game’s 228 choices.
cautious
It likes safe squares. It chose differently in 25.
builder
It likes pairs. It chose differently in 3.
racer
It likes progress and the centre. It chose differently in 40.
In the example turn all five personalities play the hit, because its lead is larger than any personality’s adjustment.
12 Deals
How do truces, peace deals and grudges enter the computer’s decisions?
With three or four players, a player may propose a deal at the start of their turn. A deal is a promise not to hit one another until a given turn. A truce is a deal between two or more players against the clear leader. It lasts three rounds, or until the target no longer leads. A peace is the leader’s answer. The leader offers one member of a truce a two-round promise, and that member leaves the truce. Each player also keeps records about every other player. Trust, from 0 to 1 and starting at 0.6, measures whether the other player keeps their word. A grudge records that the other player hit them lately, and fades every turn. A cooldown follows a refusal or a betrayal.
All of this is among the network’s inputs (Section 6). Self-play games include deals, so the network has learned what a truce or a grudge is worth in a given position. Every deal decision asks the network that question.
Definition 5 (The value of a deal). For a player and a proposed deal in position , the gain is , where is ’s expected placing in with the deal made and without it, both judged by the network from ’s side. A player accepts if they trust the proposer at least 0.36, are not cooling off from them, and . For some personalities the margin is shifted up or down by half.
In the example game the players made 2 offers, and 2 were accepted. The picture shows the first, at turn 130. Both sides expect to gain a little more than the margin. Among every deal it may offer, a proposer picks the one with the largest gain times the estimated chance that the other side accepts (Section 13). It offers nothing with less than a one-in-four chance.
The gains are small. The network values most truces within a few thousandths of an expected placing. That is why the margin is 0.002, and why the weights are stored precisely enough to tell such gains apart (Section 7).
The deal side of a hit. When the planner scores a move that hits, line 3 of Algorithm 1 adds a term for what the hit does between the players:
In words
In symbols
hitting someone you promised not to hit (a betrayal)
their trust in you
hitting your truce’s target
, plus a little more the further it leads
hitting someone you hold a grudge against
the grudge (0 to 3)
In the example, green had hit red a few turns before, and red’s grudge had faded to 0.52. The hit on green gains 0.52 × 0.0075 = 0.0039. A betrayal costs much more: the betrayer leaves every deal with the victim, the victim’s trust falls by 0.5, they will not deal again for three rounds, and the rest of a shared truce trusts the betrayer less. There is one exception. Hitting a truce ally is a relay, not a betrayal, when the bonus throw it earns has a real chance of hitting the target, which is far ahead.
The penalties for a betrayal make promises worth keeping. Kramár and colleagues studied computer agents in the negotiation game Diplomacy in 2022. Agents that broke agreements won more often among honest agents unless the others punished them, and with punishment, breaking agreements stopped paying. Lost trust and grudges are that punishment. Because they are among the network’s inputs, the network has learned their cost from self-play.
13 Reading the other players
How does a computer guess whether its offer will be accepted?
Whether a player accepts depends on their personality, which shows only in their play. So every player keeps a belief about every other player’s personality. The belief is a probability for each of the five personalities, starting at 40% balanced and 15% for each of the others, and opponent.ts updates it after every move that player makes.
Definition 6 (The personality update). For a move chosen among alternatives, each personality gives each alternative a score from six facts about the move: progress, players hit, landing on a safe square, lining up a pair, reaching the centre, and how many throws would let an opponent hit back. With , where , the likelihood of the chosen move is , and the belief becomes .
This is Bayes’ rule with two changes that weaken each update. The temperature 2.5 makes each personality’s choices likely but not certain. The power 0.55 counts each move as about half the evidence it would otherwise be. So one unusual move does not decide a player’s personality, while a run of similar moves does. The floor of 0.015 keeps any personality from being ruled out for good.
Figure 9: Red’s belief about each opponent’s personality at the example turn, with one colour per personality: balanced, aggressive, cautious, builder, racer. All four computers in the example game are balanced.
At the example turn, after 17 turns, red’s beliefs have moved only a little from the starting probabilities. Every player in this game is balanced, and balanced play mixes every kind of move. A proposer turns the belief into a chance of acceptance by adding up the probabilities of the personalities whose margin the deal’s gain clears.
14 The outlook bar
How does the bar above the board turn the network’s numbers into chances of winning?
The network gives each player’s expected placing. The bar shows each player’s chance of taking the next open place. To get one from the other, the page models the race as a draw. First place goes to a player picked with probability in proportion to their strength, second place to one of the rest picked the same way, and so on.
Definition 7 (Plackett–Luce). Given strengths , an order of the players has probability
A player’s chance of first place is , and their expected placing follows by summing over all orders, 24 for four players.
The page searches for the strengths whose expected placings match the network’s, then reads off each player’s chance of first place. Mid-turn, the position the mover will reach is not yet settled. outlook.ts averages owed throws over their odds and plays out held values as Hard would play them.
Figure 10: The outlook bar at the example turn: each player’s chance of first place before red throws, and once it holds an 8 and a 2.
Before throwing, red’s chance of first place was 23.6%. Holding an 8 and a 2, with a hit available, it is 25.9%. At the end of the game the page replays these chances turn by turn as a race chart, with the lead changes and the biggest single swing.