One game, built properly
This is a book about building one game, properly: a turn-based, ASCII, procedurally generated dungeon crawler with permadeath — the kind the genre has been sharpening for forty years. You begin with a blank SDL3 window and end with a game that carves its own dungeons and grows its own caves, hides them under fog of war, fills them with monsters that hunt you around corners, and pays out a deep, dangerous descent with the three Amulets of SDL. There's no engine and no framework doing the thinking for you — just C++, SDL3 for the window and the pixels, and you. Every chapter ends with a program you can build, run, and play.
Free to read, start to finish
The complete second edition is free to read online, right here — all twenty-seven chapters, no sign-up, no paywall. Start reading →
Every line is introduced before you see it and explained after, never dumped and moved past. Every chapter closes with a Checkpoint (precisely what you should be seeing), a Common Errors section (the ways it tends to break, and the fix), and an FAQ — and ends with the game running, so you're never more than a few pages from something you can play. When you'd like it offline and on your shelf, it's on Amazon as a Kindle ebook and paperback.
What you'll build
- Two dungeon generators: Binary Space Partitioning rooms, and cellular-automata caves
- Recursive-shadowcasting field of view, with fog of war and a remembered map
- Dijkstra-map monster AI that chases around corners and flees when wounded
- Melee, ranged magic (lightning and fireball), the classic identification gamble, equipment, and status effects
- Three data-driven character classes, a plain-text save system, a HUD, a message log, and synthesized sound with no asset files
- A real win condition — and a clean Game / Level / Entity architecture you refactor into shape as you go
The finished engine is small enough to read top to bottom in an afternoon, and the full source for all twenty-seven chapters is on GitHub, one folder per chapter.
Who it's for
Intermediate C++ programmers comfortable with classes, inheritance, smart pointers, and the standard library — no prior game-programming experience required. Newer than that? The companion Learning C++ by Building Games starts you from zero and builds a simpler roguelike this book deliberately goes beyond.
