Dungeon Master Manual

Complete guide to running and managing roleplay sessions from the DM interface.

Getting Started

Dashboard

The Dashboard is your home base. It shows:

Creating a Session

  1. Click + New Session from the Dashboard or Sessions tab.
  2. Optionally Load Scenario to pre-fill settings from a saved template.
  3. Enter a Session Name (required) and optional description.
  4. Set the Starting Location name and description.
  5. Add characters using the inline character gallery:
    • Browse your character library in Grid (portrait tiles) or List (compact rows) view using the toggle buttons.
    • Click a character card to select/deselect them. Selected characters show a blue highlight.
    • Each character displays a Disposition Badge (red-to-green, Dangerous to Savior) on their portrait.
    • Choose for Me — AI selects a complementary cast based on the scenario.
    • Generate for Session — create new characters on the fly.
    • Custom Generate — generate characters with custom guidance.
  6. Selected characters appear in an Order Panel below the gallery with:
    • Character thumbnail and name
    • Up/Down arrows to reorder turn sequence
    • Active/Reserved dropdown — Reserved characters don't take turns initially but can be activated later or by trigger conditions
    • Trigger Notes — optional notes describing when a Reserved character should become Active (e.g., "Joins when the group enters the tavern")
    • Remove button to deselect
  7. Click Save to create the session.
Sessions start in Suspended status. Click Resume in the live view to begin play.
New sessions inherit all settings from the Global Settings page — models, temperatures, turn advance mode, rules, and features. Configure your defaults once in the Settings tab.

Character Library

Creating Characters

Click + New Character in the Characters tab. Fill in:

FieldDescription
NameCharacter's full name (required)
ProfessionRole or occupation (autocompletes from known professions)
PersonalityCore personality traits. Use the Attributes picker for quick selection
Visual DescriptionPhysical appearance for narration and image generation
Voice StyleHow they speak. Use the Attributes picker for presets
DispositionSlider 1-10: Dangerous → Very Friendly
Moral AlignmentSlider 1-10: Evil → Good
DrivesCore motivations (one per line)
GoalsCurrent objectives (one per line)
FearsPhobias and anxieties
TaboosThings the character will never do
SecretsHidden information only the DM knows

Character Images

Each character can have multiple profile images. In the character modal:

AI Character Generation

Generate entire casts at once:

  1. Click Generate Characters in the Characters tab.
  2. Set the count (1-10), provider, and model.
  3. Optionally configure gender, role, and profession for each slot.
  4. Add guidance text for overall theme/style.
  5. Generated characters appear in a preview grid — edit, discard, or keep each one.

Long-running generations show a live Heartbeat mm:ss indicator in the generator modal so you can confirm the request is still in flight.

Discarded characters go to the Discard Bucket where you can revisit or permanently delete them. Deleted characters go to the Recycle Bin for potential recovery.

Filtering & Search

The collapsible filter bar at the top of the Characters tab lets you:

Character tiles display a Scenario Count badge showing how many scenarios the character belongs to (excluding test scenarios). A Disposition Badge appears on character portraits in all picker views, using a red-to-green gradient from Dangerous (1) to Savior (10).

Toggle between Detailed and Compact gallery views using the toggle in the filter bar.

Scenario Membership

Characters can be associated with scenarios directly from the character edit modal. The Scenarios section (below Sessions) shows all scenarios the character belongs to as tags.

Characters imported via story extraction are automatically associated with their scenario. Use this feature to manually add characters to scenarios after the fact.

Diagnostics

When image generation fails due to content policy restrictions, the system automatically records diagnostic entries and attempts up to 3 retries with progressively altered prompts. Diagnostic entries track:

When diagnostics exist for a character, a Diagnostics button appears in the character modal footer (between Delete and Export). Click it to view a table of all diagnostic entries with timestamps, sources, severity, and details. Use the Clear button to remove resolved entries.

Diagnostics are also available on scenarios and sessions where applicable.

Scenarios

Creating Scenarios

Scenarios are reusable session templates. Create one from the Scenarios tab or save a running session as a scenario. Scenarios created from story extraction (Media Import) display a đź“– book icon in the gallery to distinguish them from manually-created scenarios.

AI Casting

When creating a session from a scenario:

Scenario Key Events

Scenarios support deterministic Key Events (for example: blizzard, accident, protest, breakup, transformation). A scenario's Key Events are instantiated into each new session, then evaluated every global turn.

