replay

Hey i am struggling hard to implement replay in my game..

like how to track what user has done ..any idea form where to start..
i just want to show something like they did in spliter game
Save everything what user does and then repeat it in your replay 🙂
that what i am asking..shall i go with some array or something different...but its again difficult to show all the movement.. can you explain more 😀
Thanks
Well, really I haven't tried to make something like this, but
you must create an array of some Action classes and save the frame(or time).
Then, when replaying you must check the frame and repeat the action..hm..
There was another thread on this somewhere by the guys who did Incredibots.

Basically, they discovered this: You can't do replays by hoping to recreate the a world in Box2D with the exact same conditions as before and then running it. That might work if you run the replay on the same computer that you created it with, but different computers with different processors (and maybe even different versions of the Flash Player) will give you slightly different results that end up cascading into drastically different replays.

Instead, your best bet seems to be to record every object's position and rotation every few intervals in a giant array and then "dumbly" play back the array like a giant animation script -- Box2D won't be involved at any point in the process. I think the Incredibots guys had to do some pretty sophisticated compression and simplification in order to keep the script down to a size that wouldn't overload their "saved replay" database, but I don't know exactly what they did.

--T

Original thread: https://box2d.org/forum/viewtopic.php?t=2429