Locking frame rate?
Blitz3D Forums/Blitz3D Programming/Locking frame rate?
| ||
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. |
| ||
I don't lock the framerate. I use the delta time method to keep my games framerate independent. Scale all changes by the framerate. |
| ||
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. |
| ||
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. |
| ||
But how do I go about setting up delta time? |
| ||
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 |
| ||
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. |
| ||
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? |