Getting started on data file packages

This week I decided to switch gears and start work on support for data files in the Doomsday 2 package loader.

As planned, the idea is that the various supported data files are each seen by Doomsday as packages. This makes it possible to identify the data files uniquely, save the list of used files in savegames, share the file list in multiplayer games, and also set up game configurations via the Home screen.

In practice, I’ve begun by making the Doomsday 2 file system aware of what these data files (like WADs and PK3s) are and what kind of data they contain. I’m also planning to set up a new way to identify data files based on a set of criteria read from a configuration file.

To be clear, Doomsday already knows how to load these data files. The new functionality is on a higher management level, so that we don’t have to rely on a 3rd party (like the front-end app) to say which files to use.

One interesting opportunity here is to optimize how Doomsday looks for data files at startup. At the moment, all game resources are still located using the old file and resource management code that has some performance challenges. After the new data file package mechanism is working, I can replace this code with more efficient lookups and hopefully we can see a nice improvement in engine startup time.

At the code level, I find it quite enjoyable to continue building on top of the lower-level Doomsday 2 components that have been written over the past years. Perhaps the bottom-up approach just suits me, but it is great when one can solve a higher-level problem by using the existing set of components rather than trying to solve each problem in isolation.