Simple Dialogues – Unity Tool

Asset Store: You can download it here!

Documentation: Learn about Simple Dialogues here!

An asset that allows you to create dialogue nodes that can hold text and create interactive trees.

Post Mortem:

So originally I had made this for a small project I was working on with a friend, they needed a way to create dialogue for their character. Originally I was thinking of just doing something quick and easy, like creating an array of strings you could edit in the inspector. But on further thought, I decided to attempt to create this custom editor.

I’d played around with making custom editors a few times before, mostly small stuff, like displaying data from a binary save file. But this was much more complicated, I wanted it to function similar to the animator, where you could create new boxes to put your dialogue into. So I started researching and building up something.
An early prototype of the editor looked like this:

Originally all the boxes were the same color, the lines between used the built in bezier curve functionality, and I had that strange non-scrollable background. Eventually I realized it was very bland to look at, and it was confusing to use.

So I moved on and I generated the background instead, just a couple for loops creating the lines in the background, and setup the scrolling system. I realized that trying to indicate the order of dialogues with the naming convention I had (Dialogue #) was very confusing. Additionally it would cause problems as you could split off to different trees. This is what that version looked like:

No automatic alt text available.

You can see that the naming convention was confusing, and then when I tried to make branches off of other branches it would become a mess. Additionally, since I was technically considering branches and the main window as different types, that also caused all sorts of issues. This version was scraped and I started again.

I experimented with a few different methods, and made it a lot easier to work with. Everything was a window, choices, decisions, everything. It made the entire process far more simple. I also took out the bezier curve, as it made adjusting the arrows to face the correct direction a little more complicated, so I just made them straight lines to made things simple for now.

I went through a few more issues, such as some serialization issues when trying to make windows children of windows (for connections) but had to change that to use ids that could reference the different windows. Finally I added the ability to add triggers that you could detect in code, and trees that allowed you to have multiple tree sets within one dialogue component.

I plan to add some more in the future, such as some more event based features, allowing you to call events/functions on windows and such. For now this is what we have! I know there are some dialogue editors on the asset store already, but I am still proud of what I worked on and hope to have it on the store as a free asset.

0 comments on “Simple Dialogues – Unity ToolAdd yours →

Leave a Reply

Your email address will not be published. Required fields are marked *