The manifest and lifecycle
Everything a mod says about itself is in axiom.toml, beside its mod.wasm. The host reads it before
it reads the binary, refuses a mod whose manifest does not hold up, and starts the ones that do in
the phase they asked for.
The manifest
This is the manifest of the overlay test mod, which draws a panel of every kind in the Axiom Sandbox.
id = "com.axiommods.mods.overlay-test" name = "Overlay Test" version = "0.2.0" tier = "wasm" phase = "runtime" [capabilities] require = ["frame@1", "ui.overlay@1", "config@1"] [targets] game = "axiom.sandbox" builds = ">=0.1.0" [[config]] key = "speed" label = "Speed" kind = "number" min = 0 max = 10 step = 1 [[config]] key = "grid" label = "Show grid" kind = "toggle" [[config]] key = "theme" label = "Theme" kind = "choice" options = ["dark", "light"]
A key the reader does not know is a fault, not something ignored, and every fault is reported at
once rather than the first. axiom check runs the same reader, and with --surface it also checks
each capability name against the import list the surface generated.
Dependencies and order
after = ["io.github.alice.hudkit"] conflicts = ["io.github.bob.old-traffic"] [dependencies] "io.github.alice.trafficlib" = "^1.2.0" "io.github.alice.icons" = "*"
- dependencies must be installed, at a version the range allows, or the mod does not load. Install
brings them along and asks about the whole graph at once. A range is written as on
Signing and publishing:
^1.2.0,>=1.2.0 <2.0.0,*. - after orders this mod after another when both are enabled, and is not a dependency: a mod that is absent is no reason to refuse.
- conflicts refuses to run beside another mod. A mod cannot conflict with itself.
A dependency cannot be a pack: packs are installed for a game, never brought in by a mod.
Which game and build
targets.game is the game's key, vendor.game, such as colossalorder.citiesskylines or
axiom.sandbox. targets.builds is a constraint on that game's own build numbers, which are not
semantic versions and are compared only with builds of the same game. A build with a letter in it,
like Cities: Skylines' 1.21.1-f9, is matched exactly: write builds = "1.21.1-f9", because a range
against it is refused. A mod for another game, or a build this install is not, is refused before it
runs.
Tiers
The manifest accepts three tiers, and only one runs.
- wasm runs today, in the Axiom Sandbox, on the Unity backend and on the headless backend. It is sandboxed: a mod imports only what it declared, pays for each call in fuel, and can be stopped and started while the game runs.
- native is accepted by the manifest, and nothing loads it yet. A native mod can never take the
runtimephase, because it cannot be torn down safely. - lua is accepted by the manifest, and nothing runs it yet.
Phases
A mod names one of four phases, and a word that is not one of them is refused rather than guessed.
The lifecycle
Every rejection happens before any mod code runs. A conflict found halfway through loading would be found after something had already changed the process, with no honest way back, so the host resolves everything first: it parses every manifest, sorts the dependency graph and checks each required capability against what the backend offers. A mod refused there never reaches a phase.
Then mods move forward one phase at a time, never skipping one and never going back.
Stopping unwinds in reverse load order, because a mod loaded later may have hooked something an earlier one installed. It is unconditional: a mod is told it is stopping, not asked, and everything it registered is released whether or not it released it itself. A mod that faults repeatedly is suspended, and the suspension is reported in the next frame's report so the overlay and the log say so.
Config
A mod declares its settings and the host draws them, in a panel of the overlay. A mod never draws its own settings: if mods drew arbitrary interface where Axiom draws its prompts, a mod could draw a convincing fake one.
Each field takes key, label and kind, and an optional note shown under it; a number takes
min, max, step and unit, and a choice takes options. A manifest declares at most 64 fields,
and a choice at most 32 options. A key is at most 64 characters, a label 120 and a note 400. The mod reads its own values with
config@1, clamped to the range the schema gave them, and the overlay's
controls bind to a key by name (The overlay and config).