C++

Asset Cooker - Part 2: USN Journals and Fast Startup

I said I would write a second article about Asset Cooker, and here it is! Barely six months later!

Truth is, I couldn’t find a nice way of structuring the article, so I procrastinated a lot. This article doesn’t go too much into details because of that, but hopefully it still has the interesting bits.

And now at least I can blog about something else next!

Asset Cooker icon

Asset Cooker - Part 1: Memory and Storage

A few weeks ago, I released my hobby projet: Asset Cooker. I even made a short release trailer for it.

Asset Cooker icon

So, what is Asset Cooker?

It’s a build system. Put very briefly, it has commands that have inputs and outputs (which are files). If the outputs don’t exist, or if the inputs are modified, it execute the command to (re)generate the outputs.

I don’t plan on describing everything in articles, because that would be too much (and not all of it interesting), but I’ll try to do a few (short?) articles about single topics that I find interesting.

In this first article, I’m going to talk about memory and storage. Asset Cooker has to deal with a lot of items. Hundreds of thousands of files, of commands, and of strings. Managing that carefully is very important.

String Hashes

Strings are often used as identifiers in games: object names, sound effect names, particle type names, etc. They’re a bit like enums with the advantage of allowing your game to be data-driven: you don’t necessarily need to recompile your program to accept new values.

But strings are no fun: storing them efficiently is a headache, they’re bigger and they’re slower than enums.

Fortunately there’s an alternative: string hashes. We like them a lot at Pastagames, and here are our humble solutions to the practical problems that come with them.

Don’t use std::list

I feel like I’ve been saying this a lot lately ‒ at least once per intern we take at Pastagames ‒ so I guess it’s time I write it down. There’s nothing new here, this has been said a hundred times over on the Internet, but since a lot of people are still not aware of it, here is my contribution.