Skip to content
Axiom/SDK
SDK / The manifest and lifecycle

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.

AXIOM.TOMLmods/overlay-test
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"]
Key
What it says
id
Lowercase and dotted, with a namespace in front: io.github.<login>.<name> for a GitHub namespace.
name, version
The display name, and a semantic version.
tier
wasm, native or lua. Only wasm runs today.
phase
When the mod starts: pre-init, init, post-init or runtime.
capabilities.require
Every capability the mod imports, each with its major: entity.query@1.
targets.game, targets.builds
The game key, such as axiom.sandbox, and the builds of it the mod is for.
dependencies
A table of other mods this one needs, each id with a version range.
after, conflicts
Lists of ids: mods this one loads after if they are present, and mods it refuses to run beside.
config, config-note
Settings the host draws a panel for, and a line shown above them.

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

AXIOM.TOMLneeding, following and refusing other mods
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 runtime phase, 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.

Phase
What is true when it starts
pre-init
Before the game initialises. Memory and symbols only; no game structures.
init
Core game systems are up. Hooks are installed here, through the core.
post-init
After the first frame. Entities, UI and assets are live and the overlay is up. Most mods land here.
runtime
Running, and loaded or unloaded while the game runs. Sandboxed tiers only.

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.

kind
What the person sets
toggle
On or off. The default when kind is left out.
number
A number between min and max, with a step and an optional unit, such as m/s.
choice
One of options.
colour
A colour, as a hex string.
key
A single key, bound by pressing it.

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).