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! :)
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! :)