Replays and savestates

Started by
8 comments, last by Storyyeller 12 years, 9 months ago
My game has a reply system. While playing, it records every input. Since the game is deterministic, it can just play back the recorded input to create a replay.

The problem is that now I am adding a savestate feature to my game. Individually, the features work great. The problem is that it is impossible to record a meaningful replay when savestates are used. What can I do? So far the only thing I can think of is to create some sort of tree structure that branches off whenever a savestate is created, but this seems unnecessarily complex.
I trust exceptions about as far as I can throw them.
Advertisement
Simply record every action until the player dies, then discard it and start again. Only save the actions that get to the next checkpoint. That way the resulting video appears as one continuous playback instead of going forward then jumping back.
So what do you do about multiple savestates?

I suppose what you would end up with is a linked list of separate segments of the replay with each savestate containing a reference to the point where it starts.
I trust exceptions about as far as I can throw them.
Just save all inputs up to that point. If you start from a save, load the inputs and start appending to that list and on the next save just put the combined lists into that save. Make sense?
Always strive to be better than yourself.

Just save all inputs up to that point. If you start from a save, load the inputs and start appending to that list and on the next save just put the combined lists into that save. Make sense?


So you're suggesting copying the entire history with each savestate load? I suppose that is the simplest solution.It would take more memory, but I guess it shouldn't be a problem unless people play for hours and savestate frequently.
I trust exceptions about as far as I can throw them.

So you're suggesting copying the entire history with each savestate load? I suppose that is the simplest solution.

Just to clarify: I'm not suggesting copying from all the saves just from the currently loaded save. Because if you think about it what are you going to do if a save file gets corrupted? You'd be stroked on trying to replay anything.
Always strive to be better than yourself.
So far the only thing I can think of is to create some sort of tree structure that branches off whenever a savestate is created, but this seems unnecessarily complex.


Why do you think so ? It seems to map nicely to the reality. To me, it is doing something else that would be more complex :)
Well it's more complex than telling people to just not use savestates if they want a replay.
I trust exceptions about as far as I can throw them.
Why not keep the replay data only in memory and don't save that with the rest of the game?
Or is that what you are trying to avoid?

If so, and you fear that that moving the entire history every time a save/load is made could get very slow, how about only keeping the last 10/20/30 seconds of action in the replay and provide means to save individual replays?

Is your game an action/rpg or is it an rts like starcraft? How important is it that you have the entire replay all the time?
Yes, I expect to be able to save a replay of an entire game playthrough, store it to disk, and send it to other people.
I trust exceptions about as far as I can throw them.

This topic is closed to new replies.

Advertisement