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.
"But your roguelike tutorial is free. Why buy the book?"
Because they're two different things. The free series on this site gives you the code. The book gives you the understanding — and understanding is the part you keep for the next game you write.
Here's what the book adds that a web tutorial can't:
- Every line is introduced before you see it and explained after — never dumped and moved past. You don't just type a Dijkstra map; you learn why the monsters path with one flood instead of eight A* searches, why the renderer draws glyphs the way it does, why character classes are data and not subclasses, and why the architecture gets refactored exactly when — and only when — a new feature demands it.
- It's structured like a book, not a blog. 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 for the questions the code always raises. When something misbehaves, the answer is on the page, not buried in a comments thread.
- It's one curated arc, not a scattering of pages. The free series grew part by part; the book is that whole journey rebuilt as a single, coherent read, where each system's payoff for the next is planned and pointed out.
- It's yours. Offline, distraction-free, no ads, no link rot — the complete engine on your shelf and on GitHub, matching the book line for line.
The tutorial teaches you to type a roguelike. The book teaches you to understand one.
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 seventeen 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.