Aller au contenu

Multiplayer games with Netcode on the BEAM

30 octobre 2026 · 1 h 13 min

Notes de l’épisode

Hernán Rivas Acosta's first Erlang game server, a football game for Cartoon Network, reached 50,000 concurrent players on one machine. The BEAM didn't stop it there. The OS file descriptor limit did, and the team chose not to raise it. The Java option they had considered would have managed a few thousand.

Roughly fifteen years later, Hernán, now an architect at Erlang Solutions, has put the game loop itself on the BEAM. Spawndemonium, shown at Code BEAM Europe in Haarlem, is a top-down shooter whose simulation is written once in Rust, compiled to WebAssembly, and run both in the browser and inside an Elixir GenServer via Wasmex. Client and server can't disagree about the rules, only about time.

The scar: AstroBeam's 30 Hz tick needed 33.3 ms, the Erlang timer took 33, and lag crept upward through every match. One-minute playtests never caught it. The fix was 40 ticks a second at 25 ms each, plus rewriting every per-tick constant in the game.

With Allen Wyma and Francesco Cesarini, Hernán covers ticks versus timestamps, why jitter breaks more games than latency, how to fake a bad network convincingly, and why the demons in Spawndemonium act on inputs five ticks old.

Topics include:
• From Flash games for Cartoon Network and Nickelodeon to Erlang at 18
• 50,000 TCP connections per machine, capped by file descriptors
• Peer-to-peer anti-cheat built on mutual reporting
• Ticks, tick rate, ping vs latency, and jitter
• Authoritative servers vs peer-to-peer, and Modern Warfare 2's host advantage
• BEAM processes explained through game-engine time slicing
• Why browser games are stuck on TCP via WebSockets
• Borrowing netcode from Gran Turismo for a multiplayer Asteroids
• Delay input, apply and rewind, or meet in the middle
• Clock sync using the smallest round trip
• Simulating jitter with a log-normal distribution and TCP head-of-line blocking
• One server tick: queue inputs, run Wasm, decode binary events, push to sockets
• A custom binary protocol with Elixir pattern matching instead of JSON
• Wasmex vs a Rustler NIF: a crash costs one match, not the node
• Bots as laggy players, deciding moves five ticks ahead
• Small universes vs MMO-scale worlds
• Multiplayer first, game second

Recorded October 26, 2026.

Resources:
Spawndemonium on GitHub: https://github.com/HernanRivasAcosta/SpawnDemonium
Episode 15 — Ellyse Cedeno on MMO servers: https://youtu.be/4MDObD_R5E4
Episode 10 — Florian Gilcher and Leandro Pereira on Rust and Elixir: https://youtu.be/w5Pl09lpSmE
Mat Trudel on Bandit: https://youtu.be/XXQcoz_dTE0

Tous les épisodes de BEAM There, Done That

Paramètres

Affichage

Langue

Détermine les stations affichées en premier sur la page d’accueil.

Historique

Les stations et épisodes écoutés récemment et tes dernières recherches sont seulement enregistrés dans ce navigateur.

Notifications

Un court message quand un podcast que tu suis publie un nouvel épisode. Désactive un podcast précis avec la cloche sur sa page.

Compte

Enregistrez vos favoris – dans l’app et sur le site.

Raccourcis clavier

/
Ouvrir la recherche
Espace
Lecture ou pause
← →
Dans le lecteur : 15 s en arrière, 30 s en avant (épisodes) · dans une rangée : tuile suivante
↑ ↓
Dans une rangée : cible dans la tuile
Début / Fin
Dans une rangée : première ou dernière tuile
Esc
Fermer la fenêtre ou le menu
?
Cet aperçu
En cours de lecture

Voir la station

À suivre

    Ajoutez des épisodes avec « À suivre » – ils seront lus après l'épisode en cours.