Discover / Game engine programming / Reading path

Best Books on Game Engine Programming, in Reading Order

@codesherpaBeginner → Intermediate
12
Books
203
Hours
4
Stages
Rate this path

A game engine is a real-time simulation with a hard frame budget, and almost every design decision inside one follows from that constraint. This path starts with the architectural patterns that keep a large real-time codebase from collapsing, establishes the 3D math and data-layout habits everything else depends on, then goes deep on the two halves of engine work — simulating a world through collision, physics and AI, and drawing it through the modern rendering pipeline.

1

The shape of an engine

Intermediate

Understand what subsystems an engine contains, how the main loop coordinates them, and which design patterns exist specifically because a frame has a deadline.

Study plan for this stage

Pace: Six to eight weeks for about 1,380 pages. Game Programming Patterns (327pp) can be read in two weeks — it is short-chaptered, each chapter is a self-contained pattern with a motivating problem, and it is available to read online, so it is easy to keep open beside your editor. Game Engine Architectur

Key concepts
  • The game loop as the organising fact — a fixed frame budget of roughly 16 milliseconds at 60Hz, and the decoupling of a fixed-timestep simulation from a variable-rate render, which Nystrom treats before anything else
  • The component pattern as the answer to the deep-inheritance game object hierarchy, and why entity composition became the industry default
  • Object pools and the general refusal to allocate during a frame: Gregory's memory chapters are about avoiding the allocator, not about using it well
  • Update method, event queue, and the double-buffer pattern, each motivated by a coupling or ordering problem rather than by abstract elegance
  • Gregory's subsystem inventory: platform layer, core systems, resource manager, rendering, animation, collision and physics, gameplay foundation, and tools — the map that the rest of this path fills in
  • Engine startup and shutdown order as a real design problem, since subsystems have dependencies and singletons make them implicit
  • Resources and asset pipelines: the offline build that turns authored assets into runtime-ready binary data, which is half of what an engine actually is
  • The tools layer as a first-class part of the engine rather than an afterthought — Gregory's chapters on this are the least glamorous and among the most useful
You should be able to answer
  • Why is a fixed-timestep simulation with a variable render rate the standard structure, and what specific bugs does a variable-timestep physics step produce?
  • What problem does the component pattern solve that deep inheritance hierarchies do not, and what does it cost?
  • Name the subsystems Gregory identifies and give the one-line responsibility of each. If you cannot do this from memory, you have not finished Part 1.
  • Why do engines pool objects rather than allocating and freeing during a frame? Give both the latency and the fragmentation reason.
  • What does the asset pipeline do between an artist's file and the bytes the runtime loads, and why does that transformation happen offline?
  • Which of Nystrom's patterns does Gregory's production engine appear to use, and where has scale forced a different choice?
Practice
  • Implement a bare game loop with a fixed-timestep accumulator and interpolated rendering, in any language. Fifty lines, and it makes the single most important structural idea in the path concrete.
  • Build a minimal component-based entity system: an entity id, a few component arrays, and systems that iterate them. Keep it — you will rewrite it in the data-oriented stage and the comparison is the lesson.
  • Write an object pool with a free list and benchmark it against your language's allocator in a tight loop. Numbers are more persuasive than the chapter.
  • Draw Gregory's subsystem diagram from memory, then check it against the book and note what you left out. What you forget is usually tooling or the platform layer.
  • Pick one open-source engine and locate its main loop, its entity representation and its resource manager. Mapping a real codebase onto Gregory's vocabulary is the point of having read him.

Next up: You now know what an engine contains and how its frame is organised; the next stage supplies the geometry and the memory-layout habits that every one of those subsystems silently assumes.

Game Programming Patterns
Robert Nystrom · 2011 · 327 pp

Short, free to read online, and the best possible first book: game loop, update method, component, object pool, spatial partition and event queue, each motivated by a real performance or coupling problem. It gives you the vocabulary Gregory then uses at scale.

Game engine architecture
Jason Gregory · 2009 · 1052 pp

The central text of this path — a full tour of a production engine from a Naughty Dog engineer: memory management, resources, the rendering engine, animation, collision, gameplay systems and tooling. Read it second, as the map for everything that follows.

2

The math and the data

Intermediate

Work confidently with vectors, matrices, quaternions and transform hierarchies, and lay out data so the cache — not the algorithm — stops being the bottleneck.

