XML based Dialogue System


I needed a simple dialog system for my game. Although I do not plan Punch-Drunk to be complex in regard to its dialogues I wanted something flexible and expandable to several languages. 

I am using Unity3d and Playmaker for my game and ended up having a system based on a simple XML file like this: 

Playmaker's DataMaker extension provides tools for accessing XML Data. At first I am searching with XQuery for the first Node with a specific tag. In this case "00001". I am then reading the chosen language property to a Unity text field. Then the XML node is checked for any answers and creates any amount of buttons with the right text. Lastly it checks if there is a follow up question (another "Dialogue" node in this tree) and repeats the process from the beginning.

This is the Playmaker graph. I wish the structure was a little more tidy :)


This is in principle what the dialogue looks like in my game:


Get Punch-Drunk

Leave a comment

Log in with itch.io to leave a comment.