Game Programming Patterns (2014)
gameprogrammingpatterns.com
gameprogrammingpatterns.com
- https://news.ycombinator.com/item?id=23203699
- https://news.ycombinator.com/item?id=14475489
- https://news.ycombinator.com/item?id=6004885
- https://news.ycombinator.com/item?id=24233229
- https://news.ycombinator.com/item?id=17845334
- https://news.ycombinator.com/item?id=7543158
- https://news.ycombinator.com/item?id=7634734
...
Can we at least get (2014) put in the title when this gets reposted again?
One good thing about HN is quality material can be reposted. The rules say once per year the same topic can be discussed.
Given the absolutely dismal state of higher education and how shittily it prepares students for the workforce, posting books like this regularly for the next generation is very helpful.
- the content is covered more succinctly by the Wikipedia page on programming patterns.
- the content is out of date and doesn’t apply to most modern game engines (yes, it really doesn’t; yes, if you’re implementing flyweight or component yourself you’re writing a game engine not a game).
- it doesn’t cover actual game programming patterns like gpu kernels or blackboards (see for example Ai for Games by Ian Millington for a comparison of a book that gives actually useful advice).
Yes, it’s free.
Yes, it covers basic trivial programming patterns.
I think people can make their own minds up if they think it’s worth their time…
…but, regardless, I think it’s pretty fair to put 2014 into the title.
It’s old, and the advice in it is out of date.
> The goal of this book is not to teach you C++. The samples are kept as simple as possible and don’t represent good C++ style or usage. Read the code samples for the idea being expressed, not the code expressing it.
>
> In particular, the code is not written in “modern” — C++11 or newer — style. It does not use the standard library and rarely uses templates. This makes for “bad” C++ code, but I hope that by keeping it stripped down, it will be more approachable to people coming from C, Objective-C, Java, and other languages.
^ https://gameprogrammingpatterns.com/introduction.html#about-...
For example a pattern that I think is common in low level game programming is to allocate a big chunk of memory containing a many objects and deallocating them all at once when you are done with them, let's say a level with its maps, textures, entities, etc... It doesn't really make sense to pass individual objects (ex: a single texture) using smart pointers because you can't delete them individually, in fact, unless you have overloaded the delete operator, it will crash if you do.
In fact, if you never use raw pointers, I think that you are better off using another language than C++ if you can. Manual memory management is a big part of what gives C and C++ its performance (at a cost). If you don't do that, there are languages with well optimized garbage collectors that will outperform you.
I created a BitmapFilter class [1] it just has an execute abstract function which you override to create your own objects.
For convenience I created a static Filter function that takes a command object and then executes it to return a bitmap.
It means I never have to modify the Bitmap or BitmapEx classes to implement functions that modify the bitmap. Just derive from BitmapFilter’s class and you are up and running!
1. https://opengrok.libreoffice.org/xref/core/include/vcl/Bitma...