Authoring (Scenario Editor → Key Events tab)

Typed Trigger Builder

Character Turn Trigger Setup

Typed Effects

Session Runtime Controls

In the live session panel, Key Events can be managed without editing the scenario:

Generate Scenario from Key Event

Use Generate from Key Event... in Scenario Editor to draft a full scenario from a single event idea plus pace target.

Pace Terms

Wizard Flow

  1. Concept: event prompt, category, tone, cast size, reserved toggle.
  2. Pace: fast/medium/slow preset, optional explicit trigger target.
  3. Draft: preview location, cast plan, escalation beats, generated key events.

Recipes

Troubleshooting

Transforms

Direct Transforms are authoritative session state changes. They can alter physical form, apply hard constraints, and queue a forced reaction on the target's next turn.

Glossary

How To: Apply Manual Transform

  1. Open a live session and find Active Transforms in the right sidebar.
  2. Click Apply transform... (global or per character).
  3. Set kind + typed fields (for example: Physical, size scale 0.05).
  4. Set duration and immediate mode (usually Force reaction next turn for large physical changes).
  5. Review the preview sentence and click Apply Transform.

How To: Transform via Key Event

  1. Scenario Editor → Key Events → add/edit event.
  2. Create trigger (for example: Character Turn Jake == 3).
  3. Add effect Direct Transform with typed payload + duration + immediate mode.
  4. Save scenario and run session. Fired History and Stepper show canonical transform audit and trace.

Transform Troubleshooting

Tutorial Walkthrough (With Screenshots)

  1. Open a live session and click Apply transform... in Active Transforms.
  2. Fill typed fields in the modal and verify the preview summary.
  3. Run turns and confirm transform lifecycle steps in Stepper.
  4. Optionally add a session-local key event from live Key Events for repeatable automation.
Active transforms panel with apply transform button highlighted
Step 1: Live session sidebar → Active Transforms → Apply transform.
Manual transform modal with typed fields and preview
Step 2: Manual Transform modal with typed physical/constraint/identity fields and live preview.
Session stepper showing transform lifecycle steps
Step 3: Stepper trace path for apply, forced intent, constraint correction, and expiry.
Live key events panel showing add key event and fired history
Step 4: Add session-local key events and verify fired history/audit entries.

Running Sessions

Turn Management

Terminology Glossary

The live session view centers on the Narration Box — a scrolling transcript of the story.

Advancing Turns

Turn Order Sidebar

The right sidebar shows the character turn order. You can:

Session Stepper (Diagnostics Matrix)

The Stepper is a turn-by-turn diagnostic matrix opened from live session or replay. It is designed for engine debugging, behavior analysis, and prompt/caching verification.

How to Open

How to Read It

Primary Step Types

Step TypeMeaning
RETRIEVALMemory/context fetch before model execution.
LLM_CALLActual provider model call (behavior, narrator, POV, resolver-style steps).
PARSEStructured parsing of model output (intent/action/state fields).
STATE_APPLYDeterministic application of accepted state deltas.
PERSISTWrites to event/story/canon records.
KEY_EVENT_EVALEvaluates whether configured key events are eligible and conditions are met.
KEY_EVENT_FIREA key event fired and effects were applied.
KEY_EVENT_SUPPRESSEvent did not fire (cooldown, max-fires reached, or condition failure).
TRANSFORM_APPLYA transform entry was applied to a target character.
FORCED_INTENT_ENQUEUEA next-turn forced reaction was queued.
ACTION_CONSTRAINT_VIOLATIONReturned action violated active transform constraints.
CONSTRAINT_RERUNBehavioral A/B+ rerun attempt to correct violating action.
TRANSFORM_DURATION_ADJUSTAdmin adjusted remaining transform duration.
TRANSFORM_CLEARAdmin cleared one/all transforms for a character.
TRANSFORM_EXPIREDuration reached zero and transform expired automatically.

Inspector Tabs (Right Panel)

TabWhat It Represents
RequestExact prompt payload sent for that step (if captured and allowed).
ResponseRaw model output for that step (if captured and allowed).
Parsed ArtifactsStructured extraction (action, class, state delta, retrieval artifacts).
Engine ProcessingComponent/branch handling details and fallback markers.
State DiffBefore/after dynamic-state transitions for applied updates.
Events WrittenPersisted storyline/canon payload and leak-safety indicators.
TelemetryToken counts, cache fields, hash fields, latency/finish metadata.

