I know that there are many threads on the subject of Delta Timing but I couldn't find anything that addresses the problem I'm having. Basically I calculate the ratio for my timing every frame using the following code:
Function Calculate()
Local dt# = MilliSecs()-_oldtime
_actualrate = 1000/dt
_ratio = _framerate/_actualrate
_oldtime = MilliSecs()
End Function
The problem is that the ratio varies wildly from frame to frame. It even becomes negative at times. This, obviously, results in very jumpy behavior. The funny thing is that I've used this before and it worked fairly well. Does anyone have any idea why it's not working? If it makes any difference I'm using the Chipmunk Physics Engine as well.
|