You've built the machinery that every game runs on, from a blank file. This appendix points to where each thread leads, if you'd like to pull it further: the libraries that do these jobs at full scale, the engines built on top of them, and the books that go deeper than this one could. Then it names the people the ideas came from, chapter by chapter.
Take the Pieces Further
Physics. Chapter 20's engine is a real one, if a small one. The best-known 2D engine is Box2D, by Erin Catto, which has been behind a great many games, Angry Birds among them. In 3D, Jolt, Bullet and PhysX are the big three. Reading Box2D's source with Chapter 20 fresh in your mind is one of the best things you can do next. You'll recognize the impulses, the fixed step and the broad phase, made sturdy for the real world.
Rendering. Part 7 wrote a rasterizer to understand the pipeline, and a real game hands that pipeline to the graphics card. The next step is a graphics API. OpenGL is the gentlest, and it maps almost one to one onto what you built: its perspective matrix is Chapter 30's, its depth buffer is Chapter 33's, and it divides by w as Chapter 30 does. From there, Vulkan, Direct3D 12, Metal and the portable WebGPU trade simplicity for control. Everything you learned about the model, view and projection matrices, culling and texturing carries straight over. Only the work moves onto the hardware.
Pathfinding. Chapter 23's A* is the foundation. Beyond it are navigation meshes, for worlds that aren't grids, and hierarchical and jump point search, which find paths faster on big maps. Flow fields move crowds, much as Chapter 22's distances can. Recast and Detour is the standard open-source toolkit for navigation meshes.
Space. Chapter 19 sorted things into a grid, and weighed it against a quadtree. The family goes on, with k-d trees, bounding volume hierarchies and BSP trees. Each trades the cost of building it against the speed of asking it questions, for a different shape of scene.
Climb the Stack
If your goal is to ship a game, rather than to see inside one, an engine gives you all of this and more. Now you'll understand what it's doing underneath:
- Godot is free, open source and friendly, and small enough to read.
- Unity is the most widely used, with a vast store of assets and tutorials. Its
Vector3and its raycasts are the ones you've built. - Unreal Engine has the most advanced rendering and tools, with C++ at its core.
The fundamentals don't make an engine unnecessary. They make you good at using one, because its tools stop being magic.
Read Deeper
Here's a short shelf, roughly in the order the book's topics arrive:
- Fletcher Dunn and Ian Parberry, 3D Math Primer for Graphics and Game Development. The natural next book: the same vectors, matrices and quaternions, taken further and more formally.
- Ian Millington, Game Physics Engine Development. A physics engine built properly, from particles to rigid bodies and contacts. It's the sequel to Chapter 20.
- Christer Ericson, Real-Time Collision Detection. The reference for Parts 3 and 4: every intersection test, done carefully and fast.
- Robert Nystrom, Game Programming Patterns. Not math, but the architecture that holds a game together, from the game loop to components. It's free to read online, and beautifully written.
- Tomas Akenine-Möller, Eric Haines and Naty Hoffman, Real-Time Rendering. Part 7's pipeline, at its full depth.
- Eric Lengyel, Foundations of Game Engine Development, Volume 1: Mathematics. The same mathematics, as an engine builder needs it.
- Jason Gregory, Game Engine Architecture. How all of it fits together into a real engine.
Online, Glenn Fiedler's Fix Your Timestep!, at gafferongames.com, is the classic account of Chapter 20's fixed step. Amit Patel's Red Blob Games explains pathfinding and grids with pictures you can play with. Inigo Quilez writes about graphics and the math behind it. Casey Muratori's Handmade Hero builds a whole game from nothing, on video, and Fabien Sanglard's code reviews take famous games apart. Like this book, they all show rather than tell.
Where the Ideas Came From
Every idea in this book was someone's discovery first. These are the papers where the chapters' algorithms began, and the books they're best read in:
- Chapter 9. Steering behaviors are Craig Reynolds's, from Steering Behaviors for Autonomous Characters (Game Developers Conference, 1999). They grew out of his flocking boids, whose paper is Flocks, Herds, and Schools: A Distributed Behavioral Model (SIGGRAPH 1987).
- Chapter 14. Bezier curves come from two engineers in France's car industry, around 1960: Pierre Bézier at Renault and Paul de Casteljau at Citroën. The spline through the points is Edwin Catmull and Raphael Rom's, from A Class of Local Interpolating Splines (1974).
- Chapter 16. The separating axis theorem is a classic result about convex shapes. Its use in collision detection is covered fully in Ericson's Real-Time Collision Detection (2005).
- Chapter 17. The slab test for a ray against a box is usually credited to Timothy Kay and James Kajiya, from Ray Tracing Complex Scenes (SIGGRAPH, 1986). Ericson's book covers swept tests and the time of impact.
- Chapter 19. Quadtrees are Raphael Finkel and Jon Bentley's, from Quad Trees: A Data Structure for Retrieval on Composite Keys (1974). Spatial hashing for collision is described well in Matthias Teschner and others' Optimized Spatial Hashing for Collision Detection of Deformable Objects (2003).
- Chapter 20. The fixed step with an accumulator was made popular by Glenn Fiedler's Fix Your Timestep!. Impulse-based collision response follows Erin Catto's work on Box2D.
- Chapter 21. Coherent noise is Ken Perlin's, from An Image Synthesizer (SIGGRAPH, 1985), and his simplex noise (2001) improves on it. Adding octaves together is called fractional Brownian motion.
- Chapter 22. Shortest paths on weighted graphs are Edsger Dijkstra's, from A Note on Two Problems in Connexion with Graphs (1959).
- Chapter 23. A* is Peter Hart, Nils Nilsson and Bertram Raphael's, from A Formal Basis for the Heuristic Determination of Minimum Cost Paths (1968). Weighted A*, which trades the best path for speed, goes back to Ira Pohl (1970).
- Chapter 34. Perspective-correct interpolation is covered by Paul Heckbert and Henry Moreton, in Interpolation for Polygon Texture Mapping and Shading (1991). Akenine-Möller, Haines and Hoffman's Real-Time Rendering covers the whole pipeline.
- Chapter 35. Quaternions are William Rowan Hamilton's, from 1843. Using them to blend turns smoothly is Ken Shoemake's, from Animating Rotation with Quaternion Curves (SIGGRAPH, 1985).
Most of these papers are short, and easy to find. With the chapter behind you, the original is often clearer than you'd expect.
And Build the Games
The first book in this series, Learning C++ by Building Games, is where the mathematics you now own goes to become games. Its games run from a bouncing ball and a space invader to a runner, and at last to Rogue SDL, a roguelike. It's written in the same voice as this book. If you came here from that book, you've now seen the machinery beneath it. If you came here first, that book is where you learn to put the machinery together into something people can play. And Using C++ to Build a Traditional Roguelike builds one game, a whole dungeon crawler, from an empty window to the end.
But the most important thing you can do next is smaller than any of this. Pick one idea from this book that excited you, and build one small thing around it. A particle toy, a top-down mover that slides along walls, a wireframe model viewer or a maze solver will do. Make it yours. The demos in this book were small on purpose. The understanding isn't.