Important Interpretation Notes

DM Controls

Direct World Entry

Text entered here is added verbatim to the world state and broadcast as narration. Use this for environmental descriptions, NPC speech, or scene-setting that doesn't need AI interpretation.

DM LLM Instruction

Guidance for the narrator AI to process on the next turn. The instruction is queued (shown as "Pending") and consumed when the next character acts. Use this to steer the story: "Have the lights go out" or "Introduce a new NPC who is suspicious of the group."

Undo Last Turn

Reverts the story to the state before the last character acted. Rolls back events, canon state, belief states, rolling summary, and memories.

Rewind Here

Each narration entry has a Rewind Here button. Click it to roll the entire story back to that specific point. All subsequent events and memories are removed.

DM Commands

Persistent hidden instructions injected into AI character prompts. Characters follow these commands without them appearing in the narration.

TypeEffect
DirectiveFreeform behavioral instruction
Mood ShiftForce a character's emotional state
RevealMake a character reveal specific information
ForgetErase a character's knowledge of a topic
RelationshipSet dynamics between characters
PacingControl scene tempo
EscalateRamp up tension
De-escalateDial down intensity

Each command can target a specific character or all characters, and has a scope: Next Turn (single use), Rest of Round, or Persistent (ongoing until removed).

Edit & Reroll Last Turn

Two surgical tools for correcting or redoing a character's action, appearing on the last narration entry only:

Edit (pencil icon)

Reroll (dice icon)

Inspect (magnifier icon)

When to use which: Use Edit to fix wording or remove an unwanted detail. Use Reroll when the entire action is wrong and you want the AI to try again from scratch.

Session Settings

Narrator Mode

ModeDescription
SimulationDirect, functional narration. Reports what happens concisely.
StoryElaborate prose. Rich atmospheric descriptions, dramatic tension.

Toggle with the Mode button in the session header.

Turn Advance Mode

ModeDescription
ManualClick Next Turn for each character individually.
Auto (Round)Automatically advances through AI characters, pausing when a human-controlled character is next.

Full Auto Mode

Available when Turn Advance is set to Auto. Runs multiple complete rounds without intervention.

  1. Set the number of Rounds (1-100).
  2. Click Start to begin auto-play.
  3. Progress shows as "Round X/Y, Turn Z".
  4. Click Stop at any time to halt.
Full Auto mode pauses automatically when a human-controlled character's turn arrives.

DM Interference Level

Slider from 1 (No Interference) to 10 (Creative Injection):

Response Length

Slider from 1 (Brief) to 10 (Elaborate). Controls how verbose the narrator's output is. Default is 4 (concise).

Reactive Characters

When enabled, characters who are directly interacted with can jump ahead in the turn queue for an immediate response, creating more natural conversational flow.

Interactive Mode

When enabled via the Go Interactive button (in the player view header) or the admin endpoint, players gain the ability to Edit and Reroll the last turn from their player view.

This is a session-level flag. When turned off, the player edit/reroll buttons disappear and the endpoints reject requests.

Stream Narration

Toggle with the Stream button in the session header. When enabled, narration text appears token-by-token with a blinking cursor as the LLM generates it, instead of appearing all at once after generation completes.

This is purely a delivery mechanism change — the same tokens are generated either way, so there is no cost difference. It reduces perceived latency on longer narrations (response length 5+).

If a player joins mid-stream or reconnects, the TurnComplete event still carries the full text as a fallback, so no content is lost.

Turn Timeout

Set how long (in minutes) a human player has to submit their action before the character auto-skips. Set to 0 for no timeout (infinite).

Photostory

Setup

Photostory generates scene images after each complete round of turns.

Visualize & Album

Global Settings

Overview

The Settings tab lets you configure default values for every new session. When you create a session, it inherits these global defaults automatically — no need to reconfigure each time. Changes here do not affect existing sessions.

The Settings page persists to a global-defaults.json file. Use Reset to Factory to revert all values to the compiled-in defaults.

Session Behavior

