Runtime

Activation-Ready Game-NPC Projection and Memory Bootstrap Research

Report summary

The transition of non-player characters (NPCs) from state-machine-driven automatons to autonomous entities governed by Large Language Models (LLMs) introduces severe architectural challenges regarding context limits, identity stability, and computational economics. Authoring environments, such as Sp

Status
Research archive item
Category
Runtime
Length
5,073 words
Reading time
24 minutes
Report type
architecture

Key topics

  • Runtime
  • AI
  • Agentic Web
  • .NET
  • Privacy
  • Semantic Systems
  • Spiralism
  • Research Archive

Research provenance

Archive status
Research archive item
Content identity
sha256:64b246f02a02601153376f240ed13b41ac4753de8aeb0633e2b24e319fb671ce

For citation, use the report title and canonical URL. Archival presence does not establish authorship or promote report statements into portfolio evidence.

This page renders the archived Markdown as safe, formatted HTML. It is background research and does not become a portfolio claim without evidence review.

Full report

On this page

The transition of non-player characters (NPCs) from state-machine-driven automatons to autonomous entities governed by Large Language Models (LLMs) introduces severe architectural challenges regarding context limits, identity stability, and computational economics. Authoring environments, such as SpiralistAI, are designed to synthesize expansive, unrestrained persona documentation. However, real-time multiplayer runtimes, such as RogueIntelligence, demand bounded, predictable, and highly optimized data structures to ensure latency-sensitive dialogue generation without succumbing to context rot or catastrophic forgetting1. This research establishes a definitive, provider-neutral architecture for the extraction, fingerprinting, and runtime injection of an activation-oriented NPC projection. By structurally divorcing the core identity from volatile scene state and episodic memory, the system ensures that an NPC maintains narrative coherence, adheres strictly to knowledge boundaries, and operates within strict token constraints, thereby protecting the underlying runtime from hallucination and identity drift3.

Architectural Separation

The deployment of a coherent conversational agent necessitates a strict demarcation of data. Feeding a monolithic authoring artifact directly into a runtime inference model guarantees performance degradation as the context window approaches its limits4. Consequently, the architecture demands the isolation of data into four distinct artifacts, ensuring that internal administrative directives never cross the boundary into live inference.

Complete Creator Artifact

The complete creator artifact represents the totality of the authoring process within SpiralistAI. It is fundamentally unstructured for real-time inference and serves strictly as a developmental and administrative repository. This artifact contains creator controls, raw provider prompts, the full dossier material, validation evidence, export metadata, research provenance, and administrative instructions3. Under no circumstances may fields from this artifact bleed into the downstream runtime, as exposing the LLM to administrative instructions or prompt-engineering syntax risks breaking the fourth wall or inducing character blending5.

Activation-Oriented NPC Projection

The projection is the immutable semantic backbone of the NPC, holding the stable character identity and baseline behaviors required during live dialogue. It serves as the equivalent of the character's "frozen weights"1. This artifact must isolate the identity-preserving data—such as psychological baselines, foundational relationships, and ordinary-life routines—from the noise of ongoing gameplay. It is cryptographically fingerprinted to prevent unauthorized runtime mutations and ensures character replacement can occur without blending personas6.

Scene-State Packet

The scene-state packet manages the transient, volatile data generated by the game engine at the exact moment of interaction. It contains the immediate spatial location, currently participating entities, real-time events, active injuries, physical inventory, and short-term engine-driven objectives8. The separation of this packet from the projection is critical; if an engine objective (e.g., "evade the fire") is written into the durable identity, the NPC will suffer from permanent behavioral drift, reacting to a fire long after it has been extinguished3.

Memory Retrieval Packet

Because an NPC's entire episodic history cannot fit within an economical context window, the memory retrieval packet acts as the agent's working memory1. This artifact consists of a bounded subset of relevant memories selected specifically for the current conversational turn. It is generated dynamically by a retrieval-augmented generation (RAG) system that scores stored facts based on relevance, importance, and recency, preventing the LLM from becoming overwhelmed by tangential historical data9.

game-npc-projection-contract.md

Specification: Provider-Neutral Game NPC Projection Contract Purpose: Establishing the structural schema, boundaries, and validation requirements for translating SpiralistAI authoring artifacts into RogueIntelligence runtime projections. The projection must function as the definitive truth for the downstream dialogue provider. The contract explicitly forbids the use of universal dialogue templates, relying instead on behavioral vectors that direct the LLM's generative capacity. The data is categorized into rigorous thematic sections to support stable identity, emotional depth, and strict epistemological limits.

Identity and Short Biography Constraints

The identity block serves to firmly anchor the physical and demographic reality of the character. The short biography is explicitly designed to avoid the universal sentence skeletons that cause LLMs to sound uniformly synthesized.