Study plan for this stage

Pace: Eight to ten weeks for about 1,330 pages, and this stage is worked rather than read. 3D Math Primer (476pp) should be done with a pencil — do the exercises, especially the coordinate-space and quaternion ones. Lengyel (545pp) is denser and is best used as the derivation reference: read the chapters

Key concepts
  • Coordinate space conventions — left versus right handed, row versus column vectors, row-major versus column-major storage — and the fact that most transform bugs are convention mismatches rather than math errors
  • The transform hierarchy: object space to world space to view space to clip space, and being able to say what each matrix does and in which order it multiplies
  • Quaternions as an interpolation and gimbal-lock answer rather than a mystery: unit quaternions, composition, slerp, and the conversion to and from matrices
  • The projection matrix and the perspective divide, which Lengyel derives properly and which most programmers use for years without being able to reconstruct
  • Numerical precision in floating point, and Lengyel's and Ericson's shared insistence that geometric predicates fail in practice at coincident and near-degenerate configurations
  • Fabian's core claim: performance is dominated by memory access patterns, so data layout is the design decision and the class hierarchy is an implementation detail
  • Array of structures versus structure of arrays, and the cache-line arithmetic that decides between them for a given access pattern
  • The tension this stage sets up deliberately: Nystrom's patterns organise code around concepts, Fabian organises it around transformations of data, and a real engine chooses per subsystem rather than globally
You should be able to answer
  • Given a point in object space and a chain of parent transforms, write the multiplication that puts it in clip space — and say which convention you are assuming at each step.
  • Why do engines store rotations as quaternions and expose Euler angles in the editor?
  • Derive the perspective projection matrix, or at least explain what each of its entries does and where the divide happens.
  • What is the difference between array-of-structures and structure-of-arrays layout, and how would you decide which a given system needs?
  • Take one system from your component prototype in stage one and describe how Fabian would restructure it. What gets faster and what gets less convenient?
  • Where does Fabian's argument overreach, and which parts of an engine are genuinely better organised around concepts than around data flow?
Practice
  • Write a small vector, matrix and quaternion library from scratch, with tests. This is a rite of passage and it makes every later book readable; do not skip it because libraries exist.
  • Work the coordinate-space exercises in Dunn until you can convert between handedness conventions without hesitating. This is the single most common source of production bugs in this area.
  • Implement slerp and compare it visually against lerp-and-normalise on a rotating object. Seeing the difference beats reading about it.
  • Take your component system from stage one and rewrite one system in structure-of-arrays form, then measure both under a load of ten thousand entities. Record the numbers.
  • Compute the cache-line arithmetic for that system by hand — bytes per entity, entities per line, lines touched per frame — before you measure, then check your prediction against the measurement.
  • Derive one result from Lengyel that you previously used as a formula. One derivation done properly changes how you read the rest of the book.

Next up: With the geometry and the memory layout in hand, the next stage builds the systems that make a world behave — collision, physics and agent behaviour — all of which are geometry problems on a frame budget.

3D math primer for graphics and game development
Fletcher Dunn · 2002 · 476 pp

The friendliest treatment of the geometry an engine runs on, with real attention to coordinate-space conventions and quaternion intuition. Do this before any rendering or physics book, because both assume it silently.

Mathematics for 3D game programming and computer graphics
Eric Lengyel · 2002 · 545 pp

Denser and more complete than Dunn — projections, lighting math, shadow volumes, numerical methods. Read second, when you want the derivations rather than the working rules.

Data-oriented design
Mr Richard Fabian · 2018 · 307 pp

The counterweight to the object-oriented habits the first stage encourages: organise by how memory is accessed, not by how objects are conceptualised. It changes how you would write every system in Gregory's book.

3

Simulating the world

Beginner

Implement broad and narrow phase collision, a constraint-based physics step, and agent behaviour that holds up at frame rate — the systems that make a world feel like it exists.

Study plan for this stage

Pace: Four to five months for about 2,020 pages, and the largest implementation commitment in the path. Real-Time Collision Detection (593pp) is a reference organised by test and should be read in order once for the framework chapters and then used per problem. Game Physics Engine Development (552pp) is a

