Rules & Behaviors
Event-driven triggers that fire between turns, without the AI's involvement. They handle things that need to be precise, consistent, or instant.
In the editor, this is the Behaviors section. Different from AI instructions on variables — those teach the AI how to respond. Rules fire mechanically.
The horror world doesn't use any rules — it runs entirely on entries and AI instructions. That's fine. Most worlds don't. But if you wanted to guarantee a "Game Over" screen exactly when health hits 0 (instead of trusting the AI to notice), that's what rules are for.
When to Use Automation
Use automation for:
- Threshold alerts: "Show a warning when health drops below 10"
- Game phase transitions: "When affinity hits 75, switch to romance mode"
- Timed events: "Every 5 turns, advance the day cycle"
- Automatic audio: "Play combat music when in the arena"
Don't use automation for:
- Anything the AI handles well through AI instructions (most narrative stuff)
- Complex branching logic (that's what entries + keywords are for)
- Content generation (automation triggers actions, it doesn't write narrative)
Many great worlds use zero rules. If your AI is doing a good job through well-written entries and AI instructions, you might not need any.
How Automation Works
Every automation rule has three parts:
WHEN — The Trigger
What event fires this rule:
| Trigger | Fires When |
|---|---|
| Variable crossed | A variable rises above or drops below a threshold |
| State changed | Any variable changes value |
| Turn complete | Every N turns (e.g., every 5 turns) |
| Session start | The first time a player starts your world |
| Player keyword | The player mentions a specific word |
| AI keyword | The AI's response contains a specific word |
| Every turn | After every single turn |
IF — The Conditions (Optional)
Additional checks that must be true for the rule to fire:
- Variable equals / not equals / greater than / less than a value
- Multiple conditions with AND or OR logic
THEN — The Actions
What happens when the rule fires:
| Action | What It Does |
|---|---|
| Modify variable | Change a variable value (set, add, subtract, etc.) |
| Inject directive | Add instructions to the AI's prompt for future turns |
| Notify player | Show a toast notification |
| Play audio | Trigger a sound effect or music change |
| Toggle entry | Enable/disable a lorebook entry |
| Toggle rule | Enable/disable another rule |
Real Example: Dating Sim Route System
The world "Sakura Season" uses 9 automation rules to create a romance progression system:
At affinity 25 — A subtle notification: "She seems to have noticed you..."
At affinity 50 — An achievement toast + the AI gets a new directive: "She's starting to show feelings — describe contradictory behavior, wanting to be close but pulling away."
At affinity 75 — The climax trigger: AI gets a directive to write a confession scene, and the story phase shifts to "climax."
Each heroine has this same 3-tier structure. The AI handles all the narrative naturally — the automation just ensures the pacing milestones hit at the right moments.
Rule Options
- Priority: Higher priority rules fire first (useful when multiple rules trigger simultaneously)
- Cooldown: Minimum turns between fires (prevents spam)
- Max fire count: Total times this rule can ever fire (1 = one-shot event)
- Enabled/disabled: Rules can be toggled by other rules (chain reactions)
Tips
- Start without rules. Build your world with just entries and AI instructions first. Only add rules when you notice the AI being inconsistent about something.
- Inject directives for pacing. The most powerful action is "inject directive" — it changes what the AI is told to do, which changes the entire narrative direction.
- Use notifications sparingly. A toast notification every turn is annoying. Save them for meaningful milestones.
- Test thresholds carefully. If your automation fires at health < 10, make sure your AI instructions actually let health reach that range.
