Game Programming Patterns: Leveling up!

Quick info

Name: Game Programming Patterns

TL;DR: Great book. Must read, keep and recommend.

Author: Bob Nystrom aka @munificentbob

Genre: programming

Language: C++ (but should be easy to follow with a moderate knowledge of Java or C#)

Available at:




[Disclaimer: all images in this post belong to Bob Nystrom, and he holds the rights over them. I am not associated with him nor do I get paid in any way to write this review]



Linked lists are a constant discussion in c# questions in Stackoverflow. Basically “What is a linked list” and “Why should I use one”.

Every now and then, I get far enough in a project so that I get too confident in my skills, increase my coding speed disregarding any “thinking time” because I already did my “game design” and end making a mess of what at first was beautiful code usually forcing me to discard my work if I realize it soon enough or to keep going until is too late to get back if I don’t.

What I thought was a brilliant solution to my problem is now junk code that trashes my code-base and makes my work (and thus my life) harder. This kind of situation is very common for me because unlike some developers I seem to have a gene focused on making me stupid, so I usually look for books on design patterns to learn and improve myself so after each project I don’t have to tell myself “It was not that bad, at least it’s working!”, which ovbiously is a lie since it was really bad.

Reading this book has helped me fix some problems with a few current projects, be it by providing advice and examples or by telling me to stop doing what I was doing, so I wanted to give a little back in the form of my first book review.


Game Programming Patterns are good!

But they can also be hard to grasp and harder to implement. Design patterns are well structured and better tested code patterns that offer a solution to a common problem; you need to queue commands for an object: there is a pattern for that; you need a message system for communicating between layers of your project: there is a pattern for that; you need a system to reuse objects and minimize used memory: you get where I am going, don’t you?


The command pattern seems useful until you discover you can undo/redo with it. Then you just look for excuses to use it…

Design patterns have existed since a long time ago and of course they exist for games too, but implementing them takes more time than “a quick dirty fix made in 5 minutes that I will remove in a few days when I have a little more time”. Which is never, and the reason I have comments in my code asking for forgiveness to my future self.

To avoid this situation you need to be aware that design patterns do exist and this book does a great job helping you with that. That is why I have to talk about the


Book Structure

Apart from the introduction, the book is composed of 5 classification groups, and a number of game design patterns in each one. Each pattern can be read as a standalone mini-book, and inside of each one there is magic.

The fact that each pattern chapter is independent was a little surprise, just not used to it, but the big surprise was all the work and care that has been put into each pattern explanation: each chapter is divided in sections that provide intention, context through an example, pattern explanation, pattern implementation and examples, and then loads of tips and advice for different context or situations with pros and cons, links to another patterns, explanatory comments and more.


Easy to follow

This standalone chapter structure makes it easy to search for a certain pattern: you can check for a pattern inside the appropiate category and read it without worrying about any other thing in the book. From there, if you need it you can follow the author links to any related pattern.

Also, the author alternates comments and explanations that make the chapter easier to follow. It is not uncommon at all but it is hard to do it well. The author puts a little bit of humor which makes the reading more relaxed but the book does not become a joke.


A sense of humor is necessary for survival. Just try not to get lots of badges like this one…

One thing that I loved was that the examples were working game snippets. It is nice reading a programming book that does not talk about accounting, employee management or some boring stuff (to the right people it is very important stuff! Not trying to start a war between game developers and accountants! ;) I. Having examples from different game situations helped a lot to understand the context and the necessity of the pattern.


For Unity

I code mostly in C# for Unity, but even if the book code is C++ it is simple enough to be followed with a moderate knowledge of Java or C#. Also take in account that for better or worse Unity forces you to use a few of the patterns from this book like the Update pattern and the Component pattern. Net gives you events from the get go and with a little care they are a really powerful tool.

Lately there is a lot of people working with Unity so some of this books patterns can be found in the asset store in the form of plugins (like the State pattern of Playmaker) or in the forums or the wiki (like the Service Locator pattern of the Grid). Check and double check to be sure you actually need to implement the pattern yourself.



I am not one to put a score on a book, I can only say how much I liked it. And I liked it a lot: it was easy and fun to read but at the same time I learnt a lot from it. I think anyone interested in improving their code and design quality should learn about design patterns, and this book is a great tool to do so. I can only imagine the amount of work that has been invested in this book and I absolutely recomend it.



Now I dream of infinite forests. Maybe I’ll make an original game about a few soldiers in hi-tech bikes chasing after a woman with a case of bad bed-hair between a never-ending number of trees…

Thanks for reading this far,

– Leire –


Leave a Reply

Your email address will not be published. Required fields are marked *