So, replay systems eh? Hopefully I can make a contribution to this.
I needed to make a replay system for my game, similar to the one present in Super Meat Boy. Here is the end result.
Unfortunately when it came to implementation, I found that the topic of creating replays for games is woefully under-doccumented.
The general consensus seemed to be that the most efficient system is to record player input (And timestamps for when that input happened), and "play it back" at the appropriate intervals.
However, as I am using Unity, this approach is no-good as Unity does not have deterministic physics. that means that whilst two iterations through a game scenario might be very, very similar (when given the same inputs), they can not be guaranteed to be identical. This has the potential to cause issues when dealing with a replay system as the user may view something in a replay that quite simply didn't happen in-game.
After reading a few papers, I settled on an approach similar to the one used in Braid. Braid, due to the player being able to rewind to
any point requires the storage of game state. The disadvantage of this is that (comparatively) the memory requirements will be very high, but it has the advantage of being incredibly accurate, and fairly "simple".
It should be noted that in my game operates with a semi-fixed timestep. Time for physics updates/logic etc is all fixed, whilst rendering is not. In laymans terms that means that things such as my character movement all works in "Units per Update", rather than "Units per second". So, if You had two versions of the game with different update timesteps (Say 60u/s and 30u/s), the latter would operate half a slow as the former.
Having a fixed physics update was fairly essential for this system, as what I would do is record the state of my character at every tick, and store it. I take a timestamp of the "update iteration", as well as details such as the position, rotation, current animation (I had to build a system to handle that) etc. Note that if the state has not changed in any way (e.g the player has just left the controller on the floor and walked away) then I do not record the state for that update. This helps to optimise a bit.
Then, when it comes to playing back the replay I simply iterate over the recorded "actions", and "restore" my character to whatever state the action tells it to be in. During replays, all physics interactions are turned off and what you see is not interacting with the game in any way.
Now, this solution is fairly specific to the needs of my game, and I will have to expand upon it later so that elements other than my player character can be recorded if necessary, but I think it works quite well for what it is.
Sorry that this hasn't really been a technical summary, but if anyone has any questions or is encountering any problems with their own system then feel free to ask and I'll see if I can shed some light on it.