Replays for driving game?

I’m currently working on a racing game for iOS and I’d like to have a replay when a race is finished with the option of saving/uploading the replay.

I’ve found EZ Replay Manager but I’m not sure there’s a better solution out there?

hey man, let me know if you find anything i’m very interested in this also !
Good to see a fellow yorkshire man on here :slight_smile:

An easy way is to record user input events with a timestamp into a buffer/array, if you use random numbers for anything
seed each level at start with a known random seed # ( maybe the level # ).
then just restart level with that seed and key the input events at proper time.

You could even record the cars x,y,z ( or other info ) when an input event occurs. this would correct any inconsistencies that might arise.

This makes sense, i’m some what lacking the coding knowledge to make this happen at the moment but definitely get the idea. One thing i’d love to implement is some way of spitting out replays to be converted to video files, do you think this is possible with unity ?

You could use same method, I have used the “input recording” / “random seed setting” method to make “Demo modes” for many games

Then just use some screen recording program to make video

a little pseudocode to record events:

( start of level )

  1. set Random.seed = levelnumber * 8192
  2. startTime = Time.time;
  3. save each input event into buffer/array with timestamp ( stamp = Time.time - startTime )
  4. if needed save to file or just replay from data in ram

this could recreate a very close replica of what happened depending on game

I did this with screen recording software but was playing it live, would have saved som emuch better stuff if I had some good replay code :slight_smile: