More Game Asset Preprocessing
Rival Fortress Update #3
Last week I talked about the asset preprocessing pipeline that I’m working on for Rival Fortress: essentially all game and engine assets are preprocessed and packed into a single giant file that is optimized for faster loading during runtime.
This week, while tackling font rendering, I’ve refined the asset packer and added a few more features.
Hot reloading assets
The most useful feature is the ability to re-pack and reload assets while the game is running. The code responsible for this is the same that I talked about in the post about hot-swappable modules. This makes for faster iteration times, especially when working on shaders.
The engine can also detect new asset
.PAK files while running and pull them in automatically. I intend to leverage this functionality in the future when I start working on the modding API.
Streamlined asset manifest
I also streamlined the JSON manifest that specifies how game assets should be pre-processed, and it now looks like so:
I’ve also added Materials and Fonts as asset types, but I’m still weighing pro and cons of different font rendering approaches.
Command line interface
While merging the asset packer (that was previously a separate tool) with the main executable I also added command line argument parsing. Now the game executable can start in different modes depending on the command line arguments. For example if I want to run the asset packer as part of the build chain, I can pass the
-t packer argument and the game will behave like a command line tool and won’t initialize all game related sub-systems.