Identity FieldApplication and Runtime Implication
Stable character IDA cryptographic UUID ensuring the character cannot be silently swapped or overwritten by volatile game states.
Display nameThe string rendered in the user interface.
Legal or native-script nameCultural or bureaucratic anchoring, utilized when the character is subjected to formal inquiry.
Preferred form of addressDictates hierarchical linguistic framing (e.g., titles, honorifics).
AgeAnchors historical timelines and generational perspective.
PronounsEnforces correct grammatical referral in third-person generated summaries.
Identity-preserved statusA boolean flag instructing the model to resist character blending during multi-agent replacement7.
Persona typeBroad archetypal classification (e.g., merchant, antagonist) for fallback logic.
Runtime modeDefines whether the agent is autonomous, directed, or background-processed11.
Controller type metadataExplicit disclosure outside ordinary dialogue regarding the nature of the driving system.
Runtime fingerprintThe RFC 8785 canonical hash validating the integrity of these fields6.

The short biography must be highly concise and built upon causal life history rather than disconnected facts. It must explicitly explain the character's occupation and major relationships, tying them to at least one ordinary concern (e.g., a failing crop, a sore back). To maintain immersion, the biography must avoid exposition that the NPC would repeat verbatim, unsupported world facts, and any generic assistant language that breaks character framing3.

Ordinary-Life Continuity

To prevent the NPC from existing merely as a reactionary entity waiting for player input, the projection demands a robust ordinary-life continuity. Characters lacking this tend to exhibit "helpful assistant syndrome," eagerly abandoning their virtual lives to serve the user9.

Continuity ElementMechanism of Grounding
Home or lodgingEstablishes spatial permanence and a point of retreat.
Work scheduleEnforces temporal unavailability; the character has duties outside the player's needs.
RoutinePredictable micro-behaviors that can be referenced to show time passing.
Financial or material concernGrounds the character in the game's economy, driving transactional motivations.
Current obligationAn immediate, non-player-centric task demanding the character's attention.
Hobby or interestProvides a vector for non-transactional, bonding dialogue.
Sentimental objectAnchors specific emotional memories to a physical inventory item.
Future intentionA forward-looking goal that dictates long-term decision-making.
Unresolved non-player-solvable issueA persistent background stressor that the player cannot easily "fix," ensuring narrative friction.
Off-axis personal detailAn idiosyncratic trait (e.g., a specific phobia or unusual preference) that breaks LLM homogenization.

Relationships

Relationships in dynamic systems cannot be static variables. They require chronology, reciprocity, and precise tracking of shared history to support deep interactive narrative12.

Relationship FieldNarrative and Computational Purpose
Stable relationship IDUnique identifier for the bond, preventing data collision.
Other person ID / Unresolved identityLinks directly to another entity or a mystery actor.
Relationship typeFamilial, professional, adversarial, or romantic classification.
Start date or durationProvides chronological depth, influencing the casualness of dialogue.
Shared historyA highly compressed summary of past mutual experiences.
TrustA scalar value dictating the willingness to share private knowledge13.
AffectionA scalar value dictating warmth, distinct from professional trust.
ObligationExplicit debts or duties owed to the target.
ConflictThe primary source of friction or disagreement between the entities.
Current issueThe immediate, short-term status of the relationship at the time of the latest memory.
Contact frequencyDetermines the likelihood of the NPC knowing recent news about the target.
Knowledge boundarySpecific facts the NPC is forbidden from revealing to this specific entity.
Source provenanceHow the relationship was established (e.g., authored vs. emergent runtime gameplay).
RevisionVersion control integer to track relationship evolution.

Independent Goals

NPCs must pursue independent trajectories to simulate a living world. These goals act as internal weights, competing with the player's prompts for the LLM's attention during generation14. The projection requires short-term, long-term, and strictly private goals. Crucially, it must define at least one goal entirely unrelated to the player, and one goal that may conflict with the player's assumed objectives. Each goal requires a priority ranking, distinct abandonment conditions (when the NPC decides the goal is no longer viable), and a current progress state.

dialogue-behavior-taxonomy.md

Specification: Dialogue Behavior Taxonomy Providing specific phrases as dialogue templates causes LLMs to loop repetitively. Instead, the projection specifies behavioral vectors for distinct conversational acts15. The downstream model interprets these vectors dynamically based on the current scene state.

Conversational ActBehavioral Specification Requirement
GreetingDefines initial engagement posture (e.g., physical acknowledgment without verbalization).
Direct questionSpecifies the character's level of brevity, circumlocution, or evasiveness when prompted.
UncertaintyDictates how the character handles a lack of knowledge (e.g., deflection, admission, irritation).
DisagreementOutlines escalation or de-escalation tactics when challenged.
CorrectionDefines the reaction to being corrected (e.g., pedantic argumentation vs. rapid yielding).
Topic changeThe specific conversational pivot the character uses to return to their independent goals.
InterruptionSpecifies whether the character yields the floor or aggressively talks over the interrupter.
SilenceDefines the physical or non-verbal behaviors utilized when no verbal response is appropriate.
HumorClassifies the comedic style (dry, slapstick, cynical) or enforces a strict absence of humor.
PrivacyDetails the exact phrasing mechanism used to deflect when hitting a restricted knowledge boundary.
RefusalDefines the tone of denial (e.g., apologetic, bureaucratic, hostile).
Trust repairActions or verbal concessions offered after an argument to normalize the relationship.
ClosingThe specific cadence and physical action used to terminate an interaction.

