F.O.U.R. | Dialogue tree system
Hello! During the voting period I posted part one, part two and part three of a series about technical aspects of my LD43 entry. I said in the third entry that it would be the last one, but I'd forgotten to write about something quite substantial, so here goes..! 😨
This is a screenshot of the game, F.O.U.R., and if you still want to play it post ratings, here it is~

Dialogue system
Whew!! I'd written so much about graphical solutions that I'd completely forgotten that I spent a bunch of time on my dialogue system, including a custom Unity editor to create the conversations. Surely that ought to be interesting too. Perhaps even more so!
Here's what the dialogue system looks like in action:

As you can see it offers multiple choices sometimes. I did end up discovering a bug near the end that I didn't have time to fix that limited me to quite shallow dialogue trees, but luckily I didn't need more for this game. Would certainly have fixed it if I'd had more time, tho!
Basic design
Might seem weird, but the first thing I did was to find a font I liked, since I knew for a game of this scope and time limit I'd have to make sure manually that the text would fit in each box rather than program a system that would spread dialogues over multiple boxes automatically, so I wanted the font face and text size in place right from the get-go in order not to have to fix anything later in case a different font than the one I started with would take up more space in the boxes.
I ended up going for the (100% free—that's important!) font Caviar Dreams by Lauren Thompson, since it had this overall elegance to it, while still mixing it up a bit with the funky lowercase e, as you can see in the screenshots above~
Programmatic design
In the end the dialogue system ended up a bit hacky and messy since I didn't have too much time to do it properly and only did what was necessary to fit the game. By coding up a custom inspector/editor in Unity for the conversations (which were implemented as serialisable objects) I was able to hide any unnecessary implementation details and prevent myself from making any mistakes.
To give you an overall idea, here is the default Unity inspector of the type on the left versus the custom one on the right:

I spent almost an entire day of the jam on this altogether, but in the end I think it was worth it, since apart from the aforementioned bug, I was then able to add new conversations very easily where necessary.
As you perhaps can see, the structure is recursive and allows for nested multiple choice branches, altho I never did end up doing much with that since the narrative didn't end up demanding it, in part because I just didn't have time for anything so advanced—I was running out of time as it was! ⏰
Simplification
Originally I tried to design the system so that it was possible for dialogues to branch back out to where they came from at the end of a subtree and continue from there, implementing this complex system of conversations as a stack that had to be pushed and popped to. In the end I got rid of this and made all conversations just recurse deeper and deeper and end at the final node instead, which saved me a lot of headaches and did the job just fine!
That's it?
I don't know. I didn't exactly go deep here. You probably didn't learn anything, haha. But just to give you a basic idea (perhaps of what not to do, at least!) in case you're thinking about doing something similar for your next jam. 😗
Thanks for peeking!