Currently I’m in the planning stages of a project I’m undertaking.
I’ve been put in charge of creating the quest-system, after having done some research I figured something that would make sense is to have the following:
A Quest Manager Class -
this predominantly has a List of Quest Objects (all possible, only those active - unsure atm)
A Quest Class -
This should have several states (inactive, active, success, failure) and be made up of a List of Tasks. It will also evaluate when each task is completed to see if the quest can change state and provide some type of reward (tbd)
A Task Class -
This will have states like with Class so it’s a bit Copy/Paste, and has an Evaluate() function to see when the task is complete - I thought about having subtask classes for killing tasks, navigation (go-to-here) tasks, gathering tasks (50 pelts), and interaction tasks (talk to John to start/finish). So you could have a quest made up of Speak to John (interaction), kill fred (kill), gather 10 daisies (gather), return to John (interaction). Once they’re all in the success state or potentially removed from the quest list the quest changes to successful.
My first question is just does all of the above actually make sense and work together?
My second question is that I’ve looked a little bit into ScriptableObjects and believe that’s what should be used for all of these as they’re not objects but really just containers of data that’s going to be manipulated based on events.
Finally, since Task & Class both require some form of State Machine/FSM design to them, what are the best ways about doing that? I’ve looked into tutorials and everytime I see “enum State[ ]” I feel that’s not a real expression of a State Machine. I’m looking for a way to implement this in a professional manner and enum just feels quite simple and not adaptable for later on should anything change. From reading Game Programming Patterns I know they advise on having either all states as seperate objects available but switching which is being pointed to (not really clear on this idea) OR having a single object that is deleted and instantiated over changes made (which makes a lot more sense to me). This is the biggest hang up I have as I’m not too sure where to start right now so any tutorials, advise or ELI5 guidance on this part will be a huge help!
Cheers
BZ