Author Topic: [DONE] The ziploader  (Read 3174 times)

Offline Stoddard

  • Colonel
  • ****
  • Posts: 485
  • in a fey mood
    • View Profile
    • Linux builds & stuff
[DONE] The ziploader
« on: February 22, 2019, 08:55:29 pm »
The ziploader loads game resources and mods from zip archives in addition to plain old directories.

Game resources are the common directory and the UFO and TFTD directories. These can be put into common.zip, UFO.zip and TFTD.zip respectively, in a datadir. The archives must contain the top level or respective directory - that is common.zip/common/Language is wrong, the code expects common.zip/Language, UFO.zip/GEODATA, etc.

Mods.

A subdirectory is considered a mod if it has a metadata.yml file at its top level.

A zip archive can either contain a single mod, when the metadata.yml file is at the top level, or multiple mods in top level subdirectories. Ones without metadata.yml are ignored.

An example is the standard.zip. It has multiple mods - all the bundled ones in fact.

Mods are identified by their id from metadata.yml. Zip archive and subdirectory names are irrelevant.

It there is a metadata.yml file but it lacks the id attribute, the mod id is taken to be the subdirectory's name. (This should be deprecated and removed).

Removed in OXCE 7.3 (causing a lot more trouble than what it's worth):
Spoiler:
The ziploader supports overriding mod resources and rulesets from the zip archive with ones from a plain directory.

Both the zip and the directory must have the same mod id in their metadata.yml and at most a single zip and a single directory are supported for a given mod id.

First, all rulesets from the zip archive are parsed, then from the directory. Resource files are loaded from the directory and if that does not exist then from the zip.

TODO:
Mod loading order.
Dependencies.
The VFS and ruleset/language/other parsing/lookup rules.
User and Data directory locations and search order.
« Last Edit: February 02, 2023, 09:52:03 pm by Meridian »

niculinux

  • Guest
Re: The ziploader
« Reply #1 on: March 01, 2019, 12:07:41 pm »
Great! Will be a functionality integrated into main executable or separated?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: The ziploader
« Reply #2 on: March 01, 2019, 12:14:02 pm »
Is already integrated. Any build after 2019-01-19.