Locking frame rate?

Blitz3D Forums/Blitz3D Programming/Locking frame rate?

Boiled Sweets(Posted 2004) [#1]
Hi,

we have been using the 'dymanic frmae rate' code from the archives to lock our frame rate. However it uses 'delay'.

This seems to make our games feel very sluggish. Is there a better way to lock the frame rate that doesn't use delay?

Many thanks.


jhocking(Posted 2004) [#2]
I don't lock the framerate. I use the delta time method to keep my games framerate independent. Scale all changes by the framerate.


AbbaRue(Posted 2004) [#3]
Some video cards allow you to set the vertical sync.
If you set vertical sync to 60 fps that is what you will get without any delays.
At least this is how Radeon 9800 works.
I had mine set at 100 fps and I had to turn it off so I could test the real speed of my program.


Ice9(Posted 2004) [#4]
Yes Delta time does a great job. The best way is to create the delta time by averaging the time of several frames together. That gives the smoothest response.


Boiled Sweets(Posted 2004) [#5]
But how do I go about setting up delta time?


Mustang(Posted 2004) [#6]
But how do I go about setting up delta time?


Try this:

http://www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=gamemorduun03212002.html

Check other tutorials too:

http://www.blitzcoder.com/articles.shtml


jfk EO-11110(Posted 2004) [#7]
Morduuns Tutorial (the first Mustang listed) is a very clear delta_t description. One practical tip he forgot to mention is:

When you have 3D-Animations and you already used to set the Animspeed to some values, you only have to say
UpdateWorld(FL\SpeedFactor) and all Animaions are running with the correct Speed.


Ice9(Posted 2004) [#8]
jfk, Who would have known. I had the animations all calced
out with deltatime as the speed argument for the Animate command. I guess both work but I wonder what other benefits this has?
How long has that argument been on UpdateWorld anyway?