Game Programming Patterns

· Genever Benning
238 reviews

About this ebook

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.

Ratings and reviews

238 reviews
August 18, 2021
Nystrom's Game Programming Patterns is easily one of the better programming books around. These logic patterns came from his experiences as a professional programmer and are an invaluable shortcut for the rest of us. I could point out that he has not invented these patterns so much as provided a name and discussed the practicality of their use. For example, his "Subclass Sandbox" pattern is basically the inevitable result of object-oriented polymorphism at work. Further, I worry that thinking in patterns may hobble problem-solving creativity, despite the inevitability of these patterns meaning that you would end up reinventing the wheel not to know of them. However, neither of these nitpicks really diminish the usefulness of the book. It has proven core to establishing communication between game developers and will save you a lot of time. Nystrom provides a free online copy to read; buying copies of the book is somewhat a formality to thank him for his efforts.
11 people found this review helpful
Did you find this helpful?
Loïck Jeanneret
October 11, 2018
This was the first time I read a book in the 5 past years and it was amazing, it has cool concepts and manages to keep you interested with small fun notes from the author. If you ever tried to make even a small game "from scratch" without using some kind of framework and know a bit of C++ you will probably fall in love with this book. I cannot wait to start a new project and try to apply some of the concepts presented in this book in the wild! I definitely recommend it to everyone who wants to try to write clearer code, even if it's not directly related to games.
117 people found this review helpful
Did you find this helpful?
Alex Barber
March 26, 2018
This is an excellent book documenting design patterns that are very handy in C++ (or similar OOP languages) game engine programming, and I'd recommend it to anybody in the field. That said, the book doesn't cover much in the way of modern C++ (beyond very basic C++11), so I'd recommend reading some literature on that as well. Also, to a very new programmer, this book is likely to give you a complex about CPU prefetch optimization. Don't worry about that until you're up and running.
119 people found this review helpful
Did you find this helpful?

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.

Rate this ebook

Tell us what you think.

Reading information

Smartphones and tablets
Install the Google Play Books app for Android and iPad/iPhone. It syncs automatically with your account and allows you to read online or offline wherever you are.
Laptops and computers
You can listen to audiobooks purchased on Google Play using your computer's web browser.
eReaders and other devices
To read on e-ink devices like Kobo eReaders, you'll need to download a file and transfer it to your device. Follow the detailed Help Center instructions to transfer the files to supported eReaders.