Featured Blog | This community-written post highlights the best of what the game industry has to offer. Read more like it on the Game Developer Blogs or learn how to Submit Your Own Blog Post
Breaking down GTA V's pedestrian dialogue system: An analysis with speculative examples
Grand Theft Auto 5's ambient pedestrian dialogue system makes its game world feel alive, and this article breaks down the basics of how it works.
What is Ambient & Pedestrian Dialogue?
For massive AAA games like the Grand Theft Auto series or Cyberpunk 2077, it’s not enough to only write dialogue for player-facing events, like quests, cutscenes, and ally conversations. To make a game world at this scale feel “alive”, NPC’s must be conversing amongst themselves without the player’s involvement, giving them a sense of independent agency. The best way to convey this agency? Incorporate ambient dialogue.
Ambient, or pedestrian, dialogue can be broadly defined as dialogue that plays without direct player input from the general NPC population. Standard dialogue in a game is player-initiated, i.e. a player walks up to an NPC, presses a button prompt, and starts conversing with that character. Ambient dialogue, instead, occurs autonomously, regardless of the player’s presence.
How Does GTA V Implement Ambient Dialogue?
The ambient dialogue system uses a number of subsystems working in tandem, like NPC spawn zones. Source: Rockstar Games
Note: this is an educated inference on how Grand Theft Auto V structures their pedestrian dialogue system. This is not meant to be a definitive, wholly accurate summary.
As mentioned earlier, colossal-sized games like Grand Theft Auto V relies on using pedestrian dialogue to fill out the game’s soundscape and make Los Santos feel like a real metropolis. GTA V would feel significantly more empty without NPC’s, for example, asking for help feeding their 57 cats. These small, passing one-offs from the pedestrian population are an often overlooked, but critical part of the game’s interactivity.
NPC Spawn Zones
A core part of how GTA V’s ambient dialogue system works relies on a connected, underlying mechanism: the NPC spawn system. Different NPC’s have a higher likelihood of spawning in certain sections of Los Santos than others, such as businessmen NPC’s primarily appearing around Rockford Hills, or country bumpkins spawning mainly in Grapeseed and Blaine County.
NPC Archetypes
To conserve resources during production, Rockstar chose not to create individual dialogue pools per NPC, but rather created “archetypes” of NPC’s. Forest rangers, muscleheads, wannabe celebrities, Rockstar formulated several roles like these and created dialogue corresponding to their stereotype, then recorded male and female voiceover for each.
“General Purpose” Dialogue
To stretch the use of these character archetypes further, Rockstar made the decision to not incorporate any location-specific voice lines in its pedestrian dialogue system. While this may make some ambient remarks from passerby NPC’s feel plain, this decision helped to simplify the archetype logic by not having to create location-based variations for each role (ex. having one generic rich person NPC vs. having specific ones for Vinewood, Rockford Hills, Vespucci, etc.).
This methodology also applies to characters conversing with one another. When an NPC is being talked to by another NPC, they will typically respond with a very brief (often disjunct) line, which ends the conversation (“What?”, “Who cares!”, “Unbelievable!”, etc.). Like before, this is to get the maximum amount of use from each recorded line, and helps to simplify the system logic running these random NPC dialogue events.
Dialogue Pools
Regardless of what archetype an NPC is, or where they spawned, each of them has a set “pool” of voice lines to pull from. For instance, every NPC has at least one or two lines to react to the player getting too close to them, aiming a gun at them, hitting their car, and more. This not only simplifies the writers’ jobs by giving them a “checklist” of lines to write for each archetype, but also ensures that any NPC can properly interact with the player, while also having a healthy pool of ambient lines to say while walking around Los Santos.
Put It All Together
With all these systems in mind, the basis of Grand Theft Auto V’s NPC system can be inferred. When the game spawns an NPC, the following steps (not necessarily in order) are executed:
1.) What archetype is this NPC?
Depending on the spawn zone the player is currently in, certain types of NPC’s will be much more likely to spawn then others.
2.) What are the general characteristics of this NPC?
Age, gender, race, etc.
The archetype selected may limit the range of possible characteristics. For example, if the archetype is LSPD Cop, then “Elderly” would not be one of the possible characteristics.
3.) Find the dialogue pool asset that matches the selected characteristics and archetype. This can be boiled down to indexing a specific folder using each attribute selected (ex. index the audio asset folder path named “Cop_Male_White_Young”).
4.) Spawn the NPC at a nearby spawn point.
Select a human skinned mesh asset that matches the select characteristics (ex. a middle-aged white woman asset).
Apply the correct outfit based on the NPC’s archetype (ex. a formal business outfit).
Apply the matching dialogue pool to the NPC’s dialogue logic.
Creating Our Own NPC Dialogue Pools
Once the system is understood, creating your own NPC ambient dialogue becomes simple. Source: Rockstar Games
Now that the core of the ambient dialogue system has been established, next comes writing the actual dialogue. While certain NPC’s will have unique sub-lists of voiceover lines (an LSPD cop will have specific groupings of dialogue recordings for calling for backup, for instance), the base pool is largely the same.
For our example, let’s create a simple NPC archetype: a laid-back surfer. The following bullet points will be each subfolder of voicelines within the surfer ambient audio pool:
Note: The framework for these bullet points comes from the scaffolding used by the diligent contributors of the GTA V Dialogue Wiki.
Basic Conversation Lines
When Greeting Other People
“Sup, brah.”
“How’s it hanging?”
“Surf’s up, man.”
“Yo!"
Other Ambient Lines
“Waves are killer today, man.”
“You seen my board wax, bro? Or was it in my other trunks…”
“Lovin’ the sunshine lately.”
“I’ve got sand in my eeeverywhere, brah.”
“Need more tanning spray, used the last of mine this morning.”
Talking While Annoyed
“Leave me alone, man. I’m peeved.”
“Buzz off, bro-siff!”
“You’re really tickin’ me off, brah, not cool.”
When Obstructed by the Player
“‘Scuse me, dude.’”
“Interrupting my flow, bro-jo.”
“Gotta get goin’, bro, c’mon.”
When Crashed Into (While in a Vehicle)
“Bro, what the-?!”
“You wrecked my wave machine, man!”
“I can’t afford the repairs, brah!”
When Pulling the Player out of a Car / Retaliation from a Carjacking
“I’m catching your wave now!”
“Outta my ride, dude!”
“Let’s see how you like it, bro-siff!”
When Bumped Into While on Foot
“Slow down, bro-siff, enough beach for everyone.”
“Harshin’ my vibe, man, watch it.”
When Irritated / Insulted or Fighting
When the Player is Standing Too Close
“You’re blocking my sunshine, man.”
“Stand back, brah, my tan’s getting uneven.”
“You’re skeezin’ me out.”
General Insults
“You got seawater in your ears or somethin’?”
“That better be sun stroke talkin’.”
“You don’t wanna see me with harshed vibes, bro!”
“Waves ain’t the only things I’m gonna pound!”
When Fled / Walked Away from While Angry
“Totally not tubular...”
“Go in the water and cool down, man.”
“Yeah, chillax already.”
When Witnessing Something Interesting
“Brooo!”
“Whoa…that’s wild.”
“Awesome!”
“That’s bogus!”
When Frightened About Something
“Not cool, brah!”
“That’s not chill, man!”
“No way, Jose!”
“Nuh-uh, not happenin’!”
When Noticing a Player Wielding a Firearm
“L-Let’s just catch some waves and relax, man.”
“Whoa! Ease up, bro-siff!”
“Beach is all yours, dude, calm down!”
“I was kidding, man!”
“I’ve got beach babes to see, I can’t die!”
Phone Calls
“Bro! Where are you? Been scopin’ out babes without you…Impounded? What’s that?…It’s right next to the ocean, why do they care if you parked in front of the fire hydrant?…Whatever, man, sort that out yourself.”
“Dude, the waves are nasty today!…I got launched so high, thought I could see my mom from up there!…Well, no, the jail was too far, but I could almost see her…’Kay, just hit me up when you get here.”
“Hey bro, ‘sup?…Bro, I just worked yesterday, why do you need me today too?…Five days a week?! Heck nah, man, my board’s more important than rent, see ya.”
Conclusions & Further Analysis (in Unreal)
This breakdown of GTA V’s pedestrian dialogue system is not a 100% accurate diagram of how it works under the hood, but rather a high-level observation of how it could be achieved. This implementation would make sense for a game at such large scale, as it allows for flexibility, adaptability, and near endless mix-and-match NPC generation. Even better, this implementation is engine-agnostic, meaning a variation of the system could be implemented in Unreal, Unity, or Godot.
A demo video of my implementation of Cyberpunk 2077's conversation system
As seen above, I’ve experimented with implementing other game’s narrative systems in Unreal before. My goal for the future is similar: recreate Rockstar’s pedestrian dialogue system within an Unreal sample project, as a way of delving further into its mechanics on a programmatic level. This will necessarily entail a few other subsystems, like a randomize NPC spawner, NPC AI BehaviorTrees for routes and player reactions, and more. However, I believe this will be a fun, informative challenge, and something that I (or others, once released to GitHub) could plug into their full-fledged projects.
About the Author
You May Also Like