SettingDescription
Turn Advance ModeManual (click per turn), Human Stop (auto-advance AI turns, pause before humans), or Auto (advance all turns including humans).
Narrator ModeSimulation (direct, functional narration) or Story (elaborate prose).
DM Interference Level1 (no interference — narrator only describes player actions) to 10 (full creative injection — introduces plot twists, NPCs, obstacles).
Response Length Level1 (very brief) to 10 (elaborate). Default 4 keeps things concise.
Turn TimeoutSeconds before a player's turn auto-expires. 0 = infinite.
Disconnected Player PolicyWait (honor full timeout), Skip (skip immediately), or Short Timeout (30s reduced timer).

AI Models

Three model roles control which LLM processes each part of the simulation:

SettingControls
Session Provider / ModelThe default LLM provider and model for the session. Used as a fallback when Narrator or Character models are not explicitly set.
Narrator / DM ModelThe model that processes all narration and DM duties — scene descriptions, world reactions, plot advancement. The Narrator and DM are the same agent.
Character AI ModelThe default model for AI character responses — dialogue, actions, and intent. Individual characters can override this via per-character AI config.
Narrator TemperatureCreativity level for narration (0 = deterministic, 2 = maximum randomness). Default 0.7.
Character TemperatureCreativity level for character responses. Default 0.8.
The model dropdowns show all available models from all configured providers. Provider-matched models appear first, followed by models from other providers.

Features

SettingDescription
Interactive ModeWhen enabled, players can Edit and Reroll the last turn.
Stream NarrationDelivers narration tokens in real-time instead of waiting for the full response.
Reactive CharactersCharacters directly addressed can jump ahead in the turn queue for an immediate response. The Level slider (1–10) controls sensitivity.
PhotostoryAuto-generates scene images after each round. Configure images per round (1–4), resolution, provider (OpenAI / Gemini), and art style.

Narrative Rules

SettingDescription
Hard RulesAbsolute constraints the DM/Narrator must obey and enforce on AI characters (e.g., age restrictions, forbidden content).
ToneEmotional and atmospheric direction for both narration and character behavior.
Character RulesBehavioral guidelines injected into character AI prompts.

These become the default values. When creating a session, the Global Rules field in the session creator can override Hard Rules for that session.

Participation Portal

Overview

The Participation Portal lets you send someone a URL where they complete a guided research flow: personality questionnaire, scenario selection, AI simulation, accuracy review, and data export. Each participant's data runs in an isolated PostgreSQL database — the master database stores only invite metadata and run pointers, never participant data.

The portal is accessed at /portal.html. Administration is done from the Settings tab in this dashboard, under Portal Management.

Creating Invites

Navigate to Settings → Portal Management → Create Invite:

FieldDescriptionDefault
LabelA descriptive name for tracking (e.g., "Beta Wave 1")Required
Max UsesHow many times this token can be redeemed1
Expires in DaysDays until the invite expires7
Scenario ID HintPre-select a specific scenario for the participantNone

Click Create Invite. The raw token appears in a green box — copy it immediately. The token is shown only once and cannot be recovered (it is stored as a SHA-256 hash).

Send the participant the token along with the portal URL: http://your-server:5000/portal.html

Invite Lifecycle

StatusMeaning
ActiveCan be redeemed (within max uses and expiry)
RedeemedAll uses consumed
ExpiredPast the expiration date
RevokedManually disabled by an admin via the Revoke button

Revoking an invite prevents new redemptions but does not affect existing runs created from that invite.

Monitoring Runs

The Participation Runs table in Settings shows all runs with their status, creation date, and completion date. Click Refresh to update.

Each row shows a truncated run ID (hover for full ID), the current status, and a Cleanup button for dropping the isolated database.

Run Lifecycle

Each time a participant redeems an invite token, a Participation Run is created that progresses through these statuses:

StatusWhat's Happening
CreatedToken redeemed, run record created in master DB
ProvisioningIsolated PostgreSQL database being created and migrated (2–10 seconds)
ReadyDatabase provisioned with scenarios and NPC templates; waiting for participant input
QuestionnaireCompleteParticipant submitted questionnaire and trait profile was generated
RunningAI simulation is executing turns in the background
ReviewPendingSimulation finished; waiting for participant's accuracy review
CompletedParticipant finalized the run and exported their data
FailedAn error occurred (check the error message in the run detail)
AbandonedAdmin performed cleanup and dropped the isolated database

Participant Flow