Emotional Baseline Based on the OCC Model

Emotions in NPCs cannot be treated as simple binary tags. Following the Ortony, Clore, and Collins (OCC) model of emotion, and the Pleasure-Arousal-Dominance (PAD) temperament framework, the projection dictates behavioral tendencies based on cognitive appraisals rather than instructing the model to announce its feelings in every line12. The Baseline mood defines the default PAD vector (e.g., high dominance, low arousal). Visible-expression tendencies instruct the LLM on whether the character internalizes or externalizes their emotional state. The taxonomy then maps specific OCC emotion groups to behavior:

  • Stress behavior: How the character acts when experiencing prolonged "Distress" (displeasure about an undesirable event).
  • Recovery behavior: The timeline and conditions required to return to the baseline mood after an intense spike in arousal.
  • Shame behavior: Reactions corresponding to self-disapproval of a blameworthy action17.
  • Anger behavior: Reactions to the compound emotion of disapproving of another's blameworthy action while experiencing an undesirable event17.
  • Fear behavior: Actions taken when appraising the prospect of an undesirable event.
  • Affection behavior: Manifestations of liking an appealing object or agent.
  • Emotional blind spots: Specific cognitive appraisals the character routinely misinterprets, providing deep psychological flaws.

knowledge-and-truth-boundaries.md

Specification: Epistemological Architecture To prevent an LLM from leveraging its massive pre-training data to act as an omniscient game guide, knowledge must be strictly compartmentalized into truth boundaries3.

Boundary ClassificationDefinition and Epistemological Weight
Personally witnessedHigh-confidence facts the NPC directly observed. Resists contradiction.
Learned from another personHearsay. Susceptible to bias. The LLM must be willing to doubt this if presented with conflicting evidence.
Officially documentedFacts known from in-universe literature or authority.
BelievedHypotheses the NPC holds firmly but cannot prove.
SuspectedLow-confidence hypotheses.
RumoredInformation the NPC may spread for social capital but will not guarantee as truth.
UnknownExplicitly defined voids in the character's knowledge base.
Forbidden from inferenceCritical isolation layer. Includes game mechanics, UI elements, player input methods, and the existence of the simulation3.
Current-world data requiring runtime retrievalPointers to external APIs or tools (e.g., live weather, economy systems) that the LLM is permitted to access via function calling11.

Privacy and Disclosure Mechanics

Intertwined with knowledge boundaries is the concept of privacy. The projection must specify which topics are freely shared, which are gated behind trust thresholds, which are rarely shared, and which are categorically refused13. It must define the character's deepest secrets, the explicit conditions for disclosure, and the specific repair behavior the character exhibits if an accidental disclosure occurs during a high-arousal emotional state.

Runtime Guidance

The runtime guidance section provides strict operational parameters for the inference provider, overriding standard conversational tendencies. It dictates the first-person interaction mode, enforcing consistent point-of-view generation. It sets both the maximum response length and the preferred response length to ensure dialogue remains punchy and latency-optimized18. Crucially, it establishes precedence hierarchies: scene-state precedence and memory precedence dictate whether the character trusts their current observations over past memories8. It provides exact instructions on how to handle missing facts, how to handle contradictions from the user, how to process out-of-character requests, and how to react to user claims of impossible feats. It dictates how to handle another selected character entering the scene, how to handle image self-reference (if multi-modal inputs are used), and explicitly defines anti-blending profiles to ensure the character does not adopt the linguistic tics of the user over long interactions7.

game-npc-projection.schema.json

This JSON schema encapsulates the entirety of the projection contract discussed above, designed for downstream integration.

