Retro Computer Games on ESP32

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
chrisw
Posts: 5137
Joined: Tue Apr 03, 2012 4:28 pm
Location: Digital Nomad. Anywhere but the Western Empire
Full name: Christopher Whittington

Retro Computer Games on ESP32

Post by chrisw »

Retro Games
Remember the hand-held computer games of the 1980s — the little chess, backgammon and checkers machines that sat on the kitchen table and actually thought? Retro Games brings them back, the way they should have been: a real game-playing brain, squeezed onto a cheap microcontroller with a full-colour touch screen.

Everything runs on the board itself — no PC, no phone, no Wi-Fi, no cloud. And the hardware is tiny by today's standards, which is half the fun: getting a strong opponent into a few hundred kilobytes is the same craft those 1980s programmers practised.

ESP32 · 32-bit, 240 MHz
520 KB of RAM
4 MB flash
3–4″ colour touch screen
About €23 of hardware

First release "Backgammon-Neural Net-esp32"

Coming soon, Chess System Tal - Retro - esp32

https://whittingtonchess.com/retro
User avatar
flok
Posts: 628
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Retro Computer Games on ESP32

Post by flok »

https://vanheusden.com/chess/Dog/ also runs on the ESP32, fully equipped with an NNUE and opening book (the opening book sucks).
User avatar
chrisw
Posts: 5137
Joined: Tue Apr 03, 2012 4:28 pm
Location: Digital Nomad. Anywhere but the Western Empire
Full name: Christopher Whittington

Re: Retro Computer Games on ESP32

Post by chrisw »

flok wrote: ↑Thu Oct 01, 2026 9:25 pm https://vanheusden.com/chess/Dog/ also runs on the ESP32, fully equipped with an NNUE and opening book (the opening book sucks).
cool! bitboard or mailbox? P4 esp32?
User avatar
Steve Maughan
Posts: 1380
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: Retro Computer Games on ESP32

Post by Steve Maughan »

This is REALLY cool!
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
User avatar
flok
Posts: 628
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Retro Computer Games on ESP32

Post by flok »

chrisw wrote: ↑Thu Oct 01, 2026 11:11 pm
flok wrote: ↑Thu Oct 01, 2026 9:25 pm https://vanheusden.com/chess/Dog/ also runs on the ESP32, fully equipped with an NNUE and opening book (the opening book sucks).
cool! bitboard or mailbox? P4 esp32?
Bitboard, esp32-S3
I use a slightly modified https://github.com/folkertvanheusden/libchess for movegen
on lichess it plays occasionally and there it reached 1985 elo in classic mode.
I love the esp32 environment: pthreads AND freertos in one go! also a backtrace when things crash, so convenient :-)
User avatar
chrisw
Posts: 5137
Joined: Tue Apr 03, 2012 4:28 pm
Location: Digital Nomad. Anywhere but the Western Empire
Full name: Christopher Whittington

Re: Retro Computer Games on ESP32

Post by chrisw »

flok wrote: ↑Fri Oct 02, 2026 8:05 am
chrisw wrote: ↑Thu Oct 01, 2026 11:11 pm
flok wrote: ↑Thu Oct 01, 2026 9:25 pm https://vanheusden.com/chess/Dog/ also runs on the ESP32, fully equipped with an NNUE and opening book (the opening book sucks).
cool! bitboard or mailbox? P4 esp32?
Bitboard, esp32-S3
I use a slightly modified https://github.com/folkertvanheusden/libchess for movegen
on lichess it plays occasionally and there it reached 1985 elo in classic mode.
I love the esp32 environment: pthreads AND freertos in one go! also a backtrace when things crash, so convenient :-)
You found it possible to do bitboard fast enough using only 32 bit processor? Amazing. And a neural net, even more amazing. I read that the P4 has a 2D GPU on it, so that suggested (to me) that an NN could be possible, but you did it with a S3. Amazing,
For readers, entry level esp32 which runs my backgammon costs 23 euros including the display, the esp32 S3 is about 50 euros and the P4, 100 euros. You can buy the bits and wire them together, but it’s easier to just buy the integrated display and processor all in one device, then all you need is USB power 5V.
User avatar
flok
Posts: 628
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Retro Computer Games on ESP32

