I know this is a bit too vague, but let me explain.
Many linear story-based games have some kind of objective system, where the player is vaguely told what to do, e.g.: "Walk the dog"
But then the games are often built in such a way, that these objectives have multiple steps, such as "Leash the dog", "Leave your house", etc. where the player would not be able to leave the house before leashing the dog (e.g. play cue "I must first leash the dog") - sometimes these steps are shown with the objective as current progress, sometimes they're just something internal, the player got to do to trigger the next one
While trying to work on such a system, I was wondering: what would the ideal way to make such a system be? I'm not asking for any code and I know that this is heavily preference and use-case dependent - and that is what I would like to know, to make up my own mind. How would you structure such a system. Not in every detail, but vaguely.
One can, for example, make heavy use of C# events for this, split objectives into smaller steps that each trigger (in the above example, the door interaction) checks for. Or one can have dedicated classes for each objective that specify the objective's behavior.
So far I've only done more sandbox-ish stuff in Unity and would like to tap into more controlled, linear, flow and eventually make a linear story-based game, with such an objective system being the main-driver of the game. But I just cannot get 1 and 1 together and decide for a concept/structure that would be "optimal" (so, no spaghetti). I've tried going the split-objective way, but found myself uncomfortable with that. I was using string-based IDs to identify the active objective and the current step it is in (something like, "walk_dog::step_open_door") but of course, keeping track of all that isn't going to be fun in the long run.
How would you do it?