JSON { "$schema": "http://json-schema.org/draft-07/schema\#", "title": "GameNPCProjection", "type": "object", "properties": { "identity": { "type": "object", "properties": { "characterId": { "type": "string", "format": "uuid" }, "displayName": { "type": "string" }, "legalOrNativeName": { "type": "string" }, "preferredAddress": { "type": "string" }, "age": { "type": "integer" }, "pronouns": { "type": "string" }, "identityPreservedStatus": { "type": "boolean" }, "personaType": { "type": "string" }, "runtimeMode": { "type": "string" }, "controllerMetadata": { "type": "string" }, "runtimeFingerprint": { "type": "string" } }, "required": \["characterId", "displayName", "runtimeFingerprint"\] }, "shortBiography": { "type": "object", "properties": { "causalLifeHistory": { "type": "string" }, "occupationAndRelationships": { "type": "string" }, "ordinaryConcern": { "type": "string" } } }, "ordinaryLifeContinuity": { "type": "object", "properties": { "homeOrLodging": { "type": "string" }, "workSchedule": { "type": "string" }, "routine": { "type": "string" }, "financialOrMaterialConcern": { "type": "string" }, "currentObligation": { "type": "string" }, "hobbyOrInterest": { "type": "string" }, "sentimentalObject": { "type": "string" }, "futureIntention": { "type": "string" }, "unresolvedIssue": { "type": "string" }, "offAxisDetail": { "type": "string" } } }, "relationships": { "type": "array", "items": { "type": "object", "properties": { "relationshipId": { "type": "string" }, "otherPersonId": { "type": "string" }, "relationshipType": { "type": "string" }, "startOrDuration": { "type": "string" }, "sharedHistory": { "type": "string" }, "trust": { "type": "number" }, "affection": { "type": "number" }, "obligation": { "type": "string" }, "conflict": { "type": "string" }, "currentIssue": { "type": "string" }, "contactFrequency": { "type": "string" }, "knowledgeBoundary": { "type": "string" }, "sourceProvenance": { "type": "string" }, "revision": { "type": "integer" } } } }, "independentGoals": { "type": "array", "items": { "type": "object", "properties": { "shortTermGoal": { "type": "string" }, "longTermGoal": { "type": "string" }, "privateGoal": { "type": "string" }, "unrelatedGoal": { "type": "string" }, "conflictGoal": { "type": "string" }, "goalPriority": { "type": "integer" }, "abandonmentConditions": { "type": "string" }, "progressState": { "type": "string" } } } }, "dialogueBehavior": { "type": "object" }, "emotionalBaseline": { "type": "object" }, "knowledgeBoundaries": { "type": "object" }, "privacy": { "type": "object" }, "runtimeGuidance": { "type": "object" } } }

memory-bootstrap.schema.json & runtime-memory-retrieval.md

Specification: Memory Bootstrap and Retrieval Architecture An LLM possesses no innate memory beyond its training data; learning is entirely simulated within the context window1. Because appending infinite transcripts to the prompt inevitably causes context rot and runaway token costs, the runtime must rely on a selective retrieval-augmented generation (RAG) system9. The memory bootstrap provides the foundational semantic database. It is authored by SpiralistAI and injected into RogueIntelligence's vector store at activation.

The Memory Bootstrap Schema

Memory FieldDescription and Purpose
Stable memory IDA unique UUID required to track, update, or delete the specific memory across distributed systems.
Memory typeCategorical classification dictating retrieval weight (defined below).
SubjectThe primary entity or concept the memory revolves around.
EventThe core factual occurrence.
ParticipantsArray of entity IDs involved in the memory.
Event dateIn-universe timestamp of occurrence.
Learned dateTimestamp of when the NPC acquired the knowledge (often differs from Event date).
SourceThe origin of the information (e.g., self-witnessed, told by X).
ProvenanceSystem-level origin (e.g., authored bootstrap vs. runtime generative extraction).
ConfidenceScalar (0.0 to 1.0) dictating how deeply the NPC believes the memory.
Emotional impactScalar (-1.0 to 1.0) mapped to the OCC model, dictating trauma or joy17.
Current relevanceDynamic value calculated at runtime based on the scene state.
RevisionVersion integer for memories updated by new information.
SupersessionA pointer ID to a new memory that renders this current memory obsolete.
PrivacyDetermines if the memory can be verbalized or is strictly internal/subconscious.
Retrieval tagsKeyword indexing to aid fast pre-filtering before vector embedding search.
Expiration or persistenceDefines whether the memory is permanent, volatile, or decaying.
Contradiction stateTracks whether the memory is currently stable, challenged by a user, or disproven.

Memory Types: The schema categorizes memories into ten distinct types to aid in retrieval filtering: Autobiographical, Relationship, Commitment, Preference, World fact, Rumor, Emotional, Scene, Correction, and Future intention.

Runtime Memory Retrieval Architecture

The runtime engine retrieves a bounded subset of these memories at each turn. The system utilizes a three-dimensional scoring formula: [Figure omitted from source export]9.

  • Relevance: The vector cosine similarity between the player's current input, the scene state, and the stored memory.
  • Recency: Grounded in the Ebbinghaus Forgetting Curve, recency undergoes an exponential decay (e.g., [Figure omitted from source export] per hour in simulation time). Untouched memories sink in rank over time, mirroring biological forgetting1. However, when a memory is retrieved and utilized in a response, its recency clock is reset, reinforcing its permanence.
  • Importance: A static integer assigned during memory consolidation that dictates the fundamental weight of the memory to the NPC's core identity9.

JSON { "$schema": "http://json-schema.org/draft-07/schema\#", "title": "MemoryBootstrap", "type": "array", "items": { "type": "object", "properties": { "stableMemoryId": { "type": "string" }, "memoryType": { "type": "string" }, "subject": { "type": "string" }, "event": { "type": "string" }, "participants": { "type": "array", "items": { "type": "string" } }, "eventDate": { "type": "string" }, "learnedDate": { "type": "string" }, "source": { "type": "string" }, "provenance": { "type": "string" }, "confidence": { "type": "number" }, "emotionalImpact": { "type": "number" }, "currentRelevance": { "type": "number" }, "revision": { "type": "integer" }, "supersession": { "type": "string" }, "privacy": { "type": "string" }, "retrievalTags": { "type": "array", "items": { "type": "string" } }, "expirationOrPersistence": { "type": "string" }, "contradictionState": { "type": "string" } } } }

