Thought I'd share an update on the project I've worked on this weekend, as it's quite exciting and finally we can easily protect our game assets!
I've been somewhat annoyed since day one about having to distribute unprotected assets with games so far, and although there are some paid wrappers you can use, what would be better than native?
Anyway, with this system, all of your game assets will be combined into a single file, much like the old WAD format.
More specifically, it is a virtual file system where each file (or file set for atlases) is compressed individually into a single archive which is accessed at runtime.
Of course, this process won't deter proper hackers, it's more to prevent casual pilfering of your stuff.
So far, I have got images (including atlases!) and music incorporated. Next will be wav files, objects, shaders and general data files.
There's a slight issue with music (mp3 etc.) as the actual file has to be persisted for playback, but it can be optionally cleared when finished with or will just be cleared up on exit.
While coding this, I even made a compressor/decompressor in tier 1 (!) which wasn't particularly brilliant (600K -> 500K) on an image, but was fun trying.
I've just updated the system to allow for multiple WAD files, which will work better if you want to make one for sound effects, one for images etc. or perhaps even better - to pack level data into single WAD files for efficiency - it will be up to you.
The main thing is that it works and there's only a small initialisation overhead. I can see a couple of areas where it can be sped up, but optimisation comes after functionality.
I could code it using V2 functionality, making it more efficient but for now, it's still V1 compatible.
The WAD generator tool wasn't written in AppGameKit, but in Delphi. You would simply point it at a directory and specify a file which will be a virtual representation of that directory and all subfolders within.
I'll add command line parameters, so you can just batch create your WAD files.
Functions replace existing methods:
LoadImage(file) becomes LoadWadImage(wadID,file)
LoadMusic(file) becomes LoadWadMusic(wadID,file)
etc..
simple as that. The filesystem looks up assets as if they were on the disk as normal, so you don't have to keep updating the WAD during development, just use your media folder as normal, then use the alternative loading method on your release version.