Open LittleEndu opened 5 years ago
Fast forward and frame advance are done
Missing features: Rewind Skip to frame number
Main problem: Replay files are currently made up of a sequence of inputs, meaning it is not possible to support rewind based on that information as there is no state information that allow the game to find out what happened earlier in the match without restarting the replay.
Possible solutions:
Skip to frame number is certainly possible but would nowadays rather be "skip to time" as frame numbers are no longer visible by default. Additionally there is a big uncertainty of how the UI should look for this as it would require an input dialog of sorts.
We actually save the state of the whole system in rollbacks. I have a branch that does rewind already... so I'll assign this to me and can post a PR when we are done with major reworks.
Up to 4s of rewind are possible now. We may want to look into allowing users to configure how much rewind they want for replays. The concerns for this are mainly: Can the CPU comfortably keep up with creating rollbacks? If not, players may want to disable it to avoid stuttering during replay playback. How much RAM is available? Saving more game states is mainly a RAM concern. As a rule of thumb, one second of rewind occupies around 15MB of lua memory. Panel Attack currently caps memory allocated by lua (without assets) at 256MB and enforces garbage collection at higher values. Besides rollback copies, lua memory grows very slowly, at the time of writing around 5MB per 10 minutes in a high gpm 2p vs game. Players could configure a modified RAM cap for replay playback. Based on that we could calculate how many seconds of rewind we can afford. Setting the modified RAM cap to 1GB for instance would already allow ~16s of rewind. Definitely needs a bit of practical testing to see how things turn out in reality though.
Things like fast forward, rewind, skip to frame number, etc.
As of opening this issue, it had 14 votes (most voted issue having 72)