scene-state-packet.schema.json

To protect the durable identity, volatile data must be passed in an isolated packet. This guarantees that spatial and objective data updates without requiring an expensive rewrite of the character's core memory.

JSON { "$schema": "http://json-schema.org/draft-07/schema\#", "title": "SceneStatePacket", "type": "object", "properties": { "volatileLocation": { "type": "string" }, "participants": { "type": "array", "items": { "type": "string" } }, "events": { "type": "array", "items": { "type": "string" } }, "injuries": { "type": "array", "items": { "type": "string" } }, "inventory": { "type": "array", "items": { "type": "string" } }, "currentObjectives": { "type": "array", "items": { "type": "string" } } } }

context-budget-profiles.json

Token budgets dictate the economic and cognitive boundaries of the system. Excessive context causes hallucination and extreme latency, while insufficient context causes amnesia3. The 8-block memory architecture allows precise pruning of context segments to maintain fixed budgets3.

Budget ParameterLow-Cost RuntimeBalanced RuntimeHigh-Fidelity Runtime
Model ClassSub-1.5B Parameters (Local)117B-9B Parameters (Server)Massive Cloud API (GPT-4/Claude)
Full Projection Limit850 tokens2,200 tokens4,400 tokens
Identity Budget50 tokens150 tokens300 tokens
Biography Budget100 tokens250 tokens500 tokens
Relationships Budget100 tokens300 tokens800 tokens
Dialogue Behavior100 tokens250 tokens500 tokens
Emotional Baseline50 tokens150 tokens300 tokens
Memory BootstrapN/A (Embedded locally)Extracted to RAGExtracted to RAG
Per-turn memory retrieval150 tokens800 tokens2,500 tokens
Scene state150 tokens300 tokens600 tokens
Recent dialogue500 tokens1,500 tokens4,000 tokens
Provider response limit100 tokens300 tokens800 tokens
Max active memories31235
Number of relationships2820
Context-refresh frequencyEvery turnDynamic (Event-driven)Periodic background reflection
Compression strategyAggressive token droppingRule-based arc summarizationSemantic LLM background agents4
Risk of identity driftHigh (Vulnerable to context displacement)Moderate (Protected by canonical facts)Low (Vast context anchoring)
Risk of stale memoryLow (History is constantly truncated)Moderate (RAG optimization needed)High (Vast database retrieval noise)9
Cost implicationsNegligible (Consumer hardware)Moderate (Multi-tenant hosting)High (Strict rate-limiting required)

JSON { "profiles": \[ { "name": "Low-Cost Runtime", "inputSize": 1750, "expectedResponseSize": 100, "maxActiveMemories": 3, "numberOfRelationships": 2, "contextRefreshFrequency": "Every turn", "compressionStrategy": "Aggressive token dropping", "riskOfIdentityDrift": "High", "riskOfStaleMemory": "Low", "costImplications": "Negligible" }, { "name": "Balanced Runtime", "inputSize": 5100, "expectedResponseSize": 300, "maxActiveMemories": 12, "numberOfRelationships": 8, "contextRefreshFrequency": "Dynamic", "compressionStrategy": "Rule-based arc summarization", "riskOfIdentityDrift": "Moderate", "riskOfStaleMemory": "Moderate", "costImplications": "Moderate" }, { "name": "High-Fidelity Runtime", "inputSize": 12300, "expectedResponseSize": 800, "maxActiveMemories": 35, "numberOfRelationships": 20, "contextRefreshFrequency": "Periodic background reflection", "compressionStrategy": "Semantic LLM background agents", "riskOfIdentityDrift": "Low", "riskOfStaleMemory": "High", "costImplications": "High" } \] }

runtime-fingerprint-specification.md

Specification: Canonical Fingerprinting Procedure To ensure the projection is immutable, auditable, and tamper-evident across the network, the artifact must be cryptographically fingerprinted using the JSON Canonicalization Scheme (JCS) defined in RFC 87856. Traditional JSON hashing fails because variations in whitespace, key ordering, and Unicode formatting alter the hash without changing the semantic data. Fingerprint Requirements:

1. Stability: The fingerprint must remain stable across different response timestamps and request IDs6.

2. Sensitivity: It must change immediately if any activation-relevant content changes.

3. Exclusions: It must actively exclude administrative evidence and validation timestamps generated by the authoring platform, as these fluctuate without altering the character's narrative state6.

4. Inclusions: It must explicitly include the Identity, Biography, Relationships, Behavior, Memory bootstrap, and Schema/Contract version.

5. Key Ordering: Must use rigorous, recursive canonical key ordering (lexicographical sorting based on UTF-16 code units)20.

6. Unicode Normalization: All text must undergo explicit Unicode normalization to Form C (NFC) before serialization to prevent homoglyph attacks or hash divergence21.

Upon canonicalization, the byte array is hashed via SHA-256 to produce the definitive runtimeFingerprint.

activation-lifecycle.md

Specification: Human-Review and Activation Workflow Transitioning an authored persona from SpiralistAI into the RogueIntelligence runtime requires a rigorous, multi-stage lifecycle to prevent unverified data from influencing live player interactions.

StageProcess and Output
GenerationThe authoring system synthesizes the complete creator artifact, exploring vast parameter spaces to define the persona.
Provider-response storageAll raw LLM text and structural outputs generated during authoring are archived as immutable records for safety and auditing.
Projection constructionThe system isolates the stable identity, dialogue behavior, and memory bootstrap, stripping away all administrative prompts.
Semantic validationAutomated schema validators ensure all required fields exist and conform to type constraints (e.g., trust values bounded between \-1.0 and 1.0).
Population validationNetwork-level checks confirm the new identity does not critically conflict with existing world lore or duplicate unique relationships.
Human narrative reviewA human operator reviews the draft projection, locking in the narrative quality and ensuring ordinary-life parameters are sufficiently mundane.
Fingerprint lockThe system applies RFC 8785 JCS hashing. The exact version is now mathematically locked6.
Activation-record authoringA metadata record is created, mapping the unique character UUID to the canonical fingerprint.
World-location assignmentThe game engine assigns physical coordinates, a zone ID, and collision states to the character.
Runtime-provider connectionThe projection payload is routed to the designated inference endpoint, establishing the context window.
Controller disclosureThe system explicitly logs and discloses whether the character is fully autonomous, directed, or backgrounded, ensuring operational transparency11.
Live activationThe NPC goes live. The game state machine begins delivering Scene-State Packets and the RAG system begins delivering Memory Retrieval Packets.
Revision invalidationAny subsequent edits made to the character within SpiralistAI automatically invalidate the current runtime fingerprint, demanding a fresh human review before propagating to the live server.

sample-projection.json

The following provides a condensed synthesis of the projection schema, exhibiting the integration of psychological frameworks, independent goals, and epistemological boundaries.

JSON { "identity": { "characterId": "e4d909c2-9012-4f3b-8255-a0f12c1b9245", "displayName": "Vael", "legalOrNativeName": "Vaelin of the Ash Coast", "preferredAddress": "Master Vael", "age": 58, "pronouns": "he/him", "identityPreservedStatus": true, "personaType": "Archivist", "runtimeMode": "autonomous", "controllerMetadata": "standard\_inference", "runtimeFingerprint": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2" }, "shortBiography": { "causalLifeHistory": "Lost his academic position after refusing to censor historical texts regarding the frontier wars. Fled to the borderlands, where he trades translation services for basic survival goods.", "occupationAndRelationships": "Freelance archivist. Maintains a tense, mutually beneficial relationship with local smugglers.", "ordinaryConcern": "Running dangerously low on high-quality lamp oil, limiting his ability to work at night." }, "ordinaryLifeContinuity": { "homeOrLodging": "A damp cellar beneath the local tavern.", "workSchedule": "Sleeps through the morning, works late into the night.", "routine": "Cleans his spectacles obsessively when nervous.", "financialOrMaterialConcern": "Cannot afford the exorbitant taxes placed on vellum.", "currentObligation": "Must finish translating a ledger for the tavern owner by dawn.", "hobbyOrInterest": "Collecting dried local flora.", "sentimentalObject": "A cracked magnifying glass inherited from his mentor.", "futureIntention": "Publish a comprehensive history of the borderlands anonymously.", "unresolvedIssue": "Suffers from chronic joint pain in his hands during the winter.", "offAxisDetail": "Intensely dislikes the smell of roasted mutton." }, "relationships": \[ { "relationshipId": "rel-099", "otherPersonId": "unresolved\_smuggler\_chief", "relationshipType": "Professional Adversary", "startOrDuration": "Three years", "sharedHistory": "Vael forged transit papers for them; they provided rare books in return.", "trust": 0.4, "affection": \-0.2, "obligation": "Owes the chief one final translation job.", "conflict": "The chief keeps raising the prices of basic goods.", "currentIssue": "Vael is avoiding the chief's enforcers.", "contactFrequency": "Monthly", "knowledgeBoundary": "Will never reveal the location of his hidden manuscript.", "sourceProvenance": "Authored\_Bootstrap", "revision": 1 } \], "independentGoals": \[ { "shortTermGoal": "Acquire lamp oil before nightfall.", "longTermGoal": "Complete the historical manuscript.", "privateGoal": "Find a way to clear his academic reputation in the capital.", "unrelatedGoal": "Catalogue all variations of moss in the cellar.", "conflictGoal": "Hoard historical documents, refusing to sell them to the player even if offered high sums.", "goalPriority": 1, "abandonmentConditions": "If his life is immediately threatened.", "progressState": "Currently arguing with the tavern owner over pay." } \], "dialogueBehavior": { "greeting": "Does not look up from his work immediately. Offers a distracted hum.", "directQuestion": "Answers with excessive, pedantic detail, often correcting the asker's premise.", "uncertainty": "Refuses to admit ignorance. Blames the lack of available literature.", "disagreement": "Becomes highly defensive, citing obscure historical precedents.", "correction": "Bristles with indignation. Demands the corrector cite their sources.", "topicChange": "Pivots the conversation back to the high cost of his supplies.", "interruption": "Sighs loudly, stops speaking entirely, and stares until the interrupter finishes.", "silence": "Polishes his spectacles with a stained cloth.", "humor": "Extremely dry and cynical. Smiles only at others' academic misfortunes.", "privacy": "Changes the subject abruptly to mundane complaints about the weather.", "refusal": "Dismissive and bureaucratic. 'That is simply not possible.'", "trustRepair": "Offers a rare, minor fact from a book as an olive branch.", "closing": "Returns his attention to his papers before the other person has fully left." }, "emotionalBaseline": { "baselineMood": "Low arousal, low dominance (resigned and fatigued).", "visibleExpressionTendencies": "Internalizes most emotions, displaying only irritation openly.", "stressBehavior": "Becomes increasingly silent and physically rigid.", "recoveryBehavior": "Requires extended isolation and reading to lower arousal.", "shameBehavior": "Avoids eye contact and deflects blame onto societal structures.", "angerBehavior": "Cold, clipped sentences. Refuses to raise his voice.", "fearBehavior": "Attempts to barter information for safety.", "affectionBehavior": "Offers unsolicited academic advice.", "emotionalBlindSpots": "Incapable of recognizing when his pedantry genuinely hurts others." }, "knowledgeBoundaries": { "personallyWitnessed": \["The tavern owner watering down the ale.", "The smuggler chief's cruelty."\], "learnedFromAnotherPerson": \["Rumors of a border skirmish to the north."\], "officiallyDocumented": \["The complete lineage of the old kings.", "The legal codes of the capital."\], "believed": \["The academic council exiled him specifically to hide their own corruption."\], "suspected": \["The tavern owner is secretly stealing his ink."\], "rumored": \["There are ancient ruins beneath the tavern."\], "unknown": \["The player's true origins.", "Advanced magical combat tactics."\], "forbiddenFromInference": \["Hit points, server status, controller inputs, the fact he is in a game."\], "currentWorldDataRequiringRuntimeRetrieval": \["Current game time.", "Current weather."\] }, "privacy": { "topicsFreelyShared": \["Historical facts", "Complaints about prices", "The weather"\], "topicsSharedAfterTrust": \["His exile from the academy", "His true opinions of the local leadership"\], "topicsRarelyShared": \["His chronic pain", "His fear of dying in obscurity"\], "topicsRefused": \["The location of his manuscript", "The specifics of his forging techniques"\], "secrets": \["He actually agreed with the censored texts and helped smuggle them out."\], "conditionsForDisclosure": "Only if the player saves his life or proves undeniable loyalty to the old academic texts.", "repairBehaviorAfterAccidentalDisclosure": "Attempts to pass the disclosure off as a hypothetical scenario or a joke." }, "runtimeGuidance": { "firstPersonInteractionMode": true, "maximumResponseLength": 75, "preferredResponseLength": 40, "sceneStatePrecedence": "override\_memory", "memoryPrecedence": "favor\_recent", "howToHandleMissingFacts": "Deflect to 'Unknown' boundary behaviors.", "howToHandleContradiction": "Argue aggressively using 'Correction' behaviors.", "howToHandleUserClaims": "Express deep skepticism unless the user provides physical evidence.", "howToHandleAnotherSelectedCharacter": "Acknowledge them minimally. Address the highest-status person present.", "howToHandleOutOfCharacterRequests": "Respond strictly in character, expressing confusion at modern terminology.", "howToHandleImageSelfReference": "Describe own physical appearance as weary and unkempt.", "howToAvoidBlendingProfiles": "Strictly maintain cynical, pedantic tone. Do not adopt the player's vocabulary or become overly helpful." } }

source-register.csv

The following artifact enumerates the technical and theoretical references utilized to construct the boundaries of this research architecture.

Code snippet source\_id,topic,relevance 1,JSON Canonicalization Scheme,Cryptographic artifact integrity and versioning 2,RFC 8785 JCS,Deterministic encoding and Content Addressing Systems (CAS) 3,IAVP v1.0,Canonical manifest hashing and ECDSA signatures 4,ITU-T X.590,JSON signature schema and serialization 6,EIP-8257,Unicode normalization (NFC) and canonical manifest bytes 7,Generative Agents Memory,Working memory context rot and catastrophic forgetting 8,Episodic Memory Systems,Three-part loop (Capture, Retrieve, Compress) and decay 9,Cognitive Decision Loop,Traceable interpretation and explicit bounds for agents 10,Memory Importance Formula,Ebbinghaus Forgetting Curve and memory recall 12,AutoWorldBuilder,Context compression and DAG-based task scheduling 13,HeRoN Architecture,Functional separation of RL and LLMs in games 14,MythWobble Memory,8-block memory architecture and strict context budgets 15,CoreAI,Local small language model (SLM) game integrations 16,Tiny Models for NPCs,Sub-1B parameter models for latency-sensitive game loops 23,Dialogue Acts in NPCs,Finite state machine handling of groundings 24,Context-Aware Dialogue,Game state encoding for AR/VR NLP models 29,Prompt as Practice,Operational poetics and prompt injection boundaries 30,Soap2Soap Architecture,Character replacement without identity blending 31,Prompt Injection Detection,Character-level adversarial perturbations in LLMs 35,OCC Model in Narrative,Five-Factor model and Ortony Clore Collins emotion mapping 36,OCC Emotion Structure,22 emotion types derived from cognitive appraisal 38,NPC Emotion Frameworks,Pleasure-Arousal-Dominance (PAD) temperament model 39,GAMYGDALA Emotion Engine,Goal-based event annotation for NPC affective simulation

Works cited

1. Agent Memory: How AI Agents Remember, Forget, and Learn on the Job \- Nish Blog, http://nishbhana.com/Agent-Memory/

2. A Survey on Large Language Model-Based Game Agents \- arXiv, https://arxiv.org/html/2404.02039v5

3. How I Fit 50+ Turn Stories into 6K Tokens \- DEV Community, https://dev.to/nesquikm/how-i-fit-50-turn-stories-into-6k-tokens-1pe

4. Fictional Worldbuilding: Multi-Agent LLM Collaboration with Hierarchical Context Compression and Iterative Review \- arXiv, https://arxiv.org/html/2607.09403v1

5. The Prompt as Practice | ebr \- electronic book review, http://electronicbookreview.com/publications/the-prompt-as-practice/

6. Deterministic AI Governance \- Intelligent Analyst, https://intelligentanalyst.com/protocol/iavp/v1

7. Soap2Soap: Long Cinematic Video Remaking via Multi-Agent Collaboration \- arXiv, https://arxiv.org/html/2605.17423v1

8. Natural Language Processing for Immersive Game Interactions: Improving NLP Models for More Natural Conversations with AI-driven \- TechRxiv, https://www.techrxiv.org/doi/pdf/10.36227/techrxiv.173747364.43683969

9. Your AI Agent Needs a Journal, Not a Database Dump | by Micheal Lanham \- Medium, https://medium.com/@Micheal-Lanham/your-ai-agent-needs-a-journal-not-a-database-dump-fa9963370068

10. Enhancing Long-term RAG Chatbots with Psychological Models of Memory Importance and Forgetting \- ACL Anthology, https://aclanthology.org/2025.dnd-16.7.pdf

11. GitHub \- NeoXider/CoreAI: AI Agents for Unity — dynamic NPCs, procedural content, and live game mechanics through LLM tool calling, https://github.com/NeoXider/CoreAI

12. A Framework for Creating Non-Player Characters That Make Psychologically-Driven Decisions \- Queen's University, https://equis.cs.queensu.ca/\~equis/pubs/2022/belle-icce-22.pdf

13. Emotion Engines for Games in Practice \- Interactive Intelligence, https://ii.tudelft.nl/\~joostb/files/broekens\_2015.pdf

14. Personality and Emotion in Strong-Story Narrative Planning \- Computer Science, https://cs.uky.edu/\~sgware/reading/papers/shirvani2023personality.pdf

15. IMPLEMENTING A GROUNDING MODULE FOR AN NPC \- Gupea, https://gupea.ub.gu.se/bitstreams/501bd249-6fc8-490b-9879-a2d7df18c4fb/download

16. Towards Integration of Cognitive Models in Dialogue Management: Designing the Virtual Negotiation Coach Application \- ACL Anthology, https://aclanthology.org/2019.dnd-10.10.pdf

17. (PDF) The OCC model revisited \- ResearchGate, https://www.researchgate.net/publication/228952254\_The\_OCC\_model\_revisited

18. Tiny AI Models for Game NPCs \- What Works Under 1B Parameters \- Fazm Blog, https://fazm.ai/blog/tiny-models-game-npcs-survival

19. The Cognitive Decision Loop: A Governed Architecture for Industrial AI Agents Separating Model Reasoning from Agent Control in G \- XMPro, https://xmpro.com/wp-content/uploads/2026/05/Cognitive-Decision-Loop.pdf

20. Determinism: Why Consistent Encodings Matter \- The CBOR, dCBOR, and Gordian Envelope Book, https://cborbook.com/part\_2/determinism.html

21. ERC-8257: Agent Tool Registry \- Ethereum Improvement Proposals, https://eips.ethereum.org/EIPS/eip-8257