Frame/Time Correction Code

Monkey Forums/Monkey Code/Frame/Time Correction Code

Richard Betson(Posted 2011) [#1]
Hi,

This example will correct delay/lag in your targets system performance by using delta time correction and frame accumulation. It basically calculates for missing frames and and then supplies the correct position of an screen object. In addition it accumulates partial lost frames and threads those back in.

I have it set to simulate half of the frames (seeking 60fps but getting 30fps) being dropped and then recovered. Use the arrow keys to adjust SetUpdateRate() and the target/correction FPS. This code can recover and limit the frame rate.

L8r,




Richard Betson(Posted 2011) [#2]
Hi,

I have edited this code for better performance and logic. Works even better:)

L8r,