Good If Statements – Self Documenting Code
Here’s a quick trick for documenting those pesky if-statements, especially when littered with complicated mathematics. Here’s an example from Timothy Master’s “Pragmatic Neural Network Recipes in C++”...
View ArticlePreprocessed Strings for Asset IDs
Mick West posted up on his site a really good overview of some different methods for hashing string ids and gave good motivation for optimizing this area early on in a project. Please do review his...
View ArticleEssentials of Software Engineering – With a Game Programming Focus
I’ve been commissioned to write a big document about what I think it means, and what is necessary, to become a good software engineer! If anyone finds the document interesting please do email me (email...
View ArticleTexture Atlases
Texture atlases for 2D games is a great optimization for batching together tons of different sprites (especially quads) with a very few number of draw calls. Making them is a pain. For pixel art or...
View Article2D Collision Detection Library – tinyc2
Collision detection is pretty hard. Making 2D games is pretty fun. Wouldn’t it be nice to make a cool 2D game without fiddly around forever with collisions? With the single-file C header library tinyc2...
View ArticleGame Localization and UTF-8
After some research I have decided a pretty good way to localize your game is to store all text in text files, in UTF-8 format. UTF-8 is super widely used and 100% backwards compatible with ASCII. Also...
View ArticleCharacter Controllers
I created a demo called player2d by implementing a swept 2D character controller, showcasing a bunch of cute_headers in action. There are also a set of slides made for a talk at a local university...
View Articlestd::vector and Minimizing Includes
I like std::vector quite a bit except for a couple side-effects. Here are the side-effects I do not enjoy. Debug builds are slow due to copious debug checks. Constructors and destructors are *always*...
View ArticleBase64 Encoding and some Opinions
Recently I had a need to do some base64 encoding in C. I was hoping to find two functions, one for encode and one for decode. base64 encoding is useful to transmit a byte array over text in a safe...
View ArticleDatastructure APIs in C++
Designing a great data structure API is mostly a grey area with lots of room for opinions. Why care about my opinion? Well, take a peek at some of my headers on GitHub. If you think they might look...
View Article