RockGammon

Backgammon for iPhone and iPad.

The Classic board in 3D: green felt, stitched points and a leather frame, set up to play

Two ways to play

A friend, online

Send an invite in Messages. Your friend taps it and you're playing, each on your own time, with a notification when it's your move. It runs on iCloud, so there's no account to make.

Once you've played someone, you can invite them again straight from the app: pick them under Play again with, and they answer from their Home.

The computer

RogBot, in three levels: RogBot OG, the original; RogBot AI, a neural network trained on over five million games; and RogBot SI, which looks a roll ahead. With the doubling cube and an opening throw.

A game, or a match

Either can be a single game or a match to 3, 5 or 7 points. In a match each game's points go to its winner, the score sits in a row of dots under each pip count, and the first to the length wins. Against RogBot, Next Game carries it on; online, the next game opens for both of you.

The rules are the usual ones. A single game is played with the Jacoby rule: gammons and backgammons count only once the cube has been turned. A match has no Jacoby rule, and it has the Crawford rule: when a player first gets within a point of winning, the next game is played without doubling. After that one game the cube is back. Rules of Play, in the app, sets them out.

RogBot AI and RogBot SI play the score, not just the game: a gammon that would win the match counts for more, a loss that can't cost more counts for less, and a double with nothing left to gain isn't made.

A match to 3 on the Classic board: You Won, 1 point, Match 1–0 to 3, with Next Game beside Review Game, and each player's points as dots under the pip counts

At the board

Reactions

Under the board, a row of five dials: Respect, Luck, Challenge, Gloat and Lament, with four emblems each. Turn a dial to the one you want and double-tap it. It goes up the side of the board and fades away, and in an online game your opponent sees it go up theirs.

RespectCheersApplauseExcellentSolid gold
LuckLuckyLuckLucky lambLucky cat
ChallengeYour moveBring it onEn gardePistols at dawn
GloatMagnificentCockyVictoryTrophy
LamentAlasDisasterMisfortuneDumpster fire
A game on the Classic board: four reactions going up the lower left, above the row of five dials under the board

News from your other games

With several games going online, a small note drops in at the top when a friend rolls or moves in another one: “Brian rolled”, and the dice. Tap it to go to that game.

Hint

Against RogBot, hold Hint after your roll and the best play shows on the board: a ring with a plus where a checker lands, a dashed ring round a blot it hits, a slot in the tray for one it bears off. Let go and it's gone.

RogBot NN

Watch RogBot think. On RogBot's turn, a panel opens under the board with its neural network at work: the position going in as 198 inputs, the hidden neurons lighting up, and its chances of winning, and of a gammon either way, coming out. RogBot's top plays go by one at a time, each marked on the board. For RogBot SI, a row of 21 lights fills in under each play close to the best as it weighs your best reply to every roll. Then it settles on its move.

The move stays above the dice until you roll, with what it's worth in points a game. Tap it to watch the turn again. In portrait, against RogBot AI and RogBot SI; RogBot NN, in Settings, turns it off.

RogBot NN on the Classic board: the network's inputs, hidden neurons and outputs over RogBot's top plays, the third, 13/7 24/22*, marked on the board as its row of look-ahead lights fills in

Less tapping

A roll with only one play is made for you. Once every checker is home and there's no contact left, Auto Bear-Off takes them off. Undo takes either back, and Settings turns them off.

After the game

Every game, reviewed

When a game ends, tap Review Game. A graph follows your chance of winning before every turn, from the first roll to the last, with the moments that mattered numbered on it: a blunder, a lucky roll, a missed double.

Then the two of you side by side: how accurately each of you played, how many of your plays were the best one, how much the dice helped or hurt, your cube decisions, and where your style sits between cautious and bold. It's all worked out on your iPhone, in well under a second.

A game review: the chance-of-winning graph with numbered moments, then accuracy, luck, cube and style for both players

Game History

Every finished game, against RogBot at any level and against your friends online: who you played, whether you won, for how many points and how it ended, with a tally at the top. A game with a review opens it in a tap.

Win Chance, live

