How Dialogue Trees Work in Video Games

Hrvoje Š.
6 Min Read

If you’ve played a video game, you’ve almost definitely spoken to an NPC. And if you’ve done that, you will have found yourself navigating a dialogue tree. When we encounter these interactions within a game they feel organic, but under the hood they are carefully engineered masterpieces. In this article, we’ll take a look at how these dialogue trees are crafted to get a better understanding of how they work.

What is a Dialogue Tree?

While almost every game will have dialogue of some sort, into all dialogue comes from a dialogue tree. Dialogue trees are comprised of a complex web of choices, where players steer conversation from beat to beat, accessing certain dialogue options and missing others.

Fundamentally, they are non-linear. And they can be found across gaming from Pokémon to  Skyrim to Honkai Star Rail. Speaking of, get a honkai star rail top up to get ahead!

Why Dialogue Trees?

By giving the player a bunch of dialogue options to choose from, players gain a sense of agency. Then, as they continue to choose different options, they are able to input their decisions into the story. Perhaps different decisions will impact how a character feels about you, what will happen next, or whether the player will get what they want.

This implementation of choice and consequence is not only engaging, but personalised. Allowing players to express themselves, have different experiences to other players and, ultimately, feel more engaged in the game.

They also have a hidden advantage of increasing replayability and offering a greater chance for world building—given the larger amount of dialogue available in a dialogue tree compared to a linear conversation.

A Tree of Invisible Branches

To create a dialogue tree, writers must first wrap their heads around non-linear narratives. In other words, the question is not just “what happens next” it is “what happens next if”. This if is where the player can exercise their freedom.

While this may sound like a simple, singular decision, dialogue trees are anything but. They very quickly balloon into a huge amount of text. Just think about it. If the player has three consecutive decisions with three choices, you could easily end up with up to 27 different outcomes. And that’s just three choices!

Managing these branches—to be both meaningful and natural—is one of the core challenges of game writers.

Rooting the Tree

Beyond creating lots of exciting branches for players, writers must also ensure that a certain interaction delivers the essential information needed to continue the game. That often means re-merging branches of the tree with one “primary branch”.

For example, allowing the player to make one or two decisions which net them extra information, but ultimately returning back to the essential information.

This means that, again, dialogue trees are non-linear. Allowing players to branch off of a main path before returning later on.

Implementing the Tree

Game developers have many choices when it comes to implementing dialogue trees. Just like the creation of any game mechanics, there are almost limitless ways to create a working system.

However, most game developers and teams will find themselves working with or developing additional software (plugins) in order to manage the dialogue trees. This additional software can not only ensure the programming is watertight, but it can help make the entire dialogue tree more readable for the development team—making it clear where paths go wrong, where elements could be added, and more.

The Future of Dialogue Trees

With the rise of AI, and it’s ever-greater implementation within games, it’s not too far fetched to imagine that we may see AI systems take over dialogue trees at some point. Such AI systems could create custom dialogue trees and options in response to bespoke prompts by the player. Achieving everything we’ve talked about above, but without the need to hard-code much of the interaction.

Don’t get me wrong, this type of dialogue is still a long way off. But there will be a time when it gets integrated into a large game release.

But, for now, dialogue trees are still going to be the result of tonnes of hard work from writers and developers. Crafting meaning, message and player agency in order to let us feel like we’re having authentic interactions with the magical characters we experience within virtual worlds.

Share This Article