HackerTube.live
Books / Programming

THE READING ROOM / BOOK GUIDE

Game Programming Patterns

Robert Nystrom

A guide to the design ideas behind game code, built from the practical problems of loops, objects and state.

About the book

Robert Nystrom's Game Programming Patterns examines the recurring design decisions that shape game code. It treats patterns as answers to specific pressures: a loop that must run at a steady rate, objects that need to be created and destroyed cheaply, input that must be read without tangling the rest of the program. Each idea is paired with the problem that motivates it, followed by how the pattern addresses that problem and what it costs.

The book is written for people who have written some code and want to understand why experienced game developers organise programs the way they do. It sits between general software design literature and engine-specific documentation. Patterns such as component-based objects, state machines and update loops appear because games make particular demands on performance and structure, and those demands stay in view throughout. Patterns are not presented as universal rules.

Nystrom tends to present a naive approach first, show where it breaks down, and then introduce a pattern as a response. That sequence makes the reasoning visible and gives readers a way to judge whether a given pattern fits their own situation.

How to read it

Read with a code editor open, or at least a notebook. The patterns become clearer when you sketch the before-and-after versions of a small program. The book rewards readers who pause to ask how each pattern would change a project they already know.

The prose is direct and example-driven, with code samples in a C-like style. Readers unfamiliar with that syntax can still follow the arguments, but some passages assume comfort with classes, pointers and memory. The chapters are largely self-contained, so dipping into the patterns relevant to a current problem works well. Reading in order builds a fuller picture of how the ideas relate.

Who it suits

This suits hobbyist and early-career game programmers who can write code but have not yet developed a vocabulary for structure. It also helps developers from other software backgrounds who are moving into games and want to understand why game code often looks different. Teachers and team leads may find the problem-first framing useful for explaining design choices to others.

Reading considerations

The examples reflect the concerns of their time, and some engine-specific details will date as tooling changes. Readers working in a modern engine may find that parts of the book describe problems the engine already solves, which makes the underlying reasoning more valuable than any single implementation.

Follow the HN conversation

120 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.

Search HN comments about this book ↗

Explore videos on the same subject ↗

Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.