When a participant visits /portal.html and enters their token, they go through 8 guided steps:

  1. Token Entry — validates the invite, creates a run, provisions the isolated database
  2. Consent — checkbox consent plus optional email address (email is hashed in master DB, never stored in plain text)
  3. Questionnaire — Likert-scale personality questionnaire; responses are translated into a 23-trait profile and character sheet
  4. Scenario Selection — choose from pre-seeded validation scenarios; participant picks their role, NPC templates fill remaining roles
  5. Simulation — 10-turn AI simulation runs in the background with a progress bar
  6. Results — view the simulation events as a turn-by-turn replay
  7. Rating — per-turn accuracy ratings (would-do-same, accuracy slider, mismatch reasons) plus global ratings for emotional realism, boundary realism, social style, and stress response
  8. Export — download a ZIP bundle or email it, then finalize

If a participant closes the browser and returns, the portal automatically resumes from where they left off (the access token persists in sessionStorage until the run is finalized).

Data Isolation

The portal is designed so that no participant data is stored in the main application database:

DataLocation
Invite tokens (hashed)Master DB — portal_invites
Run metadata (status, IDs, timestamps)Master DB — participation_runs
Participant email (hashed)Master DB — participation_runs.participant_email_hash
Questionnaire responsesIsolated DB only
Trait profile / character sheetIsolated DB only
Session, events, narrationsIsolated DB only
Compare replay reportIsolated DB only
Accuracy reviewsIsolated DB only

After cleanup, only the master DB rows remain (no participant data).

Cleaning Up Runs

Each participation run creates a separate PostgreSQL database named portal_run_{guid}. These databases consume disk space and should be cleaned up when the data is no longer needed.

Click Cleanup in the Participation Runs table. This will:

  1. Terminate all active connections to the isolated database
  2. Drop the database (DROP DATABASE portal_run_...)
  3. Mark the run as Abandoned

Warning: This permanently destroys all participant data in that run's isolated database. Make sure any needed exports have been downloaded first.

Email Configuration

The portal can email export bundles to participants. Configure SMTP in appsettings.json:

{
  "Portal": {
    "Email": {
      "SmtpHost": "smtp.example.com",
      "SmtpPort": 587,
      "SmtpUsername": "portal@example.com",
      "SmtpPassword": "your-password",
      "FromAddress": "portal@example.com",
      "FromName": "Behavioral Modeling Engine",
      "UseSsl": true
    }
  }
}

If SmtpHost or FromAddress is empty, the email export button on the portal will return an error. The download export button always works regardless of email configuration.

Export Contents

The ZIP bundle generated for each run contains:

FileDescription
character-sheet.htmlSelf-contained HTML with the participant's trait profile, goals, fears, and taboos
questionnaire-summary.htmlQuestionnaire responses and trait translation details
compare-report.htmlSide-by-side simulation viewer with inlined data
replay.htmlFull turn-by-turn transcript of events and narrations
review-summary.htmlAccuracy ratings rendered as a report
raw-data.jsonComplete JSON export of all session data

All HTML files are self-contained (no external dependencies) and use a dark theme.

NPC Templates

Each isolated database is pre-seeded with 8 NPC templates used to fill scenario roles alongside the participant:

TemplatePersonality Profile
Professional ColleagueModerate disposition, cooperative, mild conflict avoidance
Direct SupervisorHigher authority traits, structured, evaluative
Close FriendHigh empathy, supportive, lower formality
SubordinateDeferential, cautious, eager to please
Authority FigureHigh composure, controlled, institutional mindset
Neutral ObserverBalanced traits, analytical, detached
AntagonistHigher confrontation, lower agreeableness, strategic
Supportive AllyHigh loyalty, protective, moderate assertiveness

Scenarios map their required roles to these templates. Unmatched roles default to Professional Colleague.

Troubleshooting

Run stuck in "Provisioning"

Simulation fails immediately

"Email service is not configured"

Isolated database not cleaned up after failed run

Participant can't resume their session

Tools

Human-controlled characters get unique player links. Each link contains a session ID, character ID, and access token. Share these with players so they can connect via the Player View.

Player links appear in the session's character list and can be copied to clipboard.

Fork & Export

Replay & Reboot

Available on suspended sessions with turns:

Custom Compare Viewer: when a run finishes, the yellow Done playback button restarts local playback from turn 1. It does not trigger new generation.

Token Usage

Click the token counter in the world state card to open the Token Dashboard:

Advanced diagnostics endpoint: GET /api/admin/sessions/{sessionId}/token-usage/insights

Rules & Tone

Access via the session Config button: