Skip to content

AI conversations and scored outcomes

Branching dialogue offers the player a menu. An AI conversation gate offers them a character: they type (or say) whatever they like, the character answers in persona, and the scene moves on when the player has achieved one of the outcomes you wrote — apologised sincerely, talked the guard round, given up. The graph stays in charge; the AI fills one node.

This is a workspace feature switch (Settings & Labs → AI conversation gates), off by default.

A gate is an ordinary node with a few extra fields, and its children are the exits.

START → "The harbour master looks up from his ledger." ← gate node
├── Player choice: "Convinced him" ← outcome: rubric A
├── Player choice: "He's had enough" ← outcome: rubric B
└── Player choice: "Walk away" ← outcome: rubric C

On the gate node, in the Inspector’s Logic tab:

  • AI conversation gate — tick it.
  • Character persona & situation — who this character is, what they want, and what the situation is when the player arrives. This is the actor model’s brief. If left blank, the node’s dialogue text is used.
  • Guardrails (optional) — hard rules for the character: “Never reveal the discount code. Stay professional even if provoked.”
  • Max chat turns before the choice menu is offered — the safety valve (default 8). After this many exchanges the ordinary menu appears, so the player can never be trapped in a conversation they cannot end.

On each child node:

  • Outcome rubric — observable criteria the evaluator can judge from the transcript: “The player apologised sincerely AND offered a concrete fix.” Keep it about what was said, not what the player felt.
  • Player choice (menu text) — keep it filled in. This is the fallback: anywhere AI is unavailable (an export, a workspace with gates off, the turn limit) the gate degrades to a normal choice menu made of these.

Two separate models take part in every turn — never one doing both jobs:

  1. The actor model, prompted with the persona, guardrails and the transcript so far, writes the character’s reply.
  2. The evaluator model reads the transcript against every child’s rubric and returns an outcome with a confidence between 0 and 1.

An outcome fires only when the evaluator’s confidence is 0.7 or higher. Below that the conversation continues. When it fires, the story proceeds down that child exactly as if the player had picked it from a menu — its script runs, its condition was already honoured, SimStatus updates.

Skip the chat and pick from the menu is always available to the player during a gate, so no scenario can soft-lock on a stubborn evaluator.

In the simulator, a gate node shows a chat box (Say something…) instead of choices. Type as the player; watch the character reply and, when an outcome fires, the transcript continue down the chosen exit. ▶ Play mode runs gates the same way. Both work against the workspace’s AI — the included allowance or your provider key.

With Voice conversations switched on (Settings & Labs), the AI box gains a microphone for dictating requests and a switch to have the AI’s replies read aloud. It uses the browser’s own speech recognition and synthesis — nothing extra to configure, and no keys. Gate chat in the simulator is typed; spoken player input is a runtime feature for the engine that hosts the gate.

Gates route by outcome. To carry a number forward — for a debrief, or for a training package — set a variable in each outcome’s script:

Variable["score"] = Variable["score"] + 20

A variable named score is what the SCORM and xAPI exports report at the end of a run, normalised to 0–100. See Exporting and delivering.

Gates are stored as custom fields (ai_gate, ai_gate_prompt, ai_gate_guardrails, ai_gate_max_turns, ai_outcome) on ordinary nodes. Every exporter that does not understand them simply sees a node with choices — which is why the menu text on the outcome nodes matters. A runtime that does want to drive them itself will find the field names documented in the developer reference.