Hello.
I have built a nice little dialogue management system for a traditional JRPG style game.
It does some cool stuff and I’ll spare you the details, but in short, I input the dialogue via the Inspector in a public string field.
I have been building out a few scenes, and had the realisation today that if I was to ever refactor that script, or feel the need to rework that public string field variable, all of that dialogue data I input into the inspector would probably be lost forever (right?).
While I have the main plot points and key beats mapped out via cloud based documentation, I really enjoy the process of writing the dialogue directly in the inspector, as opposed to sitting down with a coffee and word processor writing it, and later transposing that over to Unity fields.
Ideally, I think I would like to keep doing it my way, but I am worried that it might get out of hand a couple years down the track. What if I build 100 scenes and decide I want to change the way the dialogue field works…
Every dialogue tutorial I have seen uses public string fields, but I did see a couple commenters recommending something along the lines of storing your dialogue externally in XML or CSV or something and having Unity access it (…somehow, I wouldn’t even know where to start with this).
On the other hand, I’m worried a more complex solution like that will put a bit of a damper on the creativity and efficiency and I worry I would risk spending more time building out yet another system than building my actual game.
How do smart and experienced people manage this?
I’m cautiously confident in my existing system and so far enjoying the workflows.
Are my fears reasonable?
Are the pros and cons of another solution worth it?
There’s a number of ways to to handle dialogue, and really the complexity likely depends on your requirements. Does your game have sparse dialogue, or do you want complex scenarios like Witcher 3 (not that you could likely make that solo)?
Simple lists of text is probably fine for games with straight forward, linear dialogue. If you want to have branching dialogue options, then you probably want to develop a node based system, as is common for robust dialogue systems. Tools like xNode and Unity’s GraphView can be used to make these.
Though if you don’t feel like you can, or don’t want to develop such a system (I get it, not everyone is into developing tools), plenty of battle-tests options exist on the asset store, such as this one: Dialogue System for Unity | Behavior AI | Unity Asset Store
This is why we use version control software, so if you ever do anything that might lose this amount of data, you’re one revert away from getting it all back. If you’re not using VCS, time to start now.
Thanks Spiney.
The dialogue would be quite dense, but straight forward and linear.
I’m thinking of hypothetical scenarios where for example, I wanted to add some kind of speech quirk to a character, I suppose it would be nice to CTRL+F through their entire dialogue on a notepad somewhere and bulk change it rather than sift through each gameobject that character uses across 100 scenes.
Oh and rest assured I am at least using Github every day, as well as local back ups. But even so, if I committed to inputting via inspector string fields and later had to copy text data out of a restored point and put it back in again, that would be a huge pain.
I don’t like the idea of buying a tool, developing my own is more fun, but I am wary of what I spend my time on. And I’d hate to lock myself into an inefficient system.
Do you have any experience using XML or CSV for this kind of thing - or something else? I don’t even know what to search for.
I mean the tool I linked has been used in titles like Disco Elysium. So, it’s definitely proved itself.
Maybe you can look at how some visual novel systems like renpy work perhaps, which I think has its own markdown language of sorts.
And if you need to edit things enmass in Unity, you can always write editor scripts to do so.
I haven’t played with xml or csv dialogue systems myself, but there’s plenty of tutorials and documentation out there on how to do so I bet. You will get fairly divided opinions on whether you should from other users, mind. I often see Xml being a source of trouble. Though, I also prefer editing things in Unity myself.
Last time I did a dialogue system (about two years ago), I made it using GraphView, using data stored in scriptable objects. I’ll need to put together another one in my current project eventually, too, and probably will use GraphView again, though I have a whole lot more experience under my belt now to make a vastly better system, I hope.
I personally would not be storing dialogue in scenes at all, even in simple projects, which just makes it mass-editing next to impossible without laborious editor scripting. If it’s in scriptable objects, it’s much easier to organise, not to mention see the changes in your VCS of choice, and mass editing via editor scripts is substantially easier.