Skip to content

Implement complete mod loading through -mod #3022

Description

@Jaredl-Dev

The game already supports -mod, but the current implementation is too limited to replace placing mod files directly in the game directory.

parseMod retains only one file path in m_modBIG and one directory in m_modDir. Repeating -mod therefore replaces the previous value of the same type.

A mod directory also loads only *.big archives. Loose files inside it are ignored.

Proposed behavior

Allow -mod to be repeated to create an ordered mod stack:

generalszh.exe ^
    -mod "D:\Mods\Example\Mod1.big" ^
    -mod "D:\Mods\Example\Mod2.big" ^
    -mod "D:\Mods\Example\Mod3Directory"

Each argument should add a content layer:

  • A file is mounted as a BIG archive.
  • A directory exposes its loose files and retains recursive BIG archive loading.
  • Later layers override earlier ones: Mod3Directory > Mod2.big > Mod1.big.

The layers should be mounted after the low-level filesystems are initialized but before GameData and other mod-sensitive resources are loaded. GameEngine::init currently mounts -mod after GlobalData initialization. As a result, modded GameData is loaded too late, and modded SCB files are unavailable when GlobalData::generateExeCRC calculates the compatibility CRC.

Explicit mod layers should have deterministic precedence over physical loose files and normal game archives. Missing or invalid mod paths should also produce a visible startup error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions