RPG dialogue and quests

I just wanted to say how much I’ve enjoyed the RPG courses, and how much I’ve learned. Thank you for that, GameDevTV!

The only thing that I wasn’t completely happy with was the way that the dialogue progressed in the UI, where a question would be asked, then I’d have to click “next” to get my list of answers. I took the knowledge I gained and changed the way that the dialogue worked.

I created a DialogueModel class, which essentially builds an entire dialogue event. PlayerConversant calls it’s Build method with the current DialogueNode, and DialogueModel traverses through the node’s children to build a model of that interaction, then this is passed to the DialogueUI.

Sounds complicated, but it allows me to have the question and answers on the same UI, and I also built-in Localization and AudioClips.

It’s essentially using a form of Model (DialogueModel), View (DialogueUI), Controller (PlayerConversant) methodology, and even though DialogueModel ended up being WAY more complicated and finicky than I anticipated, it works great.

Thank you GameDevTV for firing my imagination and motivating me to test my programming skills!

2 Likes

Woah, VERY well done! I would be interested in seeing your solution for this approach!

I am still refining the whole thing - I had some new ideas for refining how I configure the DialogueNode to more effectively store references to the various assets, so give me a wee while to do that and then I’ll come back and post more.

In the meantime, here’s what my dialogue UI looks like in my sandbox, using the assets that GameDevTV supplied - I plan on making my own.

The app that I am working on will teach the Scottish Gaelic language (hence the dialogue in use here), although it could be used to teach any language. The app has two language settings - the UI language and the dialogue language, and uses two Localization tables for the various pieces of text. So the entry for the text in the DialogueNode is actually a localization key that is used to grab the ‘real’ text out of the localization table, and also has a reference to an audio clip asset for the playback.

When the text appears, the audio clip is played, and can be replayed before answering using the gear icon (which should be an ‘ear’ icon but I don’t have one handy!). Then in the answer button area, the gear to the right of the answer button plays a clip of the answer. The idea is that the player can hear the pronunciation of the answer.

Again, this is all in my prototyping, and the DialogueModel allows me to set this all up before even updating the UI, and handles the translation/localization as well. The DialogueUI class presents the information in the DialogueModel and sets up the button callbacks, etc.

LOTS of work still to do in the sandbox/prototype, but it’s coming along. As usual, I find myself finding better ways to accomplish this so the code is in an almost constant state of refactoring! My problem is always knowing when to quit :stuck_out_tongue:

As an aside, I also took a lightly different approach with the quests dialogue:

I also changed a few things so that the quest items only appear in-game when the quest has been given :slight_smile:

2 Likes

Well done, I’ll be interested in seeing how this progresses!

Privacy & Terms