Skip to content

Specs:Content Loading

dekarrin edited this page Feb 24, 2013 · 9 revisions

The content loading system for Yuuki uses selective resource loading from collections of resources called content packs. Every content pack is located in either a directory or a ZIP archive. Because the content loading system can load from a ZIP archive, built-in content may be distributed with Yuuki inside of the game JAR file.

The engine begins by loading all built-in content located in the directory yuuki/resource within the package structure. This is done regardless of whether Yuuki is executed from inside a JAR file. Next, the engine scans for a directory called ../mods relative the package structure root; this will be the same folder that contains the JAR file if the engine is being executed from inside of one. If the mods directory exists, it is scanned for mod directories and/or archives, which, if valid, are loaded into memory, but not yet merged with existing content. Mod Loader use cases

Mod loading adds a view to the options screen that allows users to enable and disable mods. The view displays the detected mods and provides a check box for each that controls enabling and disabling. Mod activation UI

When a mod is enabled, its content is added to the current working content set. If it contains duplicate definitions, the old definitions are masked by the new ones.

When a mod is disabled, its content is subtracted from the current working content set. If any content was masked by the content being removed, it is then unmasked.