LIVING WORLDS

AI-DRIVEN STORYTELLING

Role
Technical architect
Pipeline
Claude Opus · ComfyUI · ElevenLabs · Gemini Flash TTS · Python
Context
MA Applied Literary Arts Thesis · Memorial University
The breakdown
Generated still from The NPC That Remembers research project: a long-context AI character holding emotional continuity across an extended conversation

Generative characters can talk forever, but a story only works if they remember their past. To keep players immersed without heavy scripting, this project introduces a custom pipeline that enforces long-context emotional consistency in AI dialogue. It is an exploration of what happens when a dynamic NPC is engineered not just to speak, but to remember, react, and carry a continuous narrative arc.

AI can bring a game world to life, but players don't actually want realism — they want the feeling of it. This project is built on that distinction. Rather than choosing between scripted storytelling and generative dialogue, it introduces a hybrid drama manager that pairs traditional heavy scripting with an AI layer — preserving the quality of authored narrative while dynamically releasing beats and holding emotional consistency across long play sessions. The system serves the story, not the other way around.

If the drama manager is what makes the story move, the memory system is what makes it cohere. Every exchange is written to a layered store: a short-term buffer of recent turns, a rolling mid-term summary, and a long-term vector index of past scene embeddings. Each NPC reads from a memory scoped to what they actually witnessed, and when two characters meet, their retrievals cross-check before the next line is generated. The result is a cast that can hold a forty-turn conversation, recall what happened three scenes ago, and stay consistent with each other and with themselves.

The interesting finding was not technical. The pipeline works: long-context memory, image, voice, and music orchestrated in real time on a single machine. The harder lesson was about realism itself. As the AI becomes more capable of producing it, that realism can begin to conflict with the experience the player actually came for, which loops back to where the project started: story before system. A character only feels consistent if the author has decided, in advance, what the character is consistent about. The model can hold memory, but it cannot decide what is worth remembering, and that decision stays with the writer.

Final still from The NPC That Remembers thesis prototype, illustrating the realized long-context AI pipeline in scene.

Contact Me

I'd love to hear about your next project.

Email ishunl@outlook.com
Phone 709-216-9818
LinkedIn linkedin.com/in/i-shun-lo