07-31-2015, 12:26 AM
Should I put the ability to rewind time in my project?
So some explanation: you have limited gameplay days and then the venture to the final battle happens. Given that, I thought I would do something like Persona 4: you can jump back a few days (lets say 4) to the start of that day. This reverts the save to the exact state it was a few game-days before: character stats and all that. The problem I have is how to create this.
Anyway I thought this idea was interesting in terms of how to handle it code-wise, so I rambled it out here, even if I might not use it.
So some explanation: you have limited gameplay days and then the venture to the final battle happens. Given that, I thought I would do something like Persona 4: you can jump back a few days (lets say 4) to the start of that day. This reverts the save to the exact state it was a few game-days before: character stats and all that. The problem I have is how to create this.
- Can you save game data to an object? As opposed to a save file? How do I avoid infinite recursion of a save file with a save object having a save object having a...
- Assuming the "rewind time save" object is created at the start of a day, how would I manage them? I'm supposing I'd create at the most 4 different saves, deleting the oldest at the start of each day. The reason I'd need four saves at all is because of the start of the game: I'd need to be able to cover days 1-4 until you gain access to the function day 5, but from then on... I suppose I'd actually only have one save object?
- How do I manage them post-rewind? After jumping back to an earlier save four days in the past, you should be prevented from jumping again until you've gone through four days again. However, perhaps again it would be the same problem as above: there would have to be up to four different saves stored in the save file, and when the feature is unlocked, saves are deleted each day until you've only got one stored again.
- It would be a lot less complicated to only rewind one day, but the player might not do much per-day (two events, plus levelling) to justify the function.
Anyway I thought this idea was interesting in terms of how to handle it code-wise, so I rambled it out here, even if I might not use it.