Hi everyone, I am a math teacher and recently dwelled into the hobby of learning to make (very simple games) on Godot! However I am encountering my first serious challenge where I properly need to think of the coding design. I understand coding design or structure of a game is a very broad question so it is hard to find specific tutorials or techniques that directly solves my problem. Therefore I decided that the best would simply be to post on the forum describing my particular case:
I am currently making a simple RPG: it consists of a character moving around a town and can talk to a bunch of NPCs. The current structure I have is one scene that is the scene manager that loads the current scene I am in (the main town, or a house etc.) and also possess some GUI properties.
To handle dialogues I use this really great plugin called Dialogic, if you do not know it you should check it out! https://github.com/coppolaemilio/dialogic I have one single NPC script that I attach to every NPC node, and using the plugin, depending on the NPC's name, it will trigger a different dialogue. (I attached two images at the end of the post)
To handle quests, I have a global script, that possess a bunch of bool variables that get triggered if the player performs certain actions (finds the key, speaks to a specific npc etc). I trigger them using signals. To save and load a game, I save the global variables into a dictionary and then can load them later if I play the game later.
The problem I have is that all the emitting signals handling the quests are in this one NPC script and is slowly getting very long. Because of the plug in, any signals that are emitted during a dialogue need to be caught by the NPC's that is talking. But now my NPC script is a very long file that handles both the dialogues mechanism and also the quests! This does not seem to be a very appropriate way to do things.
What could I do to make my game structure "healthier" and more consistent? Any links to tutorials or some documentation is always appreciated. Thanks a lot for your time.!
Image 1: Implementation of the dialogue using the plugin
Image 2: Emitting signals to advance in the story