Post by flok »

chrisw wrote: ↑Fri Oct 02, 2026 10:37 amYou found it possible to do bitboard fast enough using only 32 bit processor? Amazing. And a neural net, even more amazing.
To be honest it was mostly a "Can I...", but apparently it works not too bad. But I think the ESP32 is capable of more than this:

Code: Select all

===========================
Total time (ms) : 2517
Nodes searched  : 22639
Nodes/second    : 8992
I'm curious what results you will get with your program on it!
User avatar
chrisw
Posts: 5137
Joined: Tue Apr 03, 2012 4:28 pm
Location: Digital Nomad. Anywhere but the Western Empire
Full name: Christopher Whittington

Re: Retro Computer Games on ESP32

Post by chrisw »

flok wrote: ↑Fri Oct 02, 2026 7:28 pm
chrisw wrote: ↑Fri Oct 02, 2026 10:37 amYou found it possible to do bitboard fast enough using only 32 bit processor? Amazing. And a neural net, even more amazing.
To be honest it was mostly a "Can I...", but apparently it works not too bad. But I think the ESP32 is capable of more than this:

Code: Select all

===========================
Total time (ms) : 2517
Nodes searched  : 22639
Nodes/second    : 8992
I'm curious what results you will get with your program on it!
nnue version 54 knps, pesto version much faster, everything is a bit unstable right now (table sizes). is yours with graphics and touch screen, or just uci?
User avatar
chrisw
Posts: 5137
Joined: Tue Apr 03, 2012 4:28 pm
Location: Digital Nomad. Anywhere but the Western Empire
Full name: Christopher Whittington

Re: Retro Computer Games on ESP32

Post by chrisw »

chrisw wrote: ↑Fri Oct 02, 2026 8:19 pm
flok wrote: ↑Fri Oct 02, 2026 7:28 pm
chrisw wrote: ↑Fri Oct 02, 2026 10:37 amYou found it possible to do bitboard fast enough using only 32 bit processor? Amazing. And a neural net, even more amazing.
To be honest it was mostly a "Can I...", but apparently it works not too bad. But I think the ESP32 is capable of more than this:

Code: Select all

===========================
Total time (ms) : 2517
Nodes searched  : 22639
Nodes/second    : 8992
I'm curious what results you will get with your program on it!
nnue version 54 knps, pesto version much faster, everything is a bit unstable right now (table sizes). is yours with graphics and touch screen, or just uci?
bit more stable now:

Speed (CoreS3, 5-second searches):

Code: Select all

Position	PeSTO				NNUE
Opening		62.8 knps (depth 10)		54.0 knps (depth 11)
Middlegame	65.4 knps (depth 10)		53.0 knps (depth 11)
Endgame		97.6 knps (depth 12)		82.4 knps (depth 13)
Elo via PC emulation 2100, am running a match against Graham's weaker engines tonight, direct CoreS3 to PC via USB
User avatar
flok
Posts: 628
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Retro Computer Games on ESP32

Post by flok »

chrisw wrote: ↑Fri Oct 02, 2026 8:19 pm
flok wrote: ↑Fri Oct 02, 2026 7:28 pm
chrisw wrote: ↑Fri Oct 02, 2026 10:37 amYou found it possible to do bitboard fast enough using only 32 bit processor? Amazing. And a neural net, even more amazing.
To be honest it was mostly a "Can I...", but apparently it works not too bad. But I think the ESP32 is capable of more than this:

Code: Select all

===========================
Total time (ms) : 2517
Nodes searched  : 22639
Nodes/second    : 8992
I'm curious what results you will get with your program on it!
nnue version 54 knps, pesto version much faster, everything is a bit unstable right now (table sizes). is yours with graphics and touch screen, or just uci?
UCI and a text-interface:

Image

You can talk UCI via the USB-interface to it and if you connect a TTL to RS232 converter to it, you can use the vt100 interface (or using the -T command line switch on a desktop/laptop).

Image

(old tui)


See also https://vanheusden.com/chess/Dog/esp32.php