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.

Don't set the FPS to 30! With delta time you can as well have it at 200 or something..

I think that the point you have missed is that when you use delta time, your velocity will be measured in pixels per second.

For example,

Before you had:
Speed:+ 5
@60 FPS that would mean you add 300 to speed every second!
@75 FPS it would be 375.
@200 FPS it would be 1000!

If you have three people playing with these framerates they would all have a very different playing experience (if none at all).

With Delta time you do:
Speed:+ 5 * TDelta.GetTime()

That means you add 5 every second. See in the above example, that would refer to playing the game at 1 FPS, compared to your previous standard.

Speed:+ 5 * TDelta.GetTime() with 30FPS would mean that you add 5 every second.
Speed:+ 5 * TDelta.GetTime() with 75FPS would mean that you add 5 every second.
Speed:+ 5 * TDelta.GetTime() with 300FPS would mean that you add 5 every second.

In other words you have a FPS in-dependant game and your speed is measured in pixels/sec

If your screen is 600 wide and you want to travel it in 5 seconds you speed would be 600/5 = 120pixles/sec. (Quite slow)

You need to change your speeds to something like 200pixels/sec or 500pixels/sec.

This does not only apply to speed but to anything you would normally add:+