Abstract
Problem: How did a team of only 14 people create the rich, reactive dialogue that Arcanum is known for?
Approach: Tim Cain designed a system of "dialog op codes" β single-letter commands that expanded into entire dialogue subtrees, pulling from banks of lines organized by NPC social class, player race, gender, and game state.
Findings: The system handled greetings, money requests, quests, rumors, insults, training, and more β all with built-in variety and reactivity. The greeting op code alone tested over 11 conditions (death, active spells, armor, reputation, prior meetings) to generate contextually appropriate NPC responses.
Key insight: A well-designed procedural dialog system can multiply a small writing team's output enormously while simultaneously increasing reactivity β something Tim Cain believes modern LLMs could take even further.
Source
The Problem: 14 People, Massive RPG
Arcanum had at most 14 developers, with even fewer narrative designers writing dialogue. The generated dialog system let those few writers produce enormous amounts of content while maintaining variety and reactivity across the entire game.
How Op Codes Worked
Dialog op codes were single-letter commands (like M: or Q:) placed where normal NPC or PC dialogue would go. They were followed by a colon and optional parameters.
The critical thing: an op code didn't produce a single line β it expanded into an entire dialogue subtree with multiple branches, responses, and outcomes. Every expansion pulled from banks of pre-written lines organized by NPC social class and other variables, so even a single op code produced dozens of possible variations.
NPC Social Classes
Every NPC had one of 11 social classes, listed from highest to lowest standing:
- Noble
- Priest
- Wizard
- Technologist
- Shopkeeper
- Guard
- City Dweller
- Villager
- Beggar
- Thief
- Bandit
These classes determined how NPCs said things β a noble asking for money sounds completely different from a beggar doing the same.
NPC Op Codes
Money (M)
Writing M:100 expanded into a full conversation tree: the NPC asks for 100 coins (phrased according to their social class), the PC can say yes or no, and the system handles insufficient funds, success, and refusal β all automatically.
Greeting (G) β The Most Complex Op Code
The greeting op code was responsible for most of Arcanum's famous reactivity. When an NPC opened dialogue, the system ran through a cascade of tests (numbered 0β11), each producing contextual responses. Narrative designers could skip or override any test.
Test 0 β Death: Is the NPC dead? If so, they're being contacted via Speak With Dead and respond in agony. Almost always overridden by designers.
Test 1 β Associates: Checks the player's companions for summoned monsters, animated dead, and illusions. Wizard NPCs make sarcastic comments ("I learned to summon fire elementals when I was 15"). Non-wizards react with fear and exit dialogue β you'd have to dismiss the associate to talk.
Test 2 β Active Spells: Tests for spells on the player in order: invisibility, body of air/stone/fire/water, polymorph, mirror image, shrink. Wizards comment sarcastically and continue. Non-wizards mostly exit dialogue (invisibility = "Who said that? A ghost!", polymorph = commenting on your sheep form). Shrink and mirror image allowed conversation to continue.
Test 3β4 β Armor: Checks if the player is naked (responded to with Victorian-era shock) or wearing "barbarian" flagged armor (nobles say "how uncouth," shopkeepers say "we don't serve your kind"). Both continue into dialogue.
Test 9β10 β Reaction and Familiarity: The deepest layer. Based on the NPC's reaction to the player (love β animosity on a 7-point scale):
- First meeting: Positive reactions generated class-based greetings. Negative reactions generated race-based greetings (prejudice expressed differently by class).
- Return visits: Separate banks entirely. A friendly shopkeeper says "nice to see you back." An unfriendly one sarcastically calls you "my big spender." A racist one comments on your race.
This system meant players constantly felt the consequences of their choices reflected back at them through NPC behavior.
PC Op Codes
The player character had far more op codes:
- Appreciate (A): Variations of "thank you" by class
- Barter: Initiate trading
- Check Story State (C): Ask about the current main quest state (Arcanum had 27 story states vs Fallout's 23)
- Directions (D): Ask how to get to a location (NPC tells you but doesn't mark your map)
- X Marks the Spot (X): Like directions, but also marks the map
- Exit: Various goodbyes
- Forget It (F): "Never mind" variations
- Healing: Ask for healing
- More Questions: "I have more questions" variations
- Load World Map (L): Player says something appropriate, then jumps to the fast travel map
- Training (T): Ask for skill training with a skill parameter β the NPC checks their mastery level and responds accordingly
- Use Skill: Ask NPC to use a skill for you
- Yes / No: Banks of affirmative and negative responses
- Zap (Z): Ask an NPC to cast a specific spell (e.g., resurrect)
Shared Op Codes
Insult
As a PC line: insults the NPC based on their class ("you're the worst noble I've ever met"). As an NPC line: the NPC insults the player based on their race, filtered through the NPC's own class. The team had fun building these banks β what would a shopkeeper say to a dark elf? What would a beggar say to a half-orc?
Rumors (R)
PC version: "Heard any rumors?" NPC version: offer specific rumors by number. Rumors were based on story state, location, and social class β a beggar says "there's bandits down by the river" while a noble says "I understand bandits have set up camp and are disrupting trade." Could optionally cost money, which internally inserted a Money op code within the Rumor tree.
Quests (Q)
Quest op code Q:N handled seven quest states: Unknown, Mentioned, Accepted, Achieved, Completed, Completed-by-other-PC (multiplayer), and Botched. Each state generated appropriate dialogue β "my husband's been kidnapped" (unknown) vs "you promised to look for him" (accepted) vs "you found him!" (achieved).
Botched was implemented as a flag rather than a permanent state. If a rescued NPC died on the way back, the quest botched β but if you resurrected them, it un-botched. Completed quests couldn't be botched since they were permanent.
Unlike other op codes, quest dialogue banks were written specifically per quest by the narrative designer, not pulled from generic pools.
Gender and Localization
All op codes handled gendered combinations (male-to-male, female-to-female, etc.), which mattered especially for languages like French (adjective agreement) and Japanese (social standing affects speech patterns). The social class system mapped naturally to Japanese honorific levels.
Legacy and Future
Tim Cain tried to introduce this system at later companies but found no interest. He sees modern LLMs as the natural evolution β the same principle of procedural, context-aware dialogue generation, but with far more variety and the addition of speech synthesis. He describes Arcanum's system as "a primitive 20-year-old generated dialogue system" that could be done much better today.