Case Study 2: Dwarf Fortress --- When Emergence Produces Unplanned Narrative
The Most Complex Simulation Ever Built
In 2002, Tarn Adams began work on a game. Twenty-four years later, he is still working on it. Dwarf Fortress is not a product that shipped. It is an ongoing project of simulation, and it has produced more emergent narrative than any other game in history.
The premise is deceptively simple: you manage a colony of dwarves who have established a fortress in a procedurally generated fantasy world. You designate areas for mining, farming, crafting, and sleeping. You assign jobs. You build defenses against goblin sieges, megabeasts, and the occasional forgotten horror from the deep earth. You try to keep your dwarves alive, productive, and sane.
You will fail. This is the game's unofficial motto: "Losing is fun."
But the failure is rarely mechanical. You do not lose because you ran out of resources or because the combat was too difficult. You lose because the simulation produced a sequence of events so complex, so interconnected, and so dramatic that the fortress collapsed under the weight of its own emergent narrative. And when it does, you have a story. A real, unique, unrepeatable story.
The Depth of the Simulation
To understand why Dwarf Fortress produces narrative, you need to understand what it simulates.
Individual dwarves have:
- Personality traits: Over 50 personality axes (anxiety propensity, anger propensity, depression propensity, gregariousness, love of nature, etc.) that affect behavior, social interactions, and stress responses.
- Skills: Over 100 skills (mining, cooking, woodworking, fighting, socializing, etc.) that improve with practice and affect job performance.
- Relationships: Friendships, enmities, romantic partnerships, family bonds. Dwarves form opinions about other dwarves based on interactions, shared values, and events.
- Memories: Dwarves remember significant events: deaths of friends, horrifying sights, beautiful crafts, good meals, terrible meals, rain, being attacked. Memories affect mood for weeks or months.
- Needs: Dwarves need food, drink, sleep, social interaction, creative expression, worship, and exposure to nature. Unmet needs cause stress.
- Physical bodies: Each dwarf has a body with individually tracked organs, bones, muscles, nerves, and tissues. Injuries are specific: a broken left arm, a torn right lung, a bruised liver. Each injury has functional consequences (a dwarf with a broken arm cannot carry heavy objects).
The world has:
- History: Before the game begins, a world history is generated: civilizations rise and fall, wars are fought, heroes emerge, artifacts are created. This history is not flavor text. It is a simulated sequence of events with consequences that persist into the present.
- Geography: Mountains, rivers, oceans, biomes, minerals, underground caverns with unique ecosystems.
- Civilizations: Dwarves, humans, elves, goblins --- each with their own settlements, leaders, armies, and diplomats. Relations between civilizations change based on trade, conflict, and treaties.
- Ecology: Animals, plants, fish, insects --- each with simulated anatomy, behavior, and life cycles.
The result is a world of extraordinary depth. And within that world, dwarves --- each carrying fifty personality traits, a hundred skills, a network of relationships, a body of memories, and a set of unmet needs --- interact with each other, with the environment, and with the events the simulation generates.
How Stories Emerge
The stories Dwarf Fortress produces are not authored. There is no quest designer, no dialogue writer, no narrative director. The stories emerge from the collision of simulated systems.
The Tantrum Spiral
The most infamous emergent narrative pattern in Dwarf Fortress is the tantrum spiral. It works like this:
- A dwarf's pet cat is killed by a goblin raid.
- The dwarf, who had high anxiety propensity and a strong bond with the cat, becomes deeply unhappy.
- The unhappy dwarf refuses to work. Other dwarves must pick up the slack, increasing their own stress.
- The grieving dwarf starts a fight with another dwarf in the dining hall.
- A bystander is injured in the fight. The bystander's friend becomes angry about the injury.
- The angry friend attacks the original dwarf. More bystanders are drawn in.
- A child witnesses the violence and becomes traumatized. The child's parent becomes enraged.
- Within the simulation equivalent of a few days, the entire fortress is consumed by violence, grief, and madness.
No designer wrote this sequence. It emerged from the interaction of the emotion system (grief from pet death), the social system (friends reacting to injury), the combat system (fights causing physical harm), the memory system (trauma from witnessing violence), and the relationship system (parents protecting children). Each system is operating according to its own rules. The combination of those rules, applied to a dense social network of interdependent dwarves, produces narrative.
The Artifact
Another characteristic Dwarf Fortress story type is the artifact creation sequence:
- A dwarf with high creativity and low social connection becomes isolated.
- The dwarf enters a "strange mood" --- a compulsion to create something.
- The dwarf claims a workshop and demands specific materials: three rubies, adamantine bars, giant cave spider silk, and the bone of a forgotten beast.
- If the materials are provided, the dwarf creates a legendary artifact --- a masterwork item with a unique name, description, and properties. The artifact's decorations reference events from the dwarf's memories: engravings of the goblin siege that killed their friend, images of the cat they lost, depictions of the mountain homeland.
- If the materials cannot be provided, the dwarf goes insane. They may become violent, catatonic, or suicidal.
The artifact's description is procedurally generated from the dwarf's memories and the fortress's history. It is not random text. It is a record of the simulation's events, filtered through one dwarf's perspective. Players have found artifacts that depict the founding of the fortress, the death of a beloved leader, or the killing of a dragon that terrorized the region for years. The artifact is a piece of emergent art about emergent history.
🪞 Reflection: The artifact system demonstrates something profound about emergent narrative: when simulated beings create art that reflects their simulated experiences, the narrative achieves a recursive depth that authored narrative cannot replicate. The artifact is not a loot drop with a flavor text. It is a simulated creative act by a simulated being with simulated memories of simulated events. And yet the story it tells --- of loss, obsession, and the compulsion to create meaning from suffering --- is recognizably, movingly human.
The Narrative Engine's Architecture
Tarn Adams did not set out to build a narrative engine. He set out to build a simulation. The narrative is a byproduct --- a consequence of the simulation's depth.
The architecture has three layers:
Layer 1: Individual simulation. Each entity (dwarf, animal, goblin, historical figure) has internal state: personality, relationships, memories, needs, skills, physical body. This internal state is updated every game tick based on events and interactions.
Layer 2: Social simulation. Entities interact with each other: conversations, fights, collaborations, romances, rivalries. Each interaction modifies both participants' internal states. A fight creates memories of violence in the participants and witnesses. A shared meal creates memories of companionship.
Layer 3: World simulation. The world generates events: weather, goblin raids, trade caravans, megabeast attacks, cave collapses, aquifer breaches. Each event affects entities and the environment, creating new states that trigger new interactions.
The narrative emerges from the vertical integration of these layers. A world event (goblin raid) affects an entity's state (pet killed) which triggers a social interaction (fight) which creates memories (trauma) which affect other entities' states (grief) which trigger further social interactions (more fights) which affect the world (fortress collapses).
Each layer is relatively simple. The depth comes from their integration.
The Limitations of Pure Emergence
Dwarf Fortress also reveals the limitations of emergent narrative:
Pacing is uncontrolled. Some fortresses produce incredible drama in the first year. Others are stable and boring for decades before anything happens. The simulation does not know about narrative pacing, rising action, or climax. It runs the rules and produces whatever the rules produce.
Coherence is not guaranteed. A dwarf might starve to death standing next to a food stockpile because the pathfinding algorithm cannot find a route. A legendary warrior might be killed by a stray kitten (cats can scratch, and a scratch that severs an artery is lethal). The simulation produces events that are logically consistent within the system's rules but narratively absurd by human standards.
The player must supply meaning. The simulation produces events. The story is constructed by the player from those events. Two players experiencing the same sequence of events may interpret them differently --- one sees tragedy, the other sees comedy. The narrative is a collaboration between the simulation (which produces events) and the player (who interprets them).
Readability is a challenge. Dwarf Fortress's original ASCII interface made it notoriously difficult to read the emergent events. The 2022 Steam release with graphical tiles improved readability significantly, but the game still requires the player to invest significant effort into understanding what is happening. An emergent system that the player cannot read is an emergent system that does not produce stories --- it produces data.
⚠️ Common Pitfall: Do not look at Dwarf Fortress and conclude that you need twenty years of development to produce emergent narrative. Rimworld --- which is explicitly inspired by Dwarf Fortress but designed for accessibility --- produces compelling emergent narratives with far simpler systems. The difference is focus: Rimworld prioritizes the systems that produce the most narrative value (colonist needs, social interactions, dramatic events) and simplifies or omits the rest (individual organ tracking, historical world simulation). You do not need total simulation. You need focused simulation of the systems most likely to collide in interesting ways.
Lessons for Your Game
Dwarf Fortress is an extreme case. You are building a 2D action-adventure, not a colony management simulation. But the principles apply:
-
Give entities internal state. Even simple enemies become narrative participants when they have state: fear (flee from fire), loyalty (protect allies), grudges (target the player who killed their friend). Two boolean flags on an enemy produce four behavioral variants. Four flags produce sixteen. State creates character.
-
Let systems interact vertically. A world event (fire) should affect entity state (enemy becomes afraid). Entity state (afraid) should affect social interaction (enemy flees, abandoning allies). Social interaction (abandonment) should affect other entities' state (abandoned allies become angry). Vertical integration is how single events become stories.
-
Accept absurdity. Some emergent outcomes will be silly, broken, or incoherent. This is the price of emergence. The stories that work --- the dramatic, surprising, emotionally resonant ones --- are worth the occasional absurdity. Players will forgive a cat killing a warrior if the fortress siege that preceded it was the most intense hour of gameplay they have ever experienced.
-
Build readability. The best emergent narrative in the world is worthless if the player cannot perceive it. Log events. Show notifications. Animate consequences. If an enemy flees from fire, make the fleeing visible and dramatic. If a chain reaction destroys a building, show each step of the destruction clearly. The player constructs the story from what they observe. Give them clear observations.
-
Start small. Dwarf Fortress was built over two decades, one system at a time. Start with one or two entities with simple internal state. Watch what happens when they interact. Add a system. Watch again. Emergent narrative grows organically from layered simulation, not from a single massive design document.
Tarn Adams did not design stories. He designed systems that produce stories. That distinction is the essence of emergent narrative, and it applies whether you are simulating a dwarven civilization or a single room with two goblins and a burning torch.