Jump to content
  • Advertisement
Sign in to follow this  
Storyyeller

Replays and savestates

This topic is 2558 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!