Dialogue System: Quests


Where Do I Start?

I'm writing this dev log up after I reached my stopping point. This is usually the way I do thing, but sometimes I like to think about what I'm doing before I do it. Today was not one of those days. I started by trying to do everything myself. I took existing code for my talking points in the dialogue system and modified it to work for my quests.

But I ran into an issue, I couldn't figure out the best approach to validate a specific condition. So I asked Gemini to assist and it gave me some good ideas. I didn't use them exactly as they were supplied, but they were close enough to right that I continued what I was doing. I went through a few different iterations before I got it just right though.

What Happened?

I ended up adding seven new functions to my dialogue system. Each one does very specific things. Along with those functions I had to add new variable definitions, as well as add new functionality to my ready function. First, I had to actually modify my scene, I added another new container to hold my quest-related stuff. I added variables to hold these new pieces for reference later. I added a couple of other variables I knew I'd need based on the way the talking points work.

Once that was done I needed to get the code working, and for the most part it went pretty smooth. A lot of the existing functionality surrounding the talking points worked with very little change. There's actually still one or two placeholder functions in there as well. One I definitely plan to use and still need to implement, I'm not so sure if I'll keep the other though.

But now I have my quests in the dialogue system. When the player clicks the quests button it iterates through all the active quests looking to see if any have an objective to talk to an NPC. If it finds one, it compares the ID of the NPC being talked to, and if they match, a new button is born! The button doesn't actually do anything yet, but eventually it will.

Once the player clicks away from the quests area, the buttons are returned to a pool for later use. I actually just made a quick fix to make sure that when the dialogue system is opened the first time that all buttons, whether quest or talking point, are returned to their respective pools. That should make things a little more robust and less error-prone.

I didn't quite get everything working the way I wanted right away. I missed hiding my quests button area when the dialogue system first instantiates. It took a little trial and error to figure out exactly what was going wrong though. The issue seemed to be with a different part of the dialogue system.

What's Next?

Next up, I need to continue working on this. Right now I have to actually add in something to happen when a player clicks a quest's button. Actually need to do that for my talking points too. They'll probably both work the same way, I'm pretty sure I'm going to actually use talking points in conjunction with quest objectives. Right now my quest definition doesn't actually contain any data surrounding the dialogue system, so if I add a talking point for every quest objective where the player needs to speak to an NPC, I can just do a little something magic behind the scenes related to the quest, but then just load the dialogue's talking point data.

But that's work for tomorrow, today I did good! Today I accomplished something. Today I took another step towards my goal.

P.S.

I wanted to share a little story with you about something that happened to be recently. Yesterday, a friend came over to my apartment while I was in the middle of working on the game. He looked at my screen and said something about how complicated my job must be. He didn't realize I was working on my game. I corrected him, and decided I was going to show the game to him. Because I was literally in the middle of writing out new code at the time I decided to show him on my phone using the Godot Android editor.

What I didn't realize is that the Godot Android editor was recently updated to 4.5 and my project is still running in 4.4.1! Upon trying to load it, things just didn't work and I had no idea why. At first I thought it might have been due to not actually opening the project on my phone in a while, so I went to do that and was greeted with the message that my project version didn't match the editor version.

What really bothers me is that I don't want to change the version of Godot I'm using, and there doesn't seem to be a way to roll back to a previous version of the Android editor! I decided I needed to speak up and made a post to the official forum as well as left a review in the play store.

Leave a comment

Log in with itch.io to leave a comment.