Arrow to the Knee: Dynamic Dialog Variation in Immersive Games

Renee Gittins
Spirit AI
Published in
5 min readApr 11, 2019

Skyrim received critical acclaim upon its release for its vast open-world and compelling action role-playing approach. As players spent dozens, if not hundreds, of hours each in Tamriel, they began to notice that some NPCs would repeat the same lines. While multiple characters commented on the weather or local threats, one line stuck out — “I used to be an adventurer like you, then I took an arrow in the knee.”

Every single town guard in Skyrim would, on occasion, utter the same line about their adventuring career being cut short by an arrow-inflicted knee injury. Such a peculiar background and comment stuck out far more than similarly repeated remarks.

Though this line quickly became a beloved joke about the game, it also broke player immersion and caused enough frustration that multiple mods have been created to change the dialog. Immersion is one of the most coveted aspects of open-world games, as it enables players to feel they are truly part of the vast world they are experiencing. So, when a line suddenly reveals the man behind the curtain and shows the superficialness of the NPCs, it causes a loss of magic and wonder.

What’s the solution? Certainly, a development team does not have time to author unique lines for every single NPC in such a vast game.

Dynamic dialog.

Dynamic dialog is dialog that is decided based on factors which change. It is used in most games, though to a small extent. For instance, a NPC calling a player by their chosen name or class is an example of dynamic dialog. The variation there is based on a player choice, but it could be based on designer choice or even random selection instead.

If a developer was creating an open world game that was filled with hundreds of characters, it would be extremely difficult to write individual lines for each one. However, they could assign a different set of lines per type of individual. Skyrim makes use of that implementation, which is why it is only guards that comment on having taken an arrow to the knee.

It is possible to break down the variation further, though. For example, let’s say there are four peasant NPCs.

It would be easily possible to assign each peasant the ability to say two lines, a greeting and a musing line. In a traditional dialog approach, this means every peasant will only say those two lines as they are authored. However, one could add in variation, splitting the greeting line into one of four different options.

This gives some variety in the line, but does not avoid the “Arrow to the Knee” problem.

In addition to normal variation, it is possible to add variation based on character factors, such as profession. Thus, there could be job-specific greetings that are enabled as options if the character is of that class.

In Spirit AI’s Character Engine, we do this by storing a character’s traits and characteristics in our knowledge model, then checking their values using tags.

With this implementation, it is easy to set various character traits, such as job, religion, background, or even current mood, and change the lines they use. Individual lines for each background can be tedious to author and will still sound repetitive, though. Thus, lines can be broken into parts and base use of variation of those parts on certain traits.

For example, if one was using the character traits of profession and religion, a farmer could muse “If I work hard to grow my crops, I’m sure [[higherFigure]] will be happy with me.” This higher figure could be an entity from their religion or, if they had no religion, just be their mother.

A combination of these fragments in a set of dialog allows for the creation of hundreds of possible combinations with a small amount of dialog writing. Like the “higher figure” variation, line fragments can be authored to be reused in many roles.

Four characters with randomly set traits speaking a range of dialog based on two lines that are branched with tagged fragments using Spirit AI’s Character Engine.

In the Skyrim guard example, a guard could have a previous profession and a tragic incident, all which are randomly assigned from a list before the game is published. Thus, a guard may comment “I used to be [[previousProfession]], then [[tragicIncident]]” and be able to comment on their past in a way that is unique of their character, requires minimal authoring time, and is consistent across their dialog.

Similarly, this technique can be expanded to include inputs from world elements as well, such as a dragon being slain, a nearby theft, or progress in the main story-line. Combining variation and tagged fragments allows for the quick creation of a deep, unique world where not every guard has taken an arrow to the knee.

--

--

Renee Gittins
Spirit AI

Renee is a Solutions Architect at Spirit AI, and passionate advocate and connector for developers and diversity in the game industry.