Authoring mods
Write one sentence that describes what the player should experience. Include when the effect starts, when it stops, and what should happen when the player starts another run or disables the mod. Then ask how much of that behavior can Ravenswatch already express through cooked data?
If you’re setting up your tools or making your first mod, follow Make your first mod. For exact fields, file layouts, and examples, use the Mod authoring reference.
1. Start with cooked data
Section titled “1. Start with cooked data”RSMM’s cooked bridge applies manifest patches, content definitions, and asset
overrides when you run rsmm apply. Ravenswatch loads the resulting assets and runs the
behavior they describe. That can include triggers, conditions, and timers.
An effect that happens during combat can still be entirely data-driven.
Use the first option that expresses the part you’re building.
| If you need to… | Use… |
|---|---|
| Change a supported field, such as a number or texture reference | A manifest patch. Patches to different fields of the same file can compose. |
| Add or change a supported item, talent, enemy, or other content definition | A content definition. Check the kind’s supported operations and confidence. |
| Replace an asset whose change needs the whole file | A cooked asset override. Two mods replacing the same file conflict. |
| Make a decision the cooked definitions can’t express | Lua through the public SDK. |
For example, suppose you want an item that grants a brief crit bonus when the hero takes damage. Before writing a damage callback, check how the game already handles timed item effects. The existing timed bonus recipe shows a cooked trigger and timer for this behavior. The game can apply and expire the bonus itself. If you add a rule the cooked definition cannot express, keep the supported parts in data and use Lua for the remaining decision where the SDK supports it.
2. Use Lua for the remaining decisions
Section titled “2. Use Lua for the remaining decisions”All game interaction in mod Lua must go through the public, high-level RSMM
SDK. Load it with local R = require "rsmm" in init.lua. Direct engine calls,
hooks, memory access, and the loader’s native table are reserved for RSMM
internals. The SDK provides reusable events, state, and actions. The mod decides which event matters,
what conditions qualify, and what action to take. For example, if a rule should
run once per run, the mod owns that flag and clears it at the run boundary.
- Subscribe to the narrowest supported event that represents the change you care about. Keep the handler short. If polling is necessary, limit its frequency and the state it reads.
- Follow the SDK’s thread and readiness requirements. Route game mutations through the main-thread scheduler and verify the required game state is available before acting.
- Track when temporary effects and cached state expire. Test cleanup on run end and any other transition where the feature should stop.
The Lua gameplay API lists the public surface. If a needed event, state read, or action is missing, describe that specific capability gap.
3. Verify the contracts before building around them
Section titled “3. Verify the contracts before building around them”Check the dependencies your feature actually uses.
- Cooked data. Verify the kind, fields, and supported operation. An experimental kind or an unfamiliar combination of effects needs an in-game check before you build the rest of the feature around it.
- Lua. Verify the public
R.*call, required loader features, and when it is safe to use. If it depends on an engine event, usersmm symbols events <filter>to find candidates. Check when the event fires, what its payload contains, and whether it can fire more than once for the same action. - Missing behavior. Name the smallest dependency that needs proof. An event name in the symbol catalog is a lead. A focused in-game check tells you whether it provides the behavior your mod needs.
4. Prove one complete path, then measure what repeats
Section titled “4. Prove one complete path, then measure what repeats”Build the smallest version that produces the intended effect in-game.
rsmm lint <id> checks the mod’s structure and rsmm diff <id> shows what it
touches and where it overlaps. Enable it and run rsmm apply. If the mod uses
Lua, install the matching loader with rsmm install-loader. Launch with
rsmm run, check the trigger, and use rsmm log to diagnose Lua errors.
Check a qualifying action, an action that should have no effect, and each transition that matters to the feature. A once-per-run effect should stay spent in the same run and work again after starting another. A temporary effect should expire as specified, including when its trigger repeats.
If runtime work is a concern, count how often the handler runs and time the work it does in a representative encounter. Compare the same scenario with and without the mod when investigating frame-time changes. Start with work that repeats most often, such as per-frame entity scans or repeated writes of the same value.
5. Package the playtested mod
Section titled “5. Package the playtested mod”Ship the manifest, the content and assets it needs, and init.lua when it uses
Lua. The Python SDK
can generate repetitive definitions during development. It stays outside the
mod folder. Before running rsmm pack <id>, check the mod’s
online play requirements
and packaging rules.
Record which behaviors you observed in-game and which still need a playtest.
