PDA

View Full Version : Frame rate independent racing game replay


summer
09-16-2008, 02:57 PM
Hi all,

I'm doing a racing game that allows people to challenge each other via email. I have to record coordinates and rotation for how one person drives the track and then recall it once another driver has accepted.

In theory it's not that hard, but it gives me jerky results when playing back the recording.

I have tried recording on ENTER_FRAME while moving the car and adjusting for eventual frame rate loss by measuring the time difference since the last frame and setting the speed of the car between those frames.

I have tried creating a timer that records every 30 ms, and even setting all my event listeners to ENTER_FRAME, whatever their purpose may be.

All this gave me jerky results. Some times the replay car will speed up and other times slow down, all while jumping back and forth at times.

Should I go as far as to create time indexes in an array? It would take a bit of time to make those adjustments which makes me a bit reluctant in case it would give me the same jerkiness anyway.

I would be nice if someone could redirect me to some theory or examples. Doesn't have to be AS3 specific.

Thanks! :)

summer
09-16-2008, 07:38 PM
nevermind. i had to use one timer in stead of two since they simed to be drifting appart even if set with the same update interval.