Using C++ to Build a Traditional Roguelike
From an empty window to a finished dungeon crawler, with SDL 3. The complete second edition — free to read online.
Reading online is completely free — browse the contents below and start anywhere. Prefer it on your shelf or your Kindle? It's on Amazon too.
A few screens from the book — a glimpse of the game you'll build.




Build a complete, winnable roguelike in modern C++ — one game, across twenty-seven chapters, every one ending in a program you can compile, run and play. It's a traditional roguelike: turn-based, grid-based, drawn in ASCII, with dungeons that are different every run and death that is permanent. No engine, no framework doing the thinking for you — just C++, SDL 3 for the window and the pixels, and you. You type every line, and you understand every line. The whole second edition is free to read online.
What you'll build
Contents
Twenty-seven chapters and three appendices, every one free to read online. Start at the beginning, or jump to whatever you want to see first.
Before the code: what you're building, why a roguelike, and how to get the most from the book.
From a blank window to a lit dungeon you can walk, built on an architecture that lasts the whole book.
The systems that make it a game: pathfinding AI, items, equipment, effects, deeper floors and saving.
More ways to generate, explore and fight across a deeper, stranger dungeon.
The feel, the sound, a way to win — and a bot that plays the whole thing for you.
Setup, other platforms, and a place to look things up.
Part of the series
Learning C++ by Building Games →
New to C++? Start here — the language from a blank file, one game at a time. Free to read online, and its finale is a taste of this book's genre.
Fundamentals →
The math every engine hides — vectors, physics, pathfinding and a software 3D renderer, built from scratch.
Building C++ Games with AI →
You bring the vision, the AI writes the C++, and you direct it all the way to finished.
