Devlog 4: NPC, dialog system and quest system panel
I have made a lot of progress for my game in the past few weeks. First, I have created an NPC scene and resource, which makes setting up NPCs very easy. I’ve also added simple wandering and patrol capabilities to the NPC so that they can wander around in a random manner or following a fixed route.
I’ve also re-did my dialog system from scratch. Previously I relied on an addon, but later found out that this approach simply does work for my case. I watched a bunch of tutorials on this topic and got some ideas as to how I would implement this. Basically, all the dialog data would be read from json files in a DialogDatabase singleton. When our player interacts with an NPC, the InteractionComponent would trigger the DialogManager to pass the dialogs to the dialog UI. The hard part is how to design a data structure for our dialog data so that we can handle dialog progressing, branching and offering quests. It took some trial and error, but I arrived at a solution I’m happy with for now.
I also implemented a working Quest system. For now, the player can receive quests by interacting with NPCs. There are definitely more work to be done: for instance, creating a quest board where players can view and accept quests, creating a mail box where quests can be sent in. There are a diverse range of quest types that I need to handle, currently the system can only handle conversation and collection. I can definitely see myself re-do the quest system in the future, but for now, I’d say I’ve laid a solid fundation.