Author Topic: The ziploader  (Read 607 times)

Offline Stoddard

  • Colonel
  • ****
  • Posts: 457
  • in a fey mood
    • View Profile
    • Linux builds & stuff
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).

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.

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?

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5463
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: The ziploader
« Reply #2 on: March 01, 2019, 12:14:02 pm »
Is already integrated. Any build after 2019-01-19.