itch.io is community of indie game creators and players

Devlogs

XML based Dialogue System

Punch-Drunk
A downloadable game

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. 

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:

Download Punch-Drunk
Leave a comment