Against RogBot, turn on Win Chance and a small bar shows your chances as the game stands; in a match, your chance of winning the match beside it. It's never shown in online games: a live estimate would coach you against a friend.

Seven boards

Each with its own wood, cloth or glass, its own 3D dice and its own lettering. On a Travel Board the game speaks in the place's own voice: a road sign at Saint-Jean, a trail sign at Teton, a paper lantern in Kyoto.

The originals

ClassicFelt & leather
The Classic board in 3D
ParquetInlaid wood
The Parquet board in 3D
RetroNeon glass
The Retro board in 3D

Travel Boards

Saint-JeanA teak deck at noon in the Caribbean
The Saint-Jean board in 3D
LuganoA mahogany runabout on the lake
The Lugano board in 3D
TetonA cabin in Jackson Hole after dark
The Teton board in 3D
KyotoAn afternoon in a tatami room
The Kyoto board in 3D

And at the end of a game, a vintage poster of the place, with the result on the board's own sign.

Saint-Jean's poster: a seaplane over the bay at Saint Barthélemy, You Won on a beach sign Lugano's poster: a mahogany runabout on the lake, You Won on a windshield pane Teton's poster: the tram over Jackson Hole, You Won on a trail sign Kyoto's poster: the gates of Fushimi Inari, You Won on a paper lantern

On iPad

The board sits framed, with room around it. In landscape you get the whole board: a rail down each side and a deeper frame top and bottom.

Under the hood

How the review works

The reviews, RogBot AI, RogBot SI and RogBot's doubling all run on a neural network RockGammon trained for itself. It runs entirely on your iPhone or iPad: no server, no connection, nothing sent anywhere.

5Mgames of self-play
40 minof training, on an M4
157 KBthe finished model: 39,178 weights
50.0%RogBot SI against GNU Backgammon Expert

A neural network of its own

Two networks, really: one for positions where the checkers can still hit each other, one for the race home. Each looks at the board from the side to move, 198 inputs in all: for each side and each point, how many checkers are there, then the bar, the checkers borne off and both pip counts.

One hidden layer, 128 neurons in the contact network and 64 in the race, gives five chances: winning, winning a gammon or a backgammon, and losing a gammon or a backgammon. Together they make the position's equity, the points expected per game. It's a small, shallow network on purpose. The dice make a position's value change smoothly, and a network this size can judge every possible play, and every roll after it, in milliseconds.

How it learned

Like TD-Gammon before it, it taught itself. It started from random weights and played both sides, taking the play it rated best, and after every game nudged its judgment of each position toward what came next, and in the end toward the result (temporal-difference learning, TD(λ)). No human games, no outside data, no other program's evaluations.

Five million games in three runs, about forty minutes on an Apple M4 Pro, twelve games at a time. Against the original rules of RogBot OG it won about 66% of games after 25,000 games of training, 70% after 100,000, 76% after half a million, and 78% at the end. Each choice was settled by playing the candidates head to head, every pair of games with the same dice and the sides swapped to cancel out luck: 128 hidden neurons beat 80 by 0.056 points a game, and a third million-game run tied the second, so training stopped there.

When it says 70%

…the side it means wins about 70% of the time. Over a thousand games of self-play, some 57,000 positions:

It saidAverageSide won
0–10%2.8%3.5%
10–20%14.9%15.2%
20–30%25.2%27.4%
30–40%35.3%34.0%
40–50%45.7%44.1%
50–60%54.2%55.5%
60–70%64.7%66.3%
70–80%74.9%73.8%
80–90%85.1%84.3%
90–100%97.2%96.6%

Gammons too: it expected one in 25.9% of games, and 25.9% ended in one. Its opening plays are the standard modern ones, and it rates 3-1 the best opening roll.

How strong is RogBot?

RogBot SI rates every play with the network, keeps the best few, then judges each by your best reply to all 21 rolls, weighted by how often each comes up, in about 3 milliseconds. RogBot AI plays the same network with a little deliberate slack, slipping now and then but never wildly. Measured head to head, each pair of games played with the same dice and the sides swapped:

Match-upGamesWonPer game
SI against OG12,00078.4%+0.79
SI against the plain network12,00052.5%+0.077
AI against OG6,00065.1%+0.45
AI against the plain network6,00036.0%−0.43

In reviews, RogBot OG plays to about 66% accuracy, RogBot AI about 81% and RogBot SI close to 100%. On the cube, AI and SI double, take and drop from the network's chances by Janowski's formula for money play, under the Jacoby rule: with no gammons in play they take down to about a 20% chance of winning and double from about 70%. In a match they weigh every result, and every double, by what it does to the chance of winning the match, read from the Kazaross-XG2 match equity table.

Against the best

GNU Backgammon is the strongest free backgammon program and the usual yardstick, so we played RogBot against it: version 1.08.003, on the same Mac, 2,000 games for each match-up. The games were cubeless money games (gammons and backgammons count, no doubling cube), played in pairs with the same dice and the sides swapped to cancel out luck. GNU played its best checker play at each of its look-aheads: 0-ply is its Expert level, 2-ply its World Class.

RogBotGNU levelWonPer game
RogBot SIExpert50.0%+0.008
RogBot SI1-ply48.5%−0.044
RogBot SIWorld Class46.6%−0.091
The network aloneExpert46.5%−0.072
RogBot AIExpert34.1%−0.525
RogBot OGExpert21.3%−0.810

Points per game have a 95% range of about ±0.055.

RogBot SI plays GNU Backgammon's Expert level to a draw, and wins 47% of its games against World Class. RogBot AI, the default, wins about a third against Expert; the original RogBot about a fifth.

Then GNU Backgammon, at World Class, graded every possible play in about 5,000 positions for each RogBot. By its judgment RogBot SI finds the best play 78% of the time and gives up 0.0056 points a move: 95 on the review's accuracy scale. RogBot AI scores 76 and RogBot OG 67.

What it doesn't cover: the doubling cube (these games had none), and GNU's strongest settings, 3-ply Grandmaster and rollouts.

And TD-Gammon

Gerald Tesauro's program at IBM, in the early 1990s, is where the training method comes from. It was never released to play against, so the comparison is method and size: as published, TD-Gammon 2.1 had 80 hidden neurons and trained on about 1.5 million games; RockGammon's contact network has 128 and trained on five million. TD-Gammon also fed its network hand-made features of the position and looked further ahead in play; RockGammon's network sees only the raw board. GNU Backgammon, like RockGammon, splits positions by type, into contact, crashed and race networks, where RockGammon has two.

Reading your review

Your chances
Your chance of winning before every turn, shaded above and below 50%. Small squares mark doubles; numbers mark the moments.
Accuracy
How close your plays came to the best ones, out of 100. Each play's error is the equity it gave up against the best, in points per game at a cube of 1, and accuracy is 100 × e−10 × your average error: 0.01 a play scores 90, 0.03 scores 74, 0.07 scores 50. Forced plays don't count.
Best plays
How many of your plays were the best one, within 0.005: “11 of 19”.
Big errors
Mistakes (0.08 or more given up) and blunders (0.16 or more).
Luck
What the dice gave you. For each roll, your chance of winning after the best play of the roll you got, against the average over all 36 rolls, added up for the game. It's about the dice, not your play.
Cube
Your doubling decisions, out of 100: every double, every take or drop, and every turn you could have doubled when it was right or close.
Style
Where you sit between cautious and bold: on each play, how much more or less likely you left yourself to be hit, and whether you hit more or fewer checkers, than the best play. The middle is the network's own play.
Moments
Up to six: each player's worst play if it was a mistake or a blunder, with the better one; the luckiest and unluckiest rolls, if either swung the game by 12% or more; and the two costliest cube errors, like “Missed a double at 68%”.

Checked against GNU Backgammon. On the original RogBot's games, the review's average error was within 1% of GNU Backgammon's World Class judgment, the two correlate at 0.89 play by play, and the review caught three in four of the plays GNU called big errors. Its thresholds for a mistake (0.08) and a blunder (0.16) are GNU's.

The figures are the network's estimates, not certainties, and they're cubeless checker play, not eXtreme Gammon's PR. The reviewer judges each play without looking ahead, so RogBot SI's look-ahead plays can now and then show as small errors.