Overview
The SDK is everything you need to write a mod or a pack for Axiom. A mod is a small WebAssembly module
that calls the surface, a fixed set of capabilities that every backend answers the same way. A pack
is a pack.toml that tells Axiom where one game keeps its world. This section covers both, call by
call, and says plainly where something is designed but not built yet.
Until the first release, the CLI, the launcher and the Sandbox come from a build of the Axiom source. These pages describe what that build does today.
What a mod is
A mod is a directory with two files in it:
Anything else in the directory, such as a texture or a readme, is packaged with it. A whole mod can be this small:
"surface.h" uint32_t s_Seen = 0; uint64_t s_Frame = 0; __attribute__((export_name("on_frame"))) OnFrame() { s_Seen = axiom_entity_query_count(); s_Frame = axiom_frame_index(); }
The host calls on_frame once a frame. Everything the mod knows about the game comes back through
the calls it imports, and everything it does to the game goes out through them. There is no other
way in or out: no file system, no network, no pointer into the game.
Mods, packs and providers
Axiom has three kinds of package, and each answers a different question. A provider knows how to reach one family of runtimes. A pack knows where one game keeps its world. A mod is what a person installs to change the game, and it reaches the game only through the other two.
A mod cannot tell which of the other two answered a call: it asks entity.query@1 and gets an answer.
That is what lets one unchanged mod binary run on any game whose pack answers what it needs.
Writing a pack and the provider seam say more about each.
How a mod gets to a game
- Write the mod in C, C++ or Rust, and build it to
mod.wasm. - Declare what it uses in
axiom.toml. The host refuses a binary that imports anything the manifest did not name. - Check and build:
axiom checkreads the manifest, andaxiom buildpackages the directory as an.axpkg. - Sign and publish it to the registry with your key. A mod runs only signed.
- Install it with
axiom install, which checks the signature and asks before it installs. - Run it: the Sandbox for a mod that draws,
axiom attachfor a game.
Your first mod walks that path end to end in the Sandbox, which needs no game.
What each backend serves
A backend serves one runtime family, and a pack answers game questions on top of it. Before a mod starts, the host checks every capability it requires against what is served here, and a mod that needs something missing is refused before it runs a line. Within a served capability, a mod should import only the calls listed: an import the backend does not answer stops the mod loading, with the call named.
entity.query@1's by_kind and within, the bulk transforms and positions, and camera@1's
fov and clip are in the surface and not answered by any pack yet. input.observe@1, hook@1,
fs@1, fs.any@1, assets.redirect@1 and net@1 are defined in the surface and no backend serves
them yet. They are in the capability reference so you can see where the
surface is going; do not build a mod on them yet.
The headless backend runs mods on a tick of its own, at 20 a second, with no game drawing. No game is
on its vouched list yet, so the shipped axiom attach refuses every headless target at the gate, and
today it runs in tests. The Unity backend reads a vouched game's memory from outside, without
loading anything into the game, and is what runs the vehicle mods on Cities: Skylines.