Game Timing

BlitzMax Forums/BlitzMax Programming/Game Timing

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The prefix milli( m ) is equal to 1/1000

So ONE Milli second = 1/1000 Seconds
1000 Milliseconds is = 1 Second

And if you add delta time, and notice your games runs slower, it is most likley to have something to do with the speed of your objects.

For example,

Before DeltaTime :
ShipSpeed = 5
This means: Move 5 pixels every frame, if your FPS is 60 then, the actuall pixels/sec that you move is = 5*60 = 300pixels/sec.

After DeltaTime (no change to the ShipSpeed Variable )
ShipSpeed = 5
This means: Move 5 pixels every SECOND, if your FPS is 60 then, the actuall pixels/sec that you move is = 5pixels/sec. Much slower than 300pixels/sec. If however your FPS is 30, and you use delta time, your actuall Movement will still be 5pixels/sec. (still very slow)

So you take and change your ShipSpeed to 300 pixels/sec and your game speed should be the same as before you added delta-time. (Of course this should be analogus to all speeds and accelerations ;) )

However if you have problem with delta-speed not being the same at different FPS then that is a bug/error.

And jerkyness should only be visable if your FPS is very low. 30 FPS should work, Though if your computer is so slow you need to run the game in 30fps, isn't it better to simply increase the Min-Req (run at 60 as min) or try to optimize the code to make the game run faster?

And the reason I do not multiply my delta time with x100 or something is because I want the speed in pixles/seconds, not 100pixles/second - where a speed of 5 would really mean a speed of 500. That seems only to bring more confusion into the mix to me.