Categories
Eldritch 2

Dev’s Journal – 14 Feb 2025

Nothing too exciting to write about today. I decided to deal with some gamedev housecleaning, and began the tedious process of culling old and unused content from the Eldritch 2 repository.

I begin all my game projects by forking a common repository which has a lot of leftover features from various games and game jams I’ve done over the past decade. I’m still pulling in a lot of content from Slayer Shock, which is over 8 years old now. There’s some benefit to that, because it gives me weapons and enemies and other stuff to work with, which helps to jumpstart any new project; but at some point, I have to clean it up. Not only is it wasted space in the game’s package files, but it’s a lot of overhead when I’m scrolling through the game’s scripts and trying to figure out what is actually being used anymore.

I’ve got a tool that will report any unused assets in package files, and that is helpful to identify large categories of unused content; but the more tedious work is cleaning up the scripts. I’d previously interleaved some common enemy and weapon functions with old enemy and weapon definitions, and now I have to carefully review everything I’m culling to be sure I don’t delete something that is still in use. I’ve learned my lesson, and in the future, I’ll make sure that common functions are clearly labeled and placed somewhere far away from specific entity scripts.


While making a dozen or so builds to test these changes, I realized that my audio package files were changing with each build, despite me not touching audio files or configurations. That’s no good. My goal is that I can always make a clean build of the game and end up with bitwise identical output.

Diffing the old and new package files, it was obvious that the changes were occurring in Ogg Vorbis headers; a quick review of that format confirmed that there is a bitstream identifier field in Ogg Vorbis files which is intentionally randomly generated. That’s A Choice They Made, I guess. So I dug through ffmpeg code to find a way to change that behavior (the -bitexact flag fixed it), and I made sure that that random identifier was not needed for my purposes (it’s not—in fact, the stb_vorbis library I’m using simply scans past it).


I need to do some more playtesting this afternoon to make absolutely sure I haven’t broken anything. And the work of cleaning up old content will continue, because there are still a handful of weapons and animations and audio files I’m reusing from old projects until I can replace them. But the repository is already much lighter and cleaner, and I reduced the game’s install size by 35%, and subsequent patches should be smaller now that the audio packages aren’t being randomized. Feels good.