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
108 of 112 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).
43 of 45 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 120 customer reviews...
Well written, Informative, and On-Topic
By Garry L. Hurley Jr.
For those writing games or other high-performance applications, this is a good book on design patterns that are useful in every application. After reading it through, I realized some of the patterns I have been using without realizing it. There are numerous references to other books, including the 'Gang of Four' book on Design Patterns, which will go over many of the topics mentioned here in more detail. In fact, before jumping into the Gang of Four, this might be a good book to read, as Robert Nystrom goes into depth on how some of the patterns are and are not suited for games. I have found that many business programs would also benefit from some of these patterns - batch programs specifically - because of their emphasis on performance trade-offs with code maintainability, reuse, and extensibility. If you are a budding software architect or a software developer looking to understand why certain algorithms and design aspects look familiar, this book will work for you. If you are a more experienced programmer looking to put names on the logical patterns you have used most of your career, this book will help you to do that.
Many of us get into programming because we want to write games. Some of us go through with that, while others take other jobs to pay the bills. No matter which type of person you are, Game Programming Patterns is a definite keeper in your library or on your Kindle