这是indexloc提供的服务,不要输入任何密码
Skip to content

Asset pack format #632

@TheJJ

Description

@TheJJ

We need a convention on how a asset pack looks like.

Q: What is an asset pack?
A: A collection of files that provide the engine with data to display.

Q: What is in an asset pack?
A: Some files, proposal:

  • root mod metainformation file ("pack.nfo"?)
    • contains name, author, version of the mod (name =, author =, version =)
    • dependency information (conflicts =, requires =, replaces =)
    • nyan file name to load (load = index.nyan)
    • nyan object name of the mod information (which inherited from Mod) (mod = MyMod)
  • mod data files in arbitrary directory hierarchy
    • images
    • nyan files to add content
    • qml files for adding gui components

example mod pack:

    only enforced file name: pack.nfo
    /
        pack.nfo <- "load = anothermod.nyan; mod = anothermod.MonsterMod"
        anothermod.nyan <- "import tentaclemonster.monster; MonsterMod(Mod)..."
        tentaclemonster/
            monster.nyan
            moving.png
            raping.png
            fleeing.png
            rape.py <- when a mod registers >=1 py file, it's a "code mod" that displays a big red ! if not signed by openage-authors.

nfo format idea:

name: (identifier) (must equal folder name?) (identifier in oa mod repository)
version: (major.minor.patch)
    
provides: (list of [identifier (= version)]))
conflicts: (list of [identifiers ((>=, <=) version)])
requires: (list of [identifiers ((>=, <=) version)])
    
description: <human-readable>
url: <mod homepage>
license: (license name or url or whatever)
authors: username <mail>, anotherguy <moremail>
    
load: folder/somedata.nyan
mod: folder.somedata.ModObject

examples and further ideas:

vanilla/pack.cfg:

name: vanilla
version: 1.0.0
provides: base
conflicts: sftflavouredvanilla
description: converted from AoC by openage alpha 1.2.3
url: http://openage.sft.mx
license: proprietary
authors: ensemble studios (via openage.convert)

load: data/main.nyan
mod: data.main.Main

villageroverhaul/pack.cfg:

modname: villageroverhaul
version: 4.2
requires: base   # you could also write 'requires: vanilla'.
description: makes your villager so much better you'll never want to play stock oa again!
url: http://forum.openage.sft.mx/mods/villager_overhaul

load: villager/mod.nyan
mod: villager.mod.BetterVillager

== not part of this task, just for your understanding: ==
When the mod is enabled, the whole mod pack will be mounted as /$modname/{contents_of_the_pack}.

Afterwards, the .nyan file denoted to load in pack.nfo is parsed (which will then read all imported other .nyan files), loaded and checked for errors.

Then, the mod is activated by applying all the patches denoted in the Mod object referenced in the metadata file. This will actually initially modify the game data tree and "install" the mod.
== end of just-to-understand section ==


Basically, please design and implement the above in openage/pack/ so that we have a Python class Pack we can create for a mod pack like somemod = Pack("path/to/the/mod/pack/").

Then somemod.name returns the name, somemod.patches returns the name of the nyan patches, and so on.

edit: use .nfo instead of .oam :)

These packs are then loaded and managed by the mod loader.

Metadata

Metadata

Assignees

Labels

area: assetsInvolved with assets (images, sounds, ...)just do itYou can start working on this, there should be nothing left to discusslang: pythonDone in Python codenice new thing ☺A new feature that was not there before

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions