Skip to content

How stories are chosen

Imagine a guard at a town gate. You have written three possible greetings:

Moment When it belongs
First meeting The player has not met the guard
A familiar face The player has met the guard
An old debt The player has met the guard and helped them

Each becomes a Rule. When the player talks to the guard, Run Story Director asks which Rule fits now.

The first-time greeting cannot run after the meeting has happened. When the player returns, the familiar greeting fits. If they have also helped the guard, the more specific "old debt" greeting can win.

A Rule has two parts

Criteria describe the situation. These are Game Creator conditions, such as a variable check or a Story Engine history condition.

Instructions create the response. They can do anything the compatible Game Creator instructions in your project can do. A response might be one line of speech or a sequence involving a gate, a camera and a change to a variable.

Rules live on GameObjects. Only active, enabled Rules take part in selection.

Required facts and extra detail

Use Mandatory Criteria for facts that must be true. Every enabled mandatory condition must pass. If even one fails, that Rule is out.

Use Optional Criteria for details that make an already suitable response a better fit. A failed optional condition does not exclude the Rule.

For example, opening a locked door must require the key. The fact that it is raining might make one line of dialogue more fitting, but rain should not decide whether the lock opens.

Which matching Rule wins?

First, the Director checks that a Rule is eligible. Among matching Rules, it considers:

  1. Priority. A more important story moment takes precedence.
  2. Score. At the same priority, each passing mandatory or optional criterion adds one point. More matching detail wins.
  3. Mandatory score. If total scores are equal, the Rule with more passing mandatory criteria wins.
  4. Variation. If the Rules are still tied, the Director picks randomly. When possible, it avoids the exact Rule selected last time.

A score of zero is not a match. An empty criteria list is therefore not a general-purpose fallback. Use an enabled Always True condition when you need a simple fallback.

Leave most Rules at Normal

Good conditions usually do the work. Use a higher priority when the story really needs that moment to take precedence, such as an alarm interrupting small talk.

When does the Director run?

You decide. Put Run Story Director in an interaction, a Trigger, a quest response or another Game Creator instruction sequence.

Changing a variable does not automatically run the Director. A Rule that restores power can change the world state, but someone still needs to ask for the next response.

One request starts one selected Rule. Several independent requests can happen over time, or alongside one another when their settings allow it.

What does Story Engine remember?

It records which Rules have been selected, how often they have played and how recently they were chosen. Your game's other facts, such as a borrowed tool, a relationship or the state of a generator, belong in Game Creator variables or the conditions provided by your other systems.

Story Engine uses the content you author. It does not write dialogue or invent story events at runtime.

Write and organize your Rules when you are ready to build more than one moment.