NPCs Triggering Each Other

Abstract

Problem: How can NPCs be designed to react not just to player actions, but to each other's reactions β€” creating chains of emergent behavior?

Approach: Tim Cain breaks the problem into three parts: what events NPCs should react to, what reactions they can have, and how those reactions become triggers for other NPCs. He draws on his experience shipping Fallout, Arcanum, Temple of Elemental Evil, Vampire: Bloodlines, Pillars of Eternity, and The Outer Worlds.

Findings: A robust NPC reaction system needs a rich event vocabulary (visual triggers, actions, status effects, trespassing), a diverse reaction vocabulary (comment, attack, flee, run home, seek guards), NPC subtyping to differentiate responses, and heavy use of "helper nodes" placed by level designers to give NPCs spatial awareness of cover, scenic views, and guard stations.

Key insight: The real emergent magic happens when an NPC's reaction becomes another NPC's trigger β€” e.g., a civilian fleeing causes a guard to investigate, which causes other NPCs to take cover β€” and NPC subtypes ensure these chains produce sensible, varied behavior rather than everyone doing the same thing.

Source: https://www.youtube.com/watch?v=2tfhirqSito

Event Triggers: What NPCs Should React To

Tim identifies several categories of events that should fire NPC reactions:

Visual Triggers (Something Enters Field of View)

  • Dead bodies β€” seeing a corpse should provoke a reaction
  • Scenic overlooks β€” marked with helper nodes by level designers so NPCs know "there's a nice view here" and can walk over to admire it
  • Scary items β€” artifacts, poisoned blades, or armor marked as intimidating (Arcanum had barbarian armor and black horned armor flagged this way)
  • Nudity β€” a player or NPC not wearing anything (or in underwear) should get a reaction
  • Enemies β€” anything the NPC would attack on sight, or that would attack them
  • Fleeing friends β€” seeing an allied NPC running in terror should prompt action
  • Visible status effects β€” someone on fire, diseased, poisoned, or under an obvious spell effect

Receiving Status Effects

An NPC who suddenly finds themselves poisoned, diseased, on fire, or affected by a fear spell should react β€” not just silently tick damage numbers.

Observed Actions

  • Drawing a weapon
  • Attacking someone
  • Killing someone (distinct from seeing a dead body β€” this is witnessing the act)
  • Casting spells β€” NPCs evaluate the spell type; a healing cantrip gets ignored, a fireball does not
  • Using skills β€” picking a lock, disarming a trap, or failing to do so
  • Setting off a trap
  • Trespassing β€” entering a restricted area, which may be time-gated (shops closed at night, areas off-limits after hours). Requires helper nodes marking restricted zones.

Reaction Vocabulary: How NPCs Respond

Making a Comment ("Chatter")

The NPC says something without entering formal dialogue. This has been called "chatter," "yell," or "float" in various engines. Crucially, the comment depends on the NPC subtype: a shopkeeper seeing a naked person might say "Please, we require pants in our store," while a noble might exclaim about "the vapors." This doubles as world-building β€” the reaction reveals character.

Attacking

The NPC joins combat, choosing a side. Who they help depends on their type and relationship to the combatants.

Taking Cover

The NPC runs to a position that provides cover. Helper nodes near cover objects indicate direction-specific protection: "stand here for cover from the north."

Fleeing

Running away from the threat without a specific destination β€” just maintaining distance. The NPC enters a "flee mode" that other NPCs can detect and react to.

Running Home

The NPC retreats to their home location. Tim's approach: wherever an NPC is first placed on the map is their home. Shopkeepers go back to their shop, residents to their house, barflies to their bar.

Running to a Guard

The NPC seeks the nearest guard or guard station (marked with helper nodes or found by proximity search). This is where chain reactions get interesting.

Chain Reactions: NPCs Reacting to NPCs

This is the core insight of the video. Guards are the best example of chain-reactive NPCs because they have a broad suite of triggers:

  • A guard sees someone fleeing β†’ investigates what they're fleeing from
  • A guard sees someone attacking β†’ intervenes
  • A guard sees someone picking a lock β†’ confronts them
  • A guard sees damaging spells being cast β†’ responds

The chain works like this: the player picks a lock β†’ a nearby NPC sees it and flees to a guard β†’ the guard reacts to the fleeing NPC by asking "what happened?" β†’ the guard goes to investigate the lock-picking location. The player's action triggered an NPC, whose reaction triggered a guard, whose reaction created a new event.

NPC Subtypes: Why They Matter

Tim emphasizes that not every NPC should react the same way. Without subtypes, you get the classic absurdity: the player attacks someone in town and the elderly shopkeeper and the beggar both charge into combat.

Subtypes Tim used in Arcanum and other games:

  • Villagers β€” likely to flee or run home
  • City dwellers β€” might comment or seek guards
  • Shopkeepers β€” care about their own property (locks they own, their store)
  • Guards β€” investigate, warn, or attack
  • Nobles β€” dramatic reactions, unlikely to fight

Lock ownership is a specific example: when placing a lock, you assign an owner. The owner can pass through their own locked doors freely. If they see their lock being picked, they react β€” but they don't care about other people's locks.

Helper Nodes: The Level Design Backbone

Helper nodes come up repeatedly as essential infrastructure. They're markers placed by level designers during a dedicated pass through the level:

  • Scenic overlook nodes β€” "there's a pretty view here"
  • Cover nodes β€” "standing here provides cover from this direction"
  • Guard station nodes β€” "this is where guards are posted"
  • Restricted area nodes β€” "this zone has access rules"
  • Home location nodes β€” implicitly set by initial NPC placement

Without helper nodes, NPCs lack the spatial awareness to react intelligently. They need to know where to run, where cover is, and what locations mean.

References