In the past, I used to create a simple replay system in a framerate dependent game. Basically, from the start of the stage, I logged which keys do the player pressed and released at which frames. It works just fine with simple game loop (I don't even have frameskipping at that time)
Now in C2, since we got ourselves independent framerate here and the ways things go around are different. If I am to record all the keys that the player pressed and released, I will need some ways for this. The same program running twice may result in very tiny bit timetick and this might not work.
So anyone got an idea?
I prefer to log just the keys pressed and released and the random seed values to make the original run and the replay run identical. But sure, there are more matters at hand. Still, we have such replay feature in Team Fortress 2, so it should be possible. Furthermore, Blizzard's Heart of the Swarm kicks this up a notch by allowing the player to "drop in" and continue from any part of the replay.
While recording software allows us to store everything we see on the screen into a video file, the problem is the file could be big, especially on longer replay.
Develop games in your browser. Powerful, performant & highly capable.
Yes, it's possible, it's really complex if you use array for every objects that record the values like X, Y, Instance variables, etc.
You can save .json as replay file from array, then load .json file to play the replay.
R0J0Hound made this simple version of ghost replay, you may research it:
Interesting... is there perhaps a way to record replay data, save it, and then put it back into the game as a demonstration of how to play the game, similar to the Luigi help feature in Mario Bros WiiU?
Or is that what you said? ow do we save JSON data so that it can be used later?
AnD4D yes, take a look .capx, i've recorded the demo and it loads the replay on start.
I downloaded your example, and its incredible how simple the code looks like. But, I have trouble understanding how it works (I am pretty new to C2).
Do you think you could write a short explanation of the design principles behind it, and how it works?