Does your FPS cap?

Started by
6 comments, last by Esmo2000 17 years, 9 months ago
I am curious, I just added a FPS count to my game and no matter what I do I can't seem to make it go higher or lower than 60 FPS My game is only using about 7% processor while running so I know my comp isn't maxed out. Just curious if DirectX or Visual Studio's is capping this limit. Or what is going on. Not that its a big deal just kinda curious. I wanted to see how much wiggle room I had to add crazy stuff to my game and I can't really tell since i can't change the FPS :-) Cause I hope I am not already using that much resources :-) considering I have a Athlon 3500+ Nvidia 6800GT and my game is only a 2d isometric Map basically. and only 160x60 tiles so far.
Advertisement
FPS will match your monitors vertical refresh rate. Disable vsinc from the video configuration.
[size="2"]I like the Walrus best.
Yea, I had this problem too. I fixed it by going into my NVidia driver control panel, Performance and Quality Settings, and in my global driver settings unchecking the Application Controled box next to Vertical Sync and then changing Vertical Sync to Off.
V-Sync means that DirectX will attempt to render as many frames needed to keep up with the monitors refresh rate which is in this case 60. V-sync is used to fix the tearing issue that appears if your games rendering becomes "out of sync" because it is producing more or less frames than the monitor. If you have any Source engine games turn v-sync off and turn around quickly which will demostrate tearing. [smile].

You need to turn it off inside of your driver control panel (just set it to application preference) and then set the PresentationInterval in your PresentParams to Intermediate.
or he could just change the monitor refreshrate (decent CRT monitors can handle up to 200hz)
You can't really expect any future users of your program to mess around with their refresh rate settings and you can never guarantee that whatever your settings your program makes won't be over-ridden by the user's local graphics settings.

Far better is to write the game so it runs independant of frame rate. Use your FPS calculations to pass a float delta expressing time passed since last frame into your engine and move or update everything based upon this value. This will run more smoothly on a higher frame rate but still run at the same percieved speed on a machine with a lower refresh rate, or a machine slower generally that can't spit out frames fast enough.

There are loads of threads about this topic all over GameDev if you want more information.

HTH Paul

[EDIT] When I was writing a simple little platformer and decided it was too much effort to write time-based instead of frame-rate-based movement and animation, I just capped the frame rate at 60 fps in the main Windows message loop. Worked fine on every computer I tried it on but a bit of a hack in some respects since wouldn't run properly on an older machine that couldn't manage 60 fps. I believe almost any modern monitor can manage this as a refresh rate though.
OHHHH
im such an idiot :-)
I should have thought of that
I was driving myself crazy trying to figure out what was going on.

Thanks a lot for the help :-)

Oh and to add, I am using a LCD, so I can't change the refresh rate, i already tried that :-)
As for writing the game so it runs indpendent of the FPS. I really would like to do this... but considering I have only been using DirectX for about a month. I should probably worry about other things and plan on adding that later though :-)

Again Thanks a lot for the help
Also, if you are using some sort of double buffering technique that it may wait until you finish completing a draw before it places the new image on the screen. Try putting in a sleep command just for a testing, and increase it bit by bit. Eventually, the performance should drop below 60 frames per second. When that happenes, if you move to something like 50ish fps its not that, but, if you move to 30fps its most likely your double buffering.

Hope it helps,
We are what we do repeatedly. Excellence, then, is not an act, but a habit.

This topic is closed to new replies.

Advertisement