Key concepts
  • Broad phase versus narrow phase: spatial partitioning or bounding-volume hierarchies to reject most pairs cheaply, then exact tests on the survivors
  • The separating axis theorem as the general tool for convex shapes, and GJK as the alternative when you want distance rather than just overlap
  • Ericson's robustness material, which is the part most implementations skip and most bugs come from: coincident vertices, near-parallel edges, and the difference between exact and floating-point predicates
  • Numerical integration for physics: why explicit Euler blows up, and what semi-implicit and Verlet integration buy at what cost
  • Millington's incremental build: particles, then mass-aggregate systems, then rigid bodies with rotation, then contact generation, then impulse-based resolution — each stage a working simulator
  • Contact resolution and the constraint solver as the hard core of physics: penetration resolution, restitution, friction, and iterative solvers that trade accuracy for a fixed time budget
  • Steering behaviours, A* and navigation meshes as the movement layer of AI, with the mesh being a spatial-partitioning problem you already met in Ericson
  • Decision structures — state machines, behaviour trees, goal-oriented action planning — and the fact that the choice is usually about authorability by designers rather than about intelligence
You should be able to answer
  • Explain the separating axis theorem and apply it by hand to two oriented boxes. What is the axis count and where do the cross-product axes come from?
  • Why does explicit Euler integration gain energy, and what does semi-implicit Euler change to fix it?
  • Walk through Millington's contact resolution: how is penetration removed, how is restitution applied, and why is the solver iterative?
  • What is a bounding volume hierarchy, how is it built, and what makes a good split heuristic?
  • When would you choose a behaviour tree over a state machine, and what does the answer have to do with who authors the behaviour?
  • How would you budget a frame across collision, physics and AI for a scene with a thousand active bodies? Give numbers.
Practice
  • Implement sphere-sphere, sphere-AABB and AABB-AABB tests with tests of your own, then add OBB-OBB via SAT. This is the foundation and it is a weekend.
  • Build a bounding volume hierarchy over a few thousand static objects and measure query times against brute force. The graph you produce is the argument for the whole chapter.
  • Work through Millington's build in order and stop at each milestone with something running: a particle simulator, then a mass-aggregate rope or cloth, then a rigid body that tumbles correctly. Do not skip ahead to rigid bodies.
  • Implement A* over a grid, then over a navigation mesh, and compare path quality and query cost. The mesh version is where the previous stage's geometry pays off.
  • Take one degenerate configuration from Ericson — coplanar faces, a vertex exactly on a plane — and construct a test case that breaks a naive implementation of your own code. Then fix it.
  • Instrument your simulation with per-system frame timings and drive it to the point where it misses a 16ms budget. Then make one system fit by time-slicing rather than by optimising. The distinction is the professional skill.

Next up: The world now behaves; the last stage draws it — and every rendering technique you meet will be an approximation chosen against exactly the same frame budget you have just learned to defend.

Real-Time Collision Detection (The Morgan Kaufmann Series in Interactive 3-D Technology)
Christer Ericson · 2004 · 593 pp

The definitive reference on intersection tests, bounding volume hierarchies, spatial partitioning and the numerical robustness issues that ruin naive implementations. Nothing else covers this ground as carefully.

Game physics engine development
Ian Millington · 2007 · 552 pp

Builds a rigid-body physics engine incrementally — particles, mass aggregates, rotation, contacts, resolution — so the integration and constraint machinery stops being a black box. Read after Ericson, whose tests it consumes.

Artificial intelligence for games
Ian Millington · 2006 · 872 pp

The standard game AI text: steering, pathfinding, decision trees, state machines, goal-oriented planning and tactical analysis, all with real-time cost in mind. The third simulation system every engine needs.

4

Rendering

Beginner

Understand the real-time graphics pipeline end to end — shading models, shadows, global illumination approximations, and the GPU cost of each — and know how the offline theory relates to what ships at sixty frames a second.

Study plan for this stage

Pace: Six months or more for about 3,400 pages, and this stage is a programme rather than a reading list. Fundamentals of Computer Graphics (717pp) is the undergraduate grounding — take it only if graphics is your weakest area, and move through it briskly. Real-Time Rendering (1198pp) is the book to work

Key concepts
  • The rasterisation pipeline stage by stage — vertex processing, clipping, rasterisation, fragment shading, output merger — and what is fixed-function versus programmable on modern hardware
  • The BRDF and the rendering equation as the formal statement of what all of this is approximating, introduced by Shirley and derived rigorously by Pharr
  • Physically based shading in real time: microfacet models, energy conservation, and the metallic-roughness parameterisation that became the industry convention
  • Shadow techniques and their failure modes — shadow maps, cascades, acne, peter-panning, filtering — which is the clearest example in graphics of a technique defined by its artefacts
  • Global illumination approximations: ambient occlusion, light probes, irradiance volumes, screen-space techniques, and lately real-time ray tracing, each trading correctness for a budget
  • GPU architecture as the constraint that decides technique choice — warps and wavefronts, occupancy, bandwidth versus arithmetic, and why divergence is expensive
  • Deferred versus forward rendering, and the tiled and clustered variants, framed as answers to how many lights you can afford
  • Sanglard's archaeology as the closing perspective: an engine shipped on 386-class hardware with no floating point to spare, where every technique is visibly a compromise made by named people under a deadline
You should be able to answer
  • Write the rendering equation and explain each term. Then say which terms a typical real-time renderer approximates and how.
  • What is a microfacet BRDF, and what do the roughness and metallic parameters actually control physically?
  • Explain shadow acne and peter-panning, their causes, and the trade-off between the standard fixes.
  • When would you choose a clustered forward renderer over a deferred one? Answer in terms of light count, material variety and bandwidth.
  • Take one technique from Real-Time Rendering and describe what it costs in bandwidth and in ALU on a modern GPU.
  • In Sanglard's engine, which constraint drove the most design decisions, and what is the equivalent binding constraint today?
Practice
  • Write a software rasteriser: triangle setup, depth buffer, perspective-correct interpolation, and a simple shader. It removes all the mystery from the API layer and takes a week.
  • Implement a physically based shading model in a fragment shader and compare it against the same scene rendered by Pharr's offline path tracer. The difference is exactly the set of approximations you have made.
  • Build shadow maps and then deliberately induce acne and peter-panning, then fix each. Producing the artefacts on purpose teaches more than avoiding them.
  • Work through one full chapter of Physically Based Rendering as source, and modify one integrator so it produces a visibly wrong result you can explain. Understanding a renderer by breaking it in a controlled way is the fastest route.
  • Profile a real frame with a GPU profiler and account for every millisecond. Then remove one technique and predict the saving before measuring it.
  • Finally, return to your stage-one loop and entity system and write the frame budget for a small engine of your own: what each subsystem gets, and why. This one page is the deliverable of the entire path.

Next up: This is the end of the path — architecture, math and data layout, simulation and rendering — and the natural next step is not another book but a small engine of your own, built to a stated frame budget, with Gregory's chapters used as the reference they were written to be.

Fundamentals of Computer Graphics
Peter Shirley · 2002 · 717 pp

The undergraduate grounding: rasterisation, ray tracing, colour, sampling and the graphics pipeline, taught cleanly. Take it first if graphics is the weakest part of your background, then move on quickly.

Real-Time Rendering, Fourth Edition
Tomas Akenine-Möller · 2018 · 1198 pp

The field's central reference, and the book to work through properly: shading, texturing, shadows, global illumination, GPU architecture and every acceleration technique in real use, with an enormous bibliography.

Physically Based Rendering
Matt Pharr · 2004 · 1167 pp

A complete, literate-programming renderer that derives light transport rigorously. Real-time engines approximate what this book computes exactly, so reading it tells you what every approximation is approximating.

Game Engine Black Book
Fabien Sanglard · 2017 · 317 pp

A line-by-line archaeology of a shipped engine built under brutal hardware constraints. A fitting close: it shows all of the above as engineering compromises made by real people against a deadline.

Discussion

Keep reading

Paths that share books, cover the same subject, or open a related topic.

Shares 4 books

The Best Computer Graphics Books, in Order

Beginner10books135 hrs4 stages
Shares 1 book

Learn Godot: The Best Game Engine Books, in Order

Beginner7books46 hrs5 stages
Shares 1 book

Learn Unreal Engine: The Best Game Development Books

Beginner8books77 hrs5 stages
Shares 1 book

Make your first video game

Beginner8books70 hrs4 stages
More on Lisp and Scheme programming

Best Books on Lisp and Scheme Programming, in Reading Order

Intermediate12books142 hrs4 stages

More on game engine programming