Dialogue Systems in Video Games
Published: 2022-12-12 04:31:06

While I've always considered myself a casual gamer, I have been endlessly fascinated with how video games are created and what kind of systems are at work to make these games what they are. Today, I am taking a look into the dialogue systems in video games. I will talk about what they are, a little about how they work, and how much they have advanced. 

## Dialogue Systems

Dialogue Systems in video games usually contain what are referred to as conversational or dialogue trees. These trees refer to the interactions that a player has with a non-player character, or "NPC". The basic concept involves the player being given some choices of dialogue to say in the game. Based on that the choice, a new path opens up with a new set of choices and so on until the conversation has ended with that character.

## History in Games

These conversation trees actually started in books, but made their way into video games in the later 80's and early 90's. A game that is considered to be one of the first to have a dialogue system is "The Secret of Monkey Island". The game was a point and click adventure styled game that included a very basic dialogue system where the player's choices of dialogue could often be repeated. The NPC would also repeat dialogue if approached and prompted to speak again. As technology advanced however, so did the dialogue systems.

## Data Structures Used

As these dialogue systems became more complex, the use of multiple data structures became a necessity. Not only were data trees being used, but also graph data structures. The structure of the trees worked well with the progression of dialogue flowing in one direction from start to end. The graph structure gives more flexibility in not being one directional and allows for more complex dialogue flow in multiple directions.

Example of a tree data structure
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1sy1czjstjflvgdw4vou.png)





Example of a graph data structure
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig9oc7u55ckd572uiks2.png)





Example of dialogue tree
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9ssmgab11s1yeybzz76.png)



## Advancement & Complexity in Dialogue Systems

As mentioned previously, the advancement in technology has given game developers the ability to produce complex dialogue systems like we have never seen before. One example of such a dialogue system comes from a game by the name of "Hades". In this game, when players meet with the NPC's to have a conversation, there are no choices for the individual player to pick. The NPC will have a container programmed with a list of dialogue to start. Imagine a dice is rolled to choose which numbered dialogue to choose and the conversation starts. After that dialogue choice has been used, that choice is removed from the list as to not be repeated.

Now where this system really becomes interesting is with the addition of locked dialogue and a priority system. The locked dialogue may require the player to obtain an item or gear in order for the dialogue to become unlocked and selected. The system also incorporates a priority system that knows which dialogue selections are associated with pivotal moments in the game's story and thus require that dialogue to be selected before any other. Can you just imagine how complex the programming for all these events and systems that work together are? This matched with a script of over 300,000 words makes for one of the most impressive and advanced dialogue system to date.


The future of dialogue systems in video games is a bright one, and with constant advances in technology, I can only imagine how more advanced these dialogue systems can get.

## Sources

https://en.wikipedia.org/wiki/Dialogue_tree
https://techdifferences.com/difference-between-tree-and-graph.html
https://www.youtube.com/watch?v=bwdYL0KFA_U