Greetings all! Without a doubt, there is a better title for this post. I’ll figure that out as we go on and will edit accordingly.
I’m building an extension where I’m using @protect to save information across world states. Here’s the basics so far:
Include (-
Array world_reset -> 2;
[ AddWorldResetProtection;
@protect world_reset 2;
];
[ RemoveWorldResetProtection;
@protect world_reset 0;
];
-).
To set world reset preservation:
(- AddWorldResetProtection(); -).
To remove world reset preservation:
(- RemoveWorldResetProtection(); -).
To establish a world reset:
(- world_reset -> 0 = 1; -).
To establish death in previous world state:
(- world_reset -> 1 = 1; -);
To decide whether a world reset has happened:
(- (world_reset -> 0 == 1); -).
To decide whether the player died in a previous world state:
(- (world_reset -> 1 == 1); -).
To say establish a world reset:
establish a world reset.
To say establish death in previous world state:
establish death in previous world state.
To reset the world:
(- @restart; -).
Carry out restoring the game (this is the ignore world preservation before restore rule):
remove world reset preservation.
Carry out saving the game (this is the respect world preservation after save rule):
set world reset preservation.
Very simple and it all works great. What I would like to do is generalize things. For example, right now, I handle persisting that a world state reset (“restart”) happened and whether the player died.
Certain things might happen in the game world, such as an object becoming known when it was unknown the first time through. So note that this is a case where everything is reset to the way it was (since, behind the scenes, it’s just a forced restart), but some knowledge is retained. I still need to investigate the autosave extension as well.
I’m unsure if it’s possible to generalize what I have above to allow the author to have that control. For example, via phrases, they could add something like this:
now the known state of the amulet is preserved
Behind the scenes, of course, I would have to have the array with enough values to allow for this so there would be limits.
What do folks think? Am I on a good path with this?
The context here, in case it’s not clear, is that restart is being made into a diegetic concept. My main focus on this is coming from looking at time travel concepts, where maybe a time paradox causes the world to reset to its original state, but the player character retains their memory through the transition. This feels like it could have some interesting ways to mirror growing player knowledge that the player character would also have.