Skip to content
github-actions[bot] edited this page Sep 27, 2026 · 10 revisions

Gearbox — the OpenDoctrines mod API

Gearbox v1.3. A mod is a WebAssembly module that imports 263 host functions and exports up to 7 of its own. That is the whole contract — there is no framework and no runtime to learn.

Mods are sandboxed with no ambient authority: no filesystem, no network, no processes. You get exactly the capabilities you declared in MANIFEST.json and the user granted, delivered as WASM imports. Anything else does not exist inside your module.

Start here

Getting Started Install, build and load your first mod with one command.
API Reference Every function, its exact signature and semantics.
Capability Modules What each permission grants, and what it costs you in user trust.
Languages Which languages work today, with sizes.
Troubleshooting Every rejection message, its cause and its fix.

The engine's own pages sit beside these: AI Architecture.

What a mod can do today

Working: Core, GameState.Read, UI, Assets, GameProcess, GameState.Write, Neural, Neural.Decide, Map, Diplomacy, Storage, Audio, Net, WasiStub, Military.Read, Military.Write, Research.Read, Research.Write, Politics.Read, Politics.Write, Economy.Read, Economy.Write, MapEditor, Core.Protected, Country, Scripts, Render, Content.

Every capability module is implemented. A mod can read the world, change it, draw panels, run code on turn boundaries, read the map, read and propose diplomacy, observe the AI, and persist its own state.

Two rules that catch everyone

  1. Mods load only from the mod menu. Not from a save, a map, a CLI flag, or another mod. Nothing of yours exists until a user enables you there.
  2. Your state does not survive a reload, and there is no hook to save it. mod_load runs fresh every time. Never assume you ran last turn.

Clone this wiki locally