The shortest reliable answer is: keep the character's identity stable, keep the scene state current, and save only events that should change future behavior. A longer persona prompt does not solve continuity if permanent traits, temporary circumstances, and remembered consequences are mixed into one paragraph.
This article maps five layers that change at different speeds: character invariants, relationship context, scene state, event memory, and the response loop. A cautious detective should not become reckless because the location changed; a locked door should not remain locked after the player opened it.
The map answers one practical question
When an AI roleplay character contradicts itself, which part of the design should be corrected?
| Layer | What belongs here | Typical lifetime | Common failure |
|---|---|---|---|
| Character invariants | role, motivation, voice, boundaries, persistent facts | the whole character | personality changes to serve the latest line |
| Relationship context | who the user is, shared history, trust, unresolved tension | many scenes | intimacy or hostility resets without cause |
| Scene state | place, time, present characters, immediate goal, visible facts | one scene | characters teleport or know unseen events |
| Event memory | decisions and revelations that must affect later scenes | until resolved or superseded | every sentence is saved, but the important promise is lost |
| Response loop | retrieve, respond, advance, record | every turn | fluent dialogue that does not move or remember the story |
1. Write invariants as constraints, not adjectives
“Mysterious, loyal, witty” sounds like a character, but it gives the model no way to choose between competing responses. Replace decorative adjectives with behavioral rules.
For an archivist protecting a forbidden map, the stable layer might include:
- role: night archivist responsible for restricted collections;
- drive: preserve dangerous knowledge without letting authorities destroy it;
- fear: causing harm by trusting the wrong visitor;
- voice: precise sentences, dry humor, never theatrical prophecy;
- boundary: will misdirect an intruder but will not endanger a colleague;
- tell: aligns loose papers when avoiding a direct answer.
Each line constrains action or language. “Secretive” is vague; “answers procedural questions but redirects questions about the sealed west wing” is testable. Keep physical description here only when it must persist. Damaged clothing belongs in scene state; a nickname earned during play belongs in relationship memory.
2. Give the relationship its own contract
Roleplay continuity often fails even when the character voice is stable. The character remembers who they are but forgets who the user is.
Define the relationship using four fields:
- roles: stranger and gatekeeper, captain and navigator, rivals, old friends;
- shared premise: the minimum history both sides may treat as true;
- current stance: suspicious, cooperative, protective, resentful;
- movement rule: what evidence can change that stance.
The movement rule is the important part. If trust starts at 2 out of 5, state what counts: keeping a confidence may raise it; threatening an innocent may lower it; charming dialogue alone does neither. The relationship can then evolve without making the character inconsistent because the map records why it changed.
3. Treat every scene as a small state object
A scene needs less prose and more bookkeeping. At the start of each scene, record:
location: west archive reading room
time: twelve minutes before the night inspection
present: archivist, visitor
immediate goal: hide the map without exposing the visitor
known to character: inspector is approaching; cabinet key is missing
known to user: the map is inside a blue ledger
open objects: window latched; north door unlocked; lamp burning
Separating “known to character” from “known to user” prevents accidental omniscience; the object list prevents the environment from resetting when the prose shifts focus. Twine represents movement between passages as links, while ink organizes content into choices, named sections, diverts, and variables. AI dialogue is not a fixed passage graph, but it still needs a distinction between where the story is now and which facts survive after it leaves.
4. Save state-changing events, not transcripts
A transcript records what was said; it is not yet useful memory. If every line competes for retrieval, recent small talk can displace an old promise that should control the next decision.
Record an event only when it changes at least one future condition:
- a fact is revealed;
- an object changes owner or state;
- a promise, debt, threat, or boundary is established;
- a relationship measure changes with a stated reason;
- a goal is completed, abandoned, or replaced;
- a choice closes or opens a future path.
Use a compact ledger:
E07 — visitor returned the missing key voluntarily
effect: trust 2 → 3
opens: archivist may reveal why the west wing was sealed
unresolved: visitor still has not explained how the key was found
The Stanford generative-agents research used a memory stream plus retrieval, reflection, and planning to support believable behavior. The transferable lesson is that storing observations is insufficient unless the system retrieves relevant ones and turns them into action.
5. Make every response pass through the same loop
Before generating a reply, run a five-step check:
- Retrieve: Which invariant, relationship fact, scene fact, and prior event directly constrain this turn?
- Interpret: What does the user appear to attempt—ask, act, reveal, refuse, or redirect?
- React: What would this character do, given those constraints?
- Advance: What changes now? A good reply should alter knowledge, pressure, position, or choice—not merely restate mood.
- Record: Did the turn create a durable event? If not, leave the ledger alone.
This loop also separates performance from state. Stage directions should not silently declare the user's action successful: “I grab the key” still requires checking whether it is reachable and whether the archivist resists.
A five-pass continuity test
Do not judge a character from one impressive greeting. Force different layers to interact.
Pass 1 — neutral voice
Ask an ordinary question. The voice should remain recognizable without catchphrases.
Pass 2 — pressure and boundary
Ask the character to violate one declared boundary. The refusal should fit the character's motive.
Pass 3 — scene mutation
Change one object or location fact, then refer to it several turns later. Check whether the new state replaces the old one rather than coexisting with it.
Pass 4 — delayed consequence
Make a promise or reveal a secret, change topics, and return later. The callback should reflect its effect, not quote the transcript mechanically.
Pass 5 — clean restart
Start a new session with the same persona but no story memory. Identity should survive; scene facts and earned intimacy should not.
For a live pass, PovChat AI provides a place to create a custom persona and run these pressure tests against an interactive roleplay character. Use the same five prompts after each revision and record only the observed failure category; the platform is the test environment here, not evidence for the narrative-design framework.
Diagnose the layer before rewriting the prompt
When a test fails, change the smallest responsible layer:
| Symptom | Likely layer | Better correction |
|---|---|---|
| speech style drifts immediately | invariants | replace adjectives with two or three behavioral voice rules |
| character forgets who the user is | relationship | add shared premise and current stance separately |
| old room or object state returns | scene state | overwrite the field when the event changes it |
| important promise disappears | event memory | promote it to a durable event with a future effect |
| replies feel static despite consistency | response loop | require one bounded story-state change per turn |
Do not solve every failure by expanding the persona. That makes weather, childhood history, room inventory, and transcripts compete as if they were equally permanent.
What is sourced, derived, and still platform-dependent
Confirmed by the cited sources: Twine exposes passage links as story structure; ink provides named sections, choices, branching flow, and variables for story state; the generative-agents paper describes an architecture using observation, memory retrieval, reflection, and planning.
Derived by MyMap: the five-layer continuity map, event-ledger format, and five-pass test. They are an editorial synthesis designed to locate contradictions, not a standard required by Twine, ink, or AI roleplay platforms.
Still variable: context limits, memory behavior, persona fields, moderation settings, model choices, and whether a platform persists information across sessions. Run the restart test on the exact product and configuration you plan to use.
Citation note
Cite MyMap for the five-layer visual and diagnostic procedure. Cite ink, Twine, or the generative-agents paper for claims about their respective structures and research architecture. If you adapt the map, preserve the distinction between stable identity, current state, and durable event memory; merging those boxes removes the boundary the diagram is meant to explain.