The biggest challenge facing many game programmers is completing their game. Most game projects fizzle out, overwhelmed by the complexity of their own code. Game Programming Patterns tackles that exact problem. Based on years of experience in shipped AAA titles, this book collects proven patterns to untangle and optimize your game, organized as independent recipes so you can pick just the patterns you need.
You will learn how to write a robust game loop, how to organize your entities using components, and take advantage of the CPUs cache to improve your performance. You'll dive deep into how scripting engines encode behavior, how quadtrees and other spatial partitions optimize your engine, and how other classic design patterns can be used in games.
About the Author
Robert Nystrom has programmed professionally for twenty years, about half of which is in games. During his eight years at Electronic Arts, he worked on behemoths like Madden and smaller titles like Henry Hatsworth in the Puzzling Adventure. He's shipped games on the PC, GameCube, PS2, XBox, X360, and DS, but is most proud of the tools and shared libraries he created for others to build on. He loves seeing usable, beautiful code magnify the creative ability of others.
Robert lives with his wife and two daughters in Seattle where you are most likely to find him cooking for his friends and plying them with good beer.
Most helpful customer reviews
103 of 107 people found the following review helpful.
A must-have for any software engineer, game industry or not
By D. Otero
To understand the code and some of the more performance-oriented patterns, you must understand C/C++ pointers and memory model.
This book WILL give you:
- An excellent introduction to good software design and how to think about design issues.
- A great background in the notion of software design "patterns."
- An exploration of some key categories of problem that come up in software, and especially in games.
- A VERY detailed exploration of 19 concrete software patterns that are particularly useful in the hairiest parts of game programming.
This book will NOT:
- Teach you how to program.
- Give you specifics of working with a particular library, language, game engine, or platform.
- Give you a 100% complete architectural blueprint for your next game.
This book is a gem, and should certainly be considered required reading for any new industry or hobbyist software engineer, regardless of whether they work on games.
"Game Programming Patterns" delivers, providing an in-depth look at the core engineering patterns used ubiquitously in games but seldom known outside of the games industry. Each pattern gets a full treatment, including everything from background to motivation to concrete examples of where the pattern would apply and where it might go awry. Each chapter also includes a healthy dose of discussion, including going into the trade-offs between each pattern and other possible approaches.
However, at its core, Game Programming Patterns is about much more than games. I find it to be one of the most accessible and most complete books on Software Design in general. The thorough examination of trade-offs and design decisions makes it a fantastic introduction to "good design" for any programmer. I HIGHLY recommend this, especially to new-ish programmers starting off in their first job (again, regardless of whether or not they work on games).
41 of 43 people found the following review helpful.
Unbelievable game-maker spirit animal guide, now in battery-free print form
By Jack Kelly
I must chime in with the others. This book is a fantastic book for programming in general, not just for games. It has a crystal clear look at how to be the benevolent architect of a very complicated piece of software without getting lost in exactly how your particular language does something. The code samples are technically C++, but are written so cleanly and stripped of all unnecessary parts that it feels like pseudo-code.
Also, you can read the whole thing online right now. It's funny, it's an unbelievable game-maker spirit animal guide, it'll make your code better. Go there, use it, and come back and buy a copy.
I bought the hard copy because I wanted this guy to get something for his incredible effort. Also, it looks pretty, and as he says, "doesn't need batteries". On that note, it's incredibly well typeset and laid out.
I couldn't be happier with the book.
2 of 2 people found the following review helpful.
See all 118 customer reviews...
you may not find any great epiphanies in this book
The book is a well-written resource for anyone interested in high-performance computing and simulations, not just game development.
If you're already well-versed in design patterns or many of the strategies of game and engine development, you may not find any great epiphanies in this book. However, it's likely still a solid read to refresh yourself and perhaps get a new perspective on those solutions you haven't thought about in a while.
For those who are amateur or beginner developers, this can be a great introduction to more advanced design patterns and modes of thought. As well, the topics discussed within the book apply to many problems outside of gaming that any junior programmer would do well to consider.
In either case, the book is full of practical advice that's obviously founded in the author's real-world experience. He managed to write a technical book in a witty and humorous way that should be easily approachable for even the greenest of developers.