top of page
Tool.PNG

Dialogue Tool

This dialogue tool was developed in the TGA2D Engine, separate from any game to use it in. After setting up a small testing environment, I created a dialogue system and tool with the goal to make it as easy as possible to implement dialogue for writers and other non-programmers. 

Inspiration

At the end of my Game Assembly education, I had the opportunity to choose a project to work on for about 50 hours in total. I felt like I wanted to showcase my interest in narratives and try to create my own version of a visual scripting system since I at this time had gotten some experience by creating this for Blob-Lobber. Therefore, I decided to create a dialogue tool in a visual scripting environment. 


I have used a few narrative tools myself before, mostly Twine and a plugin for Unity named Fungus. I had also heard about a plugin for Unreal called Not Yet, and since I had worked a lot with Blueprint-styled visual scripting in Blob-Lobber I used Not Yet as a reference for my project as well. 

Design Goals

My main goal while creating the dialogue tool was to create something that was both easy to use and had enough features to feel worthwhile, compared to for example an excel sheet. I wanted it to feel like it was a step up from working without a tool. I also felt that it was important that you could start using it without reading a lot of documentation first.


My core design choices, therefore, were to have a few node types that could cover a lot of different cases, to easily be able to use prewritten dialogue instead of writing dialogue directly in the node and to avoid the need to use links between nodes as much as possible by using variables inside the nodes instead. 

Environment

I choose to work in our in-house 2d-engine, TGA2D, since I wanted a clean slate uncompromised by the previous visual scripting work I had done in our engine for Blob-Lobber, but also because I wanted to write it in C++ and visual studio to easily be able to implement a version of the dialogue tool in the Wondrous Machine Engine later, in case we wanted to use it for a game in the future. 


To create the tool, I first needed to create a dialogue system that the tool could use and be tightly integrated with. But before that, I needed an environment that I could use to try out the dialogue system in. It is important to be able to test the systems you build since it makes debugging them so much easier. My first thing to do was thus to create a player and a very small game where you could walk around and talk to a few different NPCs. 

Dialogue System

When I had a place to test out my dialogue system, I could finally start to create the system itself. I built the system as a tree, holding a map with an id as key and the base class for all nodes as the value, as well as which one was the root and the current one being traversed. I also created a manager for said trees, which I planned to use as the interface that the tool would primarily interact with. 


I started out by creating only three different node types, Start, End and Dialogue. Later on, I would be able to add a node to randomly choose one of multiple next nodes, and a node with replies that the player could choose from, but I wanted to start off simple to focus on the systems themselves. When the trees were finished, I connected them to the NPC:s, and set up the NPC:s to generate their own empty dialogue tree upon creation. 

Dialogue Tool

For the visual part of the tool, I choose the same interface as I had before, namely the Dear ImGui extension ImNodes. It was both a tool I knew well, and it had proven very useful and easy to use. Since the dialogue system already was created to be similar to the node system in the tool, I could easily integrate the two systems. 


I began with the most basic functionalities here as well, to be able to create nodes by choosing one in a menu that pops up when right-clicking. Then I added the ability to create links and connected everything in order to finally do some testing. 

Design Choices

After I had the basics up and running, I could start working on all the additional features I wanted to add, including the other node types mentioned earlier. I also realized that there was no need for an end node since the system easily could detect if the tree ran out of nodes. The end nodes didn’t really add anything for the user either, except for a little extra work, so I decided to scrap them. To avoid the usual spaghettification with links crossing each other everywhere, I also decided that all the nodes should have precisely one pin for input and one for output with the exception of the Player Choice node where I couldn't avoid using more exit pins.


Some other design choices I made to create a smoother user experience were to add the built-in mini-map to the tool, color-code the different nodes, add the ability to add and connect new nodes just by dropping a link, a play button to close the tool and test it out really fast and a drop-down menu to choose between the different NPC:s within the tool. 

Prewritten Dialogue

Oftentimes, it is much easier to write dialogue anywhere else than in the tools created to add dialogue to the game. I, therefore, found it to be an important part of the tool to have the functionality to use dialogue written elsewhere, and not only to write the dialogue in the tool itself.


I decided to use an id system where you can just insert an id in the tool, and it will know exactly which dialogue line you want to use. It will also display the dialogue that matches the id in the node, to avoid the mistake of accidentally putting in the wrong id.

Conclusions

I have to say that I personally feel that I was able to reach my goals for this tool. When I start up the tool, the only start node that you need is already placed in the middle of the screen, just waiting for someone to drag out and drop a link to create a new node, and then another one, and then another. 


The only thing that I would have wished for, was to have time to include a few additional features. However, that is often the case, because the more you work on something, the more features you discover that it could benefit from having, and the more things you find that could use just a little bit of tweaking. What I am trying to say is that I am very happy with how this tool turned out, even if I find it hard not to see all the things I also wanted to include. 

bottom of page