AI
Story Instructions
`aiInstructions` is where you write the rules the narrator follows during play, organized into tasks each firing at a specific moment. This page covers the cross-task mechanics: processing logic and the two internal non-authorable tasks. Each individual task has its own page in the sidebar.
- Editor
- AI Tasks *(sidebar label: "AI Tasks" → task list)*
- Edit via
- Graphical form (labeled textareas — the only tab that is NOT a JSON editor)
Example
{
"aiInstructions": {
"generateStory": {
"Victory and Downtime": "After a win or escape — if the player is resting or celebrating, focus the turn on that. Do not seed the next problem in the same paragraph.",
"Character Behavior": "NPCs act from consistent motivations. They know only what their position provides. They don't melt at flattery.",
"Style Principles": "Third person, present tense. Short sentences, strong verbs. No adverbs.\n\nBanned phrases: suddenly, you realize, it seems, somehow.",
"custom": "## World Rules\n[World-specific instructions: magic behavior, currency values, species norms, etc.]"
},
"generateActionInfo": {
"custom": "## Combat System\nD&D 5e structure. Four success levels: failure, partial, success, critical."
},
"generateInitialStart": {
"Opening Structure": "First beat: WHO. Second beat: WHERE. Third beat: one active situation already in progress.",
"custom": "## World Introduction\nIntroduce proper nouns with immediate context on first use."
}
}
}
📋 Note (deterministic alternative — triggers): instructions here are probabilistic — the narrator decides whether and how to act on them. For anything that must happen exactly (guaranteed one-time narration, state gates, key-locked progression) use triggers instead: a
storyeffect injects a guaranteed instruction, and mechanical conditions/effects change state deterministically. ReserveaiInstructionsfor voice, tone, and flexible guidance.
Structure
Markdown structure as AI priority cues
The AI reads each task's concatenated string as ordinary text but pays attention to its structural shape. A handful of patterns reliably signal priority and intent:
## SECTION HEADERacts as a strong topical break. The model treats everything below the header as belonging together and weighted as a coherent block. Use it to separate procedure phases, scene categories, or rule families. Two-pound headers carry more weight than three-pound or four-pound.## ALL-CAPS HEADERsignals higher priority than mixed-case. The model interprets capitalisation as emphasis. Reserve it for sections you want the AI to treat as overriding defaults (## MANDATORY,## OVERRIDE,## STRICT RULES).- Numbered or
Step N:headers push the model toward a procedural reading. Useful when the task requires running through phases in order (classify → filter → apply → output). - Inline emphasis words —
MANDATORY,MUST,NEVER,OVERRIDE,ABSOLUTE— function as direct priority signals when written in caps mid-sentence. Use sparingly; over-use dilutes them. - Labelled bullet lists (
- TYPE: behaviour rule) read as a lookup table the AI can apply by matching the type token to the current situation. Stronger than prose paragraphs for branching rules. Format:directives with quoted templates (Format: "Background: ...\n\nPersonality: ...") anchor the expected output shape. The model imitates the literal example closely.- Negative rules stated as
Do not Xcarry weight only when they sit next to the positive rule they exclude. A standalone "do not" list at the end is read past faster than rules paired with their counterpart positive.
The processing-order rule below applies regardless of structure: keys are concatenated in declaration order. Markdown structure operates inside each key's string value.
📋 Note: For installing a full custom system that should replace the engine's defaults rather than coexist with them, see Priority override header in the Advanced AI Techniques appendix.
Processing order
Concatenation logic
Task names must match the engine's task IDs exactly (see the sidebar for the full list), and each value is a markdown-capable instruction string. A rule placed in the wrong task either fires at the wrong moment or wastes token budget on the most frequent task.
For every task with editable keys:
- Engine loads its base instructions for the task
- World config overrides are loaded
- For each editable key: world override is used if present, otherwise the engine default
- Any custom keys you add (beyond the editable defaults) are appended after defaults
- All non-empty instructions are concatenated in key order
Keys are case-sensitive and must match exactly. Style Principles will not match style principles.
Internal tasks
Internal tasks (not authorable):
generateItemUpdates(inventory changes) andgenerateItemDefinitions(newly created items) receiveItemGenerationAndUsageas context but are not valid keys inaiInstructions— using them produces a validator error.
authorSeeds for a consistent NPC voice
A single authorSeeds entry anchors one voice.
Because generateNPCDetails selects a seed at random, defining exactly one comprehensive style entry means every seed-consulting run uses that same voice — a simple way to keep strong / elite / boss / mythic-tier NPC prose consistent without repeating style instructions across tasks. Add more entries when you want the generator to vary between several registers; selection is random, so you cannot pin a specific seed to a particular NPC.
Size limits
| Limit | Value |
|---|---|
| Each string leaf under a task (`aiInstructions.<task>.<key>`) | 5000 |
| Per task (`aiInstructions.<task>` total, sum of instruction chars) | 20000 |
Related
- Narrator Style — overarching voice persona
- Story Overview — world background context these tasks operate on
- World Lore — lore context injected into tasks