System Design

Design documentation for an ambient narrative system in an open-world fantasy game. Original work, based loosely on design principles from an unannounced project.

Contextual Ambient Narrative System

The Contextual Ambient Narrative System uses content tagging to deliver background dialogue from Non-Player Characters (NPCs) that is reactive to the state of the open game world and the player’s recent accomplishments. It also allows designers to place templated action points throughout the world that then play content specific to the context in which they’re placed, reducing the need to design bespoke content for every location within the game.

Contextual Action Points

A Contextual Action Point (CAP) is an activity point placed within the game world. Upon encountering a CAP, an NPC will perform the animations associated with that CAP. This allows NPCs to engage in a wide variety of activities throughout the world without needing to encode them as AI behaviors.

Each CAP contains a finite number of slots; if all the slots in a CAP are occupied by NPCs, no additional NPCs may join the CAP. Certain slots within a CAP are permanent; their assigned NPCs will never leave unless forced to do so, and will always attempt to return to that specific CAP slot.

Example CAP Types

CAPs and Non-Player Characters

When a Non-Player Character is in an idle state, they will attempt to enter a nearby CAP with an open slot. If there are no open CAPs nearby, the NPC will wander along set routes (roads, hallways, etc) until it finds a CAP or otherwise leaves its idle state.

Interruption

An NPC will only stay in a CAP while it’s idle. Once the NPC exits the idle state (for example, if they’re attacked and enter a combat state), they will exit the CAP and carry out whichever behaviours are required by their new state.

Once an interrupted NPC has re-entered the idle state, they are free to seek out any nearby CAPs.

CAP and NPC Tagging

CAP slots and NPCs are both marked with tags to indicate which NPCs should enter which CAPs. An NPC can only enter a CAP slot if at least one of its tags is a match to one of the slot’s tags.

Example

An NPC is idle and marked with the “farmer,” “townsfolk,” and “customer” tags. The nearby Market Stall CAP has a slot open which is marked with the “customer” tag. Because the NPC and CAP slot both have the “customer” tag, the NPC enters the CAP.

Reactive World Tags

Certain player actions can also activate tags that apply to the game world (or certain locations within it). These tags persist for a set amount of time (their Relevancy Period) before being removed. The more impressive and dramatic a player action is, the longer its Relevancy Period lasts before expiring.

Example

The player kills a dragon that was threatening the nearby village. That village gains the “dragon slayed” tag. After 10 hours of gameplay, the tag’s Relevancy Period expires and the tag is removed.

CAP Audio

When the player passes within hearing range (10m) of NPCs participating in a CAP, NPC voiceover can play to provide extra narrative for the CAP. Each CAP type has its own pool of voiceover scenes that can play.

Some CAPs may not have any NPC voiceover attached.

Voiceover Scenes

CAP scenes are short, dialogue-only scenes (between 3-5 lines total). They represent brief snapshots of idle banter between the characters within the CAP: a merchant chatting up her customers, or two soldiers passing the time while on guard duty.

Each voiceover scene has a Priority value (between 1 and 10). Scenes pertaining to major story developments are given higher Priority (closer to 1) while more trivial scenes are given lower Priority (closer to 10).

Scene Filtering & Selection

When CAP audio is triggered, the CAP’s pool uses the tags of the NPCs within it, as well as any other world tags active at the time, to filter this pool down to a shortlist.

This shortlist is then sorted according to priority; the scene on the list with the highest priority will be selected to play. If there are multiple scenes on the shortlist with the same priority value, one should be selected as close to randomly as possible.

Once a scene has played, it should be removed from all CAP pools for a set Cooldown Period to prevent players from hearing the same voiceover scenes over and over again.

Example

The player approaches a Market Stall CAP. The CAP is currently occupied by one NPC in the shopkeeper slot with the “merchant” tag and one NPC in the customer slot with the “guard” tag. The player also recently broke into the nearby lord’s manor, and therefore the “manor theft” tag is also active.

The CAP filters down its pool of scenes to those that contain the “merchant” and “guard” tags and, optionally, the “manor theft” tag. This produces a shortlist of 4 scenes: one with a priority value of 3, and the rest with a priority value of 7.

The Priority 3 scene is selected to play, and the player hears a conversation between the two NPCs about the recent break-in at the lord’s manor. This scene’s Cooldown Period then activates, removing it from all CAP pools for the next 30 minutes and allowing a lower-priority scene to play the next time the player approaches this CAP.

Return to Home