A Dwarf Fortress Clone In Elixir: A Story Of Doing It Wrong
summary
Built a Dwarf Fortress–style world as many GenServer processes with a global registry, PE timer heartbeats and gen_stage-ish event wiring, then discovers the system breaks: a graph generator is sped up by switching a costly flat_map copy to reduce and linked-list concat, heavy synchronous calls cause dining-philosophers deadlocks so architecture shifts to tell-don't-ask and single source of truth, broadcasting 15–20k ticks and N^2 events exposes that mailbox growth increases send cost and Linux OOM kills the server after ~90 minutes, so fixes include bounded ticks, backpressure and a RAM-based birth throttle.
AI-written summary · about
chapters (12)
- 0:00Introduction and theme
- 3:39What is a MUD and Dwarf Fortress
- 5:49Roadmap and bad ideas
- 6:32Algorithm improvement lessons
- 8:59Extreme local states pitfalls
- 12:33Distributed state trade-offs
- 15:42BEAM VM schedulers impact
- 19:33Flooding processes with messages
- 26:44Actors are single-threaded
- 27:07Out of memory killer surprises
- 32:14Yak shaving and open source
- 36:15Q&A session
related talks
06mLT: Elixir for Gaming! Using Network to Power a Sophisticated Multiplayer Simulation
35mBuilding Game Engines in Elixir
50mStar Trek: revisited in Lua and Erlang
05mTicks, Elixir and Gaming
50mDomain-driven Game Design
53mBuilding a Doom-Like World to Explore Agentic Systems
05mGameDev in Elixir using ECS and Live View
29mBuilding a Game Engine for 300 DEFCON Hackers to Smash
