Resource module for resource pack system

edited June 2014 in Help request
Hi, everyone. I'm considering implementing a "resource pack" or "skin" system for our game. The idea is to be able to easily switch between different sets of both config files and textures, ideally on the fly. Some items will stay the same, but others will be changed per resource pack.

I was looking at the new resource module for this and thinking this design might be good:

- Deploy different versions of specific config/textures in different .zip files with the game. The resource files would have identical names in the different .zip files.
- Set a default resource .zip in the [Resource] config section.
- Handle loading .zip resource type like in the resource tutorial. Load the default resource pack this way when the game starts.

- Include a menu option to allow toggling between resource packs.
- When the user selects a different resource pack from the menu
-- Update the config [Resource] section with the new path.
-- Call orxResource_ReloadStorage to update it.

This should switch the storage so all further orx operations now look in the new .zip file for config includes and textures, right?

Any problems with or comments on this approach?

Comments

  • edited June 2014
    That sounds like a good approach.

    However this will only works if all the values are overridden in all the skin packs. Otherwise you might need to clean the config data stored in memory before reloading the storage and accessing the new resources.

    I'd like to point out that this approach would work no matter the actual storage, zip files are convenient for released projects, but for dev purposes it'd work as well with separate folders.

    As for the resource tutorial, I've package the zip handling into a single source file if anyone needs it.
Sign In or Register to comment.