Quote from: Crimson Wizard on Fri 19/08/2022 19:32:12
The typical solution is to organize your game in steps, where you can clearly define what is required for reaching each step: story variables set, characters moved to rooms, inventory given or taken, and so on. Note that I am not speaking of any player action, like walking around, or reading the dialogs, but the logical changes in the game only.
After that you will have a list of all things necessary to change from step A to step B, and so on.
Then you will be able to write a function that advances the game from start to any given step, by iterating through these steps one by one, until it reaches the required one. To clarify again, it only changes the logical state, and does not really simulate walking etc.
Thanks for the quick reply. You've given me plenty to think about.

I'll try to structure some code around this idea. I guess I'll have to build some kind of directed graph of story events, and keep track of the nodes which have last been achieved. Then if I want to start from a certain point in the story, in every Load function of a room, I can re-do all the actions which the last nodes depend on, and have some impact on the current room.
This could make my global variable use a bit nicer too. Maybe.

Something like that, anyway. If I figure out something really practical, I'll post here.
Thanks again!
