← All Retro Games

Retro Games · available now

Retro Backgammon

The neural network from Backgammon-NN — the engine that taught itself to play, then learned from GNU Backgammon — running entirely on a 4-inch colour touch-screen board that costs about €23. No PC, no phone, no Wi-Fi: it weighs up every legal move with the full network and replies in about a tenth of a second.

Project name on GitHub: Backgammon-NN-esp32.

The 4-inch ESP32 board playing Retro Backgammon, with a ruler in front showing it is about 11 cm wide
The real thing: Retro Backgammon on the 4-inch board, about 11 cm across, with the whole computer behind the screen.
Retro Backgammon in the opening: the engine has just replied with double fives, orange marks showing its checkers' moves, and ROLL waiting in the tray
The opening: the engine has answered with double fives (orange marks show its move), and it's your roll. A screen capture from a real game on the board.
Retro Backgammon in the middlegame: one of your checkers on the bar after the engine played double fours, with your winning chances of 43.4% in the status bar
The middlegame: the engine's double fours have put one of your checkers on the bar. The status bar shows the pip counts and your chances, straight from the network.

Play it by touch

  • Tap to move: the checkers you can move are marked, and so is every point they can reach — with one die or several.
  • Moving graphics: the dice tumble, checkers slide, and a hit blot flies to the bar.
  • The doubling cube: double the engine and it takes or drops — or it doubles you, and shows your chances before you decide.
  • Hints for both moves and cube decisions, from the same network.
  • Undo one checker or the whole turn — even back past the engine's reply.
  • Resign a single, gammon or backgammon; the engine accepts only if it doesn't expect to do better by playing on — and it resigns when it's hopeless.
  • Claim a win the same way: the engine concedes only what you'd expect to win anyway. Refuse either way and it says why, with a counter-offer.
  • A running score across games.

What you need

One board: the 4.0-inch ESP32-32E display (model E32R40T, often sold under the Hosyond name) — an ESP32 with a 480 × 320 colour touch screen built in, for about €23. That's all the electronics there is: a 32-bit processor at 240 MHz, 520 KB of RAM and 4 MB of flash, holding the whole game and its neural network.

Or, for a bigger board: the Waveshare ESP32-S3-Touch-LCD-7 — a 7-inch, 800 × 480 capacitive touch screen on a faster ESP32-S3 with 8 MB of extra memory. The same game, scaled up, with no touch calibration needed.

You also need a USB cable to load the game from a PC. After that it runs from a USB power bank or any phone charger.

The back of the ESP32-32E board: the ESP32 module, a microSD slot, a USB-C socket and small connectors including one for a speaker
All the electronics there is, on the back of the screen: the ESP32 module that runs the game and its neural network (the metal can, right), a USB-C socket for power and loading (left), a microSD slot, and connectors including one for a speaker.

How to install

The easy way: straight from this page

  1. Use Chrome or Edge on a PC or Mac (they can talk to USB devices; Firefox and Safari can't).
  2. Plug the board into the computer with a USB cable.
  3. Press Install, pick the board's port from the list, and confirm. It takes about a minute.
Your browser can't install to a board. Open this page in Chrome or Edge on a PC or Mac — or use the firmware file below. Installing needs a secure (https) page — open this page from whittingtonchess.com.

The same button works for both boards: it recognises which one is plugged in and installs the right version.

4-inch board: the first time it starts, touch the four corners when asked, to calibrate the screen. Then roll the dice. If the board doesn't appear in the port list on Windows, install the CH340 USB driver (the board's USB chip) and try again.

7-inch board: plug into the socket marked USB (the one marked UART can't install). If no port appears, hold the BOOT button while plugging in, and unplug and replug the board once it's installed. No calibration needed.

Or download the firmware file

One file per board, written at address 0 with any ESP32 flashing tool — latest release on GitHub. With esptool:

esptool.py --chip esp32 write_flash 0x0 retro-backgammon-1.0.4-e32r40t.bin     # 4-inch
esptool.py --chip esp32s3 write_flash 0x0 retro-backgammon-1.0.4-ws7.bin       # 7-inch

Or build it yourself

The source is on GitHub. With PlatformIO installed, run this in the project folder with the board plugged in:

pio run -e e32r40t -t upload     # 4-inch
pio run -e ws7 -t upload         # 7-inch

The README on GitHub has the full rules of play: every button, the cube and the menu.