Delta Timing?

Blitz3D Forums/Blitz3D Programming/Delta Timing?

With render tweening your game logic runs a set number of times per second, say 20, and you use all the free processor time to update the display with objects at positions between the last two updates - faster machine->more tween frames->smoother.

Delta time runs the game logic as many times per second as your machine can handle. The time between the last two updates (the delta time) is calculated and used to update the world in a way that will keep things running the same on different speed machines. If your delta time is t milliseconds, and you want it to move v units along x each update, you say:

x=x+v*dt

Deltatime has issues - I found it produced some jerkiness and found it hopeless for physics. I tried delta time for a crazy golf game. Any physics simulation accumulates errors with time, which often doesn't notice - the game feels right - but on my crazy golf game, given an equal power hit on two machines with different speeds the ball would travel very different distances up a slope. I remember Swift talking about a better method of deltatime but can't remember the details - perhaps he'll read this. This is the widely used version I think, tho.