Deep Kranzky

Kranzky's Dairy

2021-05-12

The lockdown gamejam went swimmingly; I finished all of the gameplay work that I intended to do, and I shipped the game to alpha testers on Itch, adding both Windows and Mac builds. Feedback has been positive so far.

More recently, I’ve refactored the code to integrate Flecs, an entity-component system, which has helped to clean up the codebase enormously, and which will make it easier to build more complicated game systems.

I also lost a day to Linux in an attempt to get a build out; I’ve installed Debian 7 on two VMs (32-bit and 64-bit) and have a binary built, but the VMs won’t run the game due to a lack of support for the GL calls I’m making, so I’ll need to test that by installing a more modern Linux on my PC. But with installing Linux, programming in vanilla C and re-watching Serial Experiments Lain, it’s like I’ve been transported back to the year 2000.

Speaking of, I’ve been learning a bit about “Modern C”, and the differences between C11, C99 and ANSI C, which is what I learned back in the nineties. Most notable are three features that I’ve come to rely on:

I’ll also make sure to use inline functions where it makes sense to do so. And the other C99 features, such as single-line comments and a proper boolean type, are hardly worth mentioning.

Another change to how I used to write C is a preference for pass-by-value and return-by-value instead of by reference. Which means fewer pointers and less manual memory allocation. These days it can be faster to use immediate values than references for small structures, and compilers will copy the data into registers. Nice!