Tech Blog —Dialogue Integration Part 1

After finishing off the #devtober game, I had some time before I went away on my hols so I thought I would have a quick look at options for writing dialogue.

We used the timeline a bit in Devilwood and I liked it. I wanted to find a way to incorporate dialogue into the Timeline. I had a nose around the net for potential solutions.

There were a couple of options including Ink and Yarn. I like nodes so I had a look at Yarn.

Image courtesy of Foam Sword

Yarn is used in games such as Night in the Woods and Knights and Bikes and is very similar to Twine and you can even import Twine into Yarn, which is neat.

I downloaded Yarn and made a super basic yarn file.

You can really easily link nodes together, and to be honest, for our games, this is all we need. We were going to do everything more complex (moving characters, etc) in the timeline itself, but I wanted a nice editor for actual dialogue rather than a giant google sheet.

Night in the Woods is built in Unity so they already has a basic test project to get stuff import.

The main file I wanted to change was DialogueImplementation.cs

The last one is the main one I wanted to take apart and build on top of, as you apparently don’t need to change the other two.

To be honest, the code is OK as is, it just needed a few tweaks here and there.

Then, if we run the test project it works.

Cool, now we have that all setup, we are ready for Part 2.

Part 2 will be hooking this up with the timeline so we can use it with “proper” cutscenes

About the Author

Beehive Games is an independent games developer based in London, UK run by Coxlin. Follow us on twitter:

@BeehiveGamesLtd