Procedural Narrative Generation: Can AI Write Stories Worth Playing?

Photo: Nana Dua / Pexels
Every player who completed The Last of Us experienced essentially the same story. The narrative was authored with the care of a prestige television production — beautifully crafted, emotionally resonant, and identical for every player who played it. That approach produces some of gaming's most moving moments, but it also has a ceiling: once you know the story, it's over. Procedural narrative generation asks a different question. What if every player's story were unique to them, built from systems rather than scripts, and impossible for anyone else to replicate exactly? That question has pulled together roguelike designers, narrative writers, and, more recently, large language model researchers into one of the more interesting technical problems in game design.
Key takeaways
- Procedural narrative spans a spectrum: pure emergent storytelling (Dwarf Fortress), authored-but-assembled prose (Fallen London), legacy-driven hybrid systems (Wildermyth), and freeform language-model generation (AI Dungeon)
- AI narrative generation has to balance authored intent against procedural variety, or the output collapses into incoherence, repetition, or content that breaks the game's tone
- Studios have taken sharply different positions on generative AI in narrative — Ubisoft built an in-house tool (Ghostwriter) for first-draft NPC barks, while Larian Studios has publicly rejected AI-written dialogue for its games
- Large language models are the most capable current technology for natural-language narrative generation, but persistent-memory, consistency, and moderation problems remain unsolved at scale
What "procedural narrative" actually covers
"Procedural narrative" is a broad label, and a lot of the confusion around AI storytelling in games comes from people using the term to mean four or five different things at once. It helps to think of it as a spectrum rather than a single technique, with the differences hinging on one question: where does the actual language come from, and how much of the story structure is designed in advance?
At one end sits pure emergent narrative — story that arises from simulated characters and world systems interacting in ways the designer never explicitly wrote. Nobody typed the sentence "a dwarf went insane, caught fire, and killed three of his former friends with a hammer." That happened because a simulation of psychological stress, flammable terrain, and combat resolution collided in an unplanned way, and a player narrated it afterward. This is what Dwarf Fortress is famous for, and it is arguably the purest form of procedural narrative because there's no natural-language generation involved at all — the "writing" is done entirely by human players interpreting simulation logs.
Moving along the spectrum, you get authored-but-assembled narrative: large databases of pre-written prose, assembled and sequenced by algorithms in response to player choices, random draws, and world state. Failbetter Games' Fallen London is the reference example. Every sentence in the game was written by a human, but which sentences you see, in what order, and in what combination is determined procedurally. It's closer to a card game than a chatbot.
Further along still is legacy-driven hybrid narrative, where systems generate the shape of a story — which characters meet, what relationships form, which plot beats trigger — while natural-language content is drawn from a large pool of authored fragments assembled contextually, similar to Fallen London's approach but wrapped in tactical RPG structure and persistent character legacies across playthroughs, as seen in Worldwalker Games' Wildermyth.
At the far end is generative narrative — systems where a machine learning model, typically a large language model (LLM, a neural network trained on enormous text corpora to predict and generate coherent language), produces genuinely new sentences in response to player input, with no pre-written text underneath at all. This is the newest and least mature end of the spectrum, and it's where most of the current excitement and most of the current problems live.
Dwarf Fortress and the system-design approach to story
Bay 12 Games' Dwarf Fortress is the reference point for emergent narrative because its legendary status rests almost entirely on stories the developers never wrote. The game simulates an entire world's history — decades or centuries of wars, dynasties, migrations, and disasters — before your fortress even begins. Every dwarf you control carries a simulated personal history: relationships, grudges, artistic obsessions, and traumas that can resurface in play.
The design insight underneath all of this is that narrative can emerge naturally from simulating agents with motivations, memories, relationships, and goals inside a sufficiently complex world. The designer's job shifts from writing a story to designing a system that reliably produces interesting outcomes rather than chaotic or boring ones. That's a genuinely different craft. A narrative designer asks, "What happens next in this scene?" A systems designer building for emergent narrative asks, "What rules make interesting scenes likely to happen on their own?"
Rimworld, from Ludeon Studios, adopted a closely related philosophy with its "storyteller" AI systems — Cassandra, Phoebe, and Randy Random — which modulate the pacing and intensity of random events to create dramatically satisfying arcs rather than purely uniform randomness. Rimworld designer Tynan Sylvester has described the role of a good storytelling-game designer as being closer to a system architect than a novelist: you're building the conditions under which good stories emerge, not writing the stories themselves.
Caves of Qud, from Freehold Games, pushes the same idea into the game's deep lore. Its world generation produces a sequence of "sultans" — procedurally generated rulers, each with a randomly assembled biography built from a pool of possible life events (roughly 10 to 22 per sultan, drawn from around 17 event types), stitched into origin stories and later recounted to players through in-game legends, ruined statues, and tapestries discovered in any order and reassembled chronologically in a journal. Freehold Games has published a technical paper on the system, "Generation of Mythic Biographies in Caves of Qud," describing exactly how the procedural mythology is constructed. Source: Freehold Games, "Generation of Mythic Biographies in Caves of Qud"
What makes emergent narrative different from a random event generator?
A random event generator fires isolated occurrences with no memory of what came before. Emergent narrative requires persistent state — characters who remember, relationships that accumulate, and consequences that carry forward — so that later events are shaped by earlier ones. That persistence is what turns a sequence of random rolls into something a player experiences as a story rather than noise.
Fallen London and the writer-first model of proceduralism
London studio Failbetter Games took a very different route with Fallen London and its spinoff Sunless Sea: an enormous library of authored prose, written with real literary craft, procedurally assembled in response to player choices and random draws. The database of hand-written text is large enough, and the assembly logic rich enough, that players experience genuinely varied narrative threads without the system ever generating a single new word.
This is best described as "authored procedural narrative." The proceduralism lives entirely in selection and sequencing, not in language generation. It scales because writers produce content at the granularity of individual cards or story fragments rather than complete branching trees, and the combination logic does the assembly work that would otherwise require exponentially more authored branches.
The practical effect is that Fallen London reads more like literature than most game writing, precisely because every sentence was written by a person with intent, not sampled from a probability distribution. The system's role is curatorial rather than generative: it decides what to show you and when, not what the words should be. That distinction matters enormously for quality control, which is the recurring theme of everything downstream on the spectrum toward full LLM generation.
Wildermyth: legacy systems as a middle path
Wildermyth sits between Fallen London's assembly model and full generative AI, and it's worth studying separately because of how it solves the coherence problem that plagues purer procedural systems. The game generates comic-panel "story events" built from pools of authored content, triggered by the "hooks" — traits, relationships, and history — that your characters have accumulated. Reviewers have compared its structure to oral storytelling traditions, where the broad shape of a tale stays consistent while the specific details shift with each telling. Source: Vice, "'Wildermyth' Embraces Storytelling Traditions in a Procedural Narrative"
Wildermyth's most distinctive feature is its legacy system: characters who become "legendary" in one campaign can be recruited into future campaigns, carrying their accumulated myth forward. Over multiple playthroughs, a player builds up a personal canon of heroes whose stories interlock across separate games — something neither pure emergent simulation nor pure authored-database systems achieve on their own. It's a reminder that some of the most compelling procedural narrative design doesn't require any machine learning at all; it requires clever bookkeeping and a hands-off narrative style that leaves room for players to fill gaps with their own interpretation.
Large language models: the new frontier, and its problems
The arrival of genuinely capable large language models changed what's technically possible in game narrative. For the first time, a system can generate contextually coherent natural-language content, respond to freeform player input rather than menu choices, and maintain something resembling a character voice across a conversation, all without a human writing each individual line in advance.
AI Dungeon, built by Latitude and first powered by OpenAI's GPT-2 and later more capable GPT models, was the first widely played demonstration of this. It presented players with an effectively infinite text adventure: type anything, and the model continues the story. It was, by most accounts, occasionally brilliant and often incoherent — because the underlying model had no persistent world model, no authorial control over pacing or structure, and no reliable mechanism for preventing contradictions with earlier events in the story.
AI Dungeon also became the clearest cautionary tale in the industry about what happens when generative narrative systems are deployed without adequate moderation infrastructure. In 2021, reporting from outlets including Wired and the Register revealed that some AI Dungeon players had used the model to generate sexual content involving minors, prompting OpenAI to require Latitude to implement stricter automatic content filtering. Source: TechDirt, "Content Moderation Case Study: Game Developer Deals With Sexual Content Generated By Users And Its Own AI (2021)" The filtering rollout itself caused a second controversy: the new system over-blocked innocuous text — one widely cited example was a sentence describing an "8-year-old laptop" getting flagged — and players reported being banned for content the AI itself had generated unprompted. By mid-August 2021, Latitude had shifted to routing flagged content through its own moderation models rather than relying solely on OpenAI's filter, in an attempt to reduce false positives while still catching genuinely harmful output. Source: TechSpot, "Machine-learning text adventure AI Dungeon is now being censored and users are furious"
That episode is the clearest illustration of why almost no major studio has shipped a fully open-ended, unconstrained LLM narrative system since. The lesson the industry took from it wasn't "don't use language models" — it was "don't give a language model unconstrained creative freedom in a live product without serious guardrails."
More sophisticated architectures that followed AI Dungeon try to address these failures with structure. Instead of letting a language model freely generate an entire story, they maintain explicit world state — character locations, relationship values, active plot threads, established facts — as structured data outside the model, and use the LLM only to translate that state into natural language on demand. The model handles voice and phrasing; a separate logic layer handles consistency. This "constrained generation" pattern, where an LLM writes the sentence but a rules engine decides what the sentence is allowed to be about, is now closer to industry standard practice than the free-generation approach AI Dungeon originally used.
How do developers keep LLM-generated dialogue in character?
Most production systems constrain the model with a persistent character sheet — personality traits, speech patterns, relationship history, and facts it's allowed to reference — fed into the prompt on every generation, combined with a structured world-state layer the model cannot contradict. Some studios also fine-tune (further train a pre-trained model on a narrower, curated dataset) a base model on sample dialogue in the target voice before deployment.
Where studios have actually landed on generative AI
The industry's actual behavior on this question is far more cautious than the AI Dungeon-era hype suggested, and the split between studios is instructive.
Ubisoft built an in-house tool called Ghostwriter, disclosed publicly in March 2023, that is explicitly scoped to a narrow task: generating first-draft "barks" — the short ambient lines NPCs say during gameplay, not core story dialogue. A writer specifies the character and interaction type, Ghostwriter produces several draft variations, the writer edits and selects, and the system's back-end tool (called Ernestine) lets teams train new models for specific characters over time. Ubisoft framed the entire tool as a way to free up writer time for higher-value work rather than as a replacement for the writing team. Source: TechCrunch, "Ubisoft's new AI tool automatically generates dialogue for non-playable game characters"
Larian Studios has taken the opposite public position. Studio head Swen Vincke has stated plainly that Larian is "hiring writers, not having ChatGPT write their dialogues," and lead writer Adam Smith has said that when the studio experimented with AI text generation for narrative purposes, the results were "3/10 at best" and didn't meaningfully speed up development. Source: PC Gamer, "Larian Studios' Swen Vincke does see potential uses for AI, but: 'We're hiring writers, not having ChatGPT write their dialogues'" Baldur's Gate 3's enormous dialogue database — widely reported to contain roughly two million words of recorded dialogue — was written entirely by Larian's human writing team, including Adam Smith, Chrystal Ding, and Sarah Baylus, with Vincke emphasizing that every line passes through "a great many eyes and hands" before it ships.
Separately, dedicated AI-NPC platforms like Inworld AI have moved from experimental demos to production deployments at real scale. At GDC 2025, Inworld reported response latencies around 200 milliseconds, down from the one-to-two-second delays typical of earlier cloud-based conversational AI, making real-time dialogue with an NPC feel closer to a live conversation than a chatbot exchange. Source: Inworld AI, "GDC 2025: Beyond prototypes to production AI" The company has partnered with Virtuos, a large-scale AAA co-development studio, and with NVIDIA on ACE-powered teammate NPCs in PUBG: BATTLEGROUNDS, one of the most-played titles on Steam. These deployments tend to sit at the "flavor dialogue and ambient conversation" layer of a game rather than replacing authored main-quest narrative, which mirrors the caution studios like Larian have expressed about handing core story content to a model.
The quality control challenge: keeping generated stories good
The fundamental problem with LLM-driven narrative generation isn't that the technology can't produce plausible sentences. It's that language models hallucinate (state something confidently that isn't true or consistent with established facts), contradict earlier content once a conversation runs long, lose character consistency over extended context, and occasionally generate output that's offensive, tonally wrong, or simply flat. None of these are solved problems, and all of them get worse the more creative freedom you give the model.
Several mitigation strategies have emerged across the industry, echoing the AI Dungeon lesson: fine-tuning base models on curated, genre-appropriate narrative data to establish a quality and tone baseline before deployment; building explicit narrative-structure constraints that the model has to respect, so it can't wander outside the boundaries of an authored plot; and maintaining human editorial review over any content that could plausibly reach players outside a tightly scoped sandbox. None of these approaches is a complete fix — they're closer to layered risk reduction than a guarantee.
The most credible near-term deployment pattern isn't fully generative story, and the industry's actual behavior — Ubisoft's narrow bark-generation scope, Larian's outright rejection of AI for core dialogue, Inworld's focus on ambient NPC conversation rather than main plot — reflects that. The pattern that's actually shipping is authored narrative structure combined with LLM-generated texture around the edges: the main story beats, quest structure, and key emotional moments are written and edited by humans for quality and coherence, while lower-stakes conversational filler is where generative variety gets deployed, constrained by character sheets and world state the model isn't allowed to contradict.
What people get wrong about AI and game writing
The most common misconception is treating "procedural narrative" and "AI-generated narrative" as synonyms. As the Dwarf Fortress and Fallen London examples show, some of the richest procedural storytelling in gaming's history involves zero machine learning — it's simulation depth or clever content assembly, not generative AI. Calling all of it "AI storytelling" flattens a genuinely important distinction between systems that generate story structure and systems that generate language.
A second common error is assuming that because a language model can produce a grammatically fluent paragraph, it understands narrative structure — pacing, foreshadowing, thematic payoff, character arcs with a beginning, middle, and end. It doesn't, at least not reliably across an extended interactive experience. LLMs are excellent at local coherence — the next sentence usually follows sensibly from the last — and much weaker at global coherence across a story spanning hours of play. That's precisely why the industry's actual deployments constrain models to short, bounded outputs (a single line of dialogue, a bark, a flavor description) rather than letting them drive an entire plot.
A third misconception, fueled partly by AI Dungeon's early hype cycle, is that generative narrative is close to replacing human writers outright. The available evidence from studios that have actually tried it — Larian's "3/10 at best" assessment, Ubisoft's explicit framing of Ghostwriter as a first-draft assist rather than a finished product — points the other way. The near-term trajectory looks like tool adoption for specific, bounded tasks (first drafts of ambient barks, variation generation for repetitive lines) rather than wholesale replacement of narrative design as a discipline.
What this means
Procedural narrative generation isn't one technology racing toward replacing authored storytelling — it's a decades-old design tradition, running from Dwarf Fortress's pure simulation through Fallen London's assembled prose and Wildermyth's legacy systems, that large language models have extended into a new and still-immature register: freeform natural-language generation. The studios actually shipping this technology today, from Ubisoft to Inworld, are deploying it narrowly, at the level of ambient dialogue and first-draft assistance, precisely because the AI Dungeon era showed what happens when generative narrative runs without structural guardrails. The interesting design problem isn't "can AI write a story" — Dwarf Fortress already proved systems can produce stories nobody explicitly wrote. It's how much authorial control you're willing to trade for how much variety, and every game on this spectrum is really just a different answer to that trade-off.
FAQ
What is the difference between emergent narrative and procedural narrative generation? Emergent narrative arises from simulated systems — characters with goals and relationships producing story as a side effect, as in Dwarf Fortress. Procedural narrative generation is the broader category: any algorithmic process, increasingly including machine learning, that actively assembles or generates story content like dialogue, events, or descriptions. Emergent narrative is one point on the procedural narrative spectrum, not a separate category from it.
Can AI write stories as compelling as human authors? Not currently for sustained, structured narrative with emotional depth and thematic coherence. Larian Studios' lead writer described AI-generated narrative text as "3/10 at best" after internal testing, and no major studio has shipped a full game with AI-authored main-quest dialogue as of 2026. AI is more effective as a first-draft or variation tool under human editorial control than as an independent author.
What games have the best procedural narrative systems today? Dwarf Fortress and Rimworld for pure emergent narrative from simulation. Fallen London and Sunless Sea for authored-and-assembled prose systems. Wildermyth for a legacy-driven blend of authored content and procedural combination. Caves of Qud for richly generated world mythology and sultan histories. AI Dungeon remains the reference point for freeform LLM narrative, including its well-documented quality and moderation limitations.
Will AI eventually replace narrative designers and game writers? The likelier outcome, based on how studios are actually using the tools, is transformation of specific tasks rather than wholesale replacement. Ubisoft's Ghostwriter generates first drafts of minor ambient dialogue that human writers then edit; core story writing at studios like Larian remains fully human-authored. Narrative designers may increasingly design the systems and constraints that shape AI-generated filler dialogue, while continuing to author the load-bearing story beats themselves.
How do developers prevent AI narrative systems from generating inappropriate content? The main approaches are content-filtering layers, fine-tuning on curated appropriate data, explicit structural constraints on what the model is allowed to generate, and human editorial review at design time. AI Dungeon's 2021 moderation crisis, where players used the model to generate content involving minors and the resulting filter then over-blocked harmless text, is the clearest case study in why unconstrained generative narrative systems are risky without layered safeguards.
Why did AI Dungeon's content moderation cause a public backlash? After reports that some players generated sexual content involving minors, OpenAI required Latitude to tighten automatic filtering on AI Dungeon in April 2021. The new filter was rolled out without warning players and produced frequent false positives, flagging innocuous text and banning users for content the AI itself had generated unprompted, which triggered widespread criticism before Latitude revised its moderation approach roughly four months later.
Is procedural narrative the same as procedural generation in general? No. Procedural generation is the broader technique of using algorithms to create content — terrain, levels, items — from a seed value, as covered in how procedural generation creates infinite game worlds. Procedural narrative generation applies that same algorithmic-creation idea specifically to story content: dialogue, events, character histories, and plot structure.
Do large language models remember earlier parts of a game's story? Only within their context window (the amount of text the model can process at once) unless the system is built with an external memory layer. Most production narrative systems solve this by storing key facts and relationships as structured data outside the model and re-injecting the relevant pieces into each generation request, rather than relying on the model's raw context alone to "remember" a long game.
What is a "storyteller AI" like Rimworld's Cassandra or Phoebe? These aren't language-generating AI in the LLM sense. They're pacing systems that decide when and how intensely random events fire — raids, disasters, opportunities — based on the recent history of what's happened to the player, aiming for a dramatically satisfying rhythm rather than uniform randomness. Rimworld designer Tynan Sylvester has described this role as system design for drama, a distinct discipline from writing dialogue or prose.
Are LLM-powered NPCs actually deployed in major games today, or is it still experimental? It's moved past purely experimental status. Inworld AI reported real-time response latencies around 200 milliseconds at GDC 2025, is used by studios including Ubisoft and NetEase, and powers NVIDIA ACE-based teammate NPCs in PUBG: BATTLEGROUNDS, one of the most-played titles on Steam. These deployments are generally scoped to ambient or companion dialogue rather than core scripted narrative.
Read next:
Follow new articles
Add SciHub101 to your feed reader to see new science and technology stories.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. AI tools assist with drafting and research. Source documentation in the existing archive is uneven, and articles are being reviewed and corrected. The Editorial Team byline identifies editorial responsibility; it does not certify specialist or independent human review. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.
Related Articles

Women in Gaming: Breaking Barriers and Building Community
Women comprise half of gamers but are underrepresented in development, leadership, and visibility. The industry is changing, but progress is slow.

How Game Engines Work: Unity vs Unreal Explained
Every modern game runs on a game engine — a vast software framework that handles rendering, physics, audio, input, and much more. But what exactly is a game engine doing under the hood, and why does the choice between Unity and Unreal matter so much?

Machine Learning and Procedural Level Generation: Infinite Worlds by Design
Machine learning is transforming procedural generation from random noise into intelligent design, creating game worlds that feel handcrafted yet never repeat.

Neural Networks and Physics Simulation: How AI Is Rewriting the Rules of Game Engines
Neural networks are replacing traditional physics equations in game engines, enabling more realistic simulation of fluids, cloth, destruction, and character motion at real-time speed.

AI-Powered Game Testing: How Machine Learning Is Transforming Quality Assurance
AI testing agents can play through games thousands of times overnight, finding bugs and balance issues that human QA testers would take months to discover.

AI-Generated Game Assets: How Machine Learning Is Transforming Game Art Production
AI art generation tools are reshaping game development pipelines, enabling smaller teams to produce AAA-quality assets faster than ever before.