Jump to content
  • Advertisement
Sign in to follow this  
Chire

OpenGL Uncontroled high FPS for Opengl Project on other machines

This topic is 3722 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, im having some dificulties porting some projects to other machines, the framerate goes extremely fast like 280 and its unplayable, when in the original pc the framrate was locked on 60fps, is there a way of making the aplication run at normal speed on every machine? thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Could you do something like pausing the thread in which you are rendering for a specified amount of time before resuming to render the next frame?

Another thing you have to consider is whether the machines you are running on have vertical synchronization enabled. I'm guessing that is why your application was locked at 60 fps on your first machine.

Share this post


Link to post
Share on other sites
You'll need to make the logic framerate independent from the rendering framerate. This will make it irrelevent how many rendering FPS you are getting.

I usually clamp my logic FPS to 30, and let the rendering go wild.

This topic has been run over many times on the forums. Try searching the forums for "rendering logic independent".

The number of times the scene is rendered/displayed to the user should NOT affect how the games is played assuming you can render the scene >= 30 times a second.

Just use your timer system to make sure your game logic doens't get updated more than once every 33 milliseconds.

Share this post


Link to post
Share on other sites
Quote:
Original post by dgreen02
...
I usually clamp my logic FPS to 30, and let the rendering go wild.
...


Rendering more than 60 fps is not very useful as the refresh rate of the monitor is usually 60 fps. It just do nothing besides keeping the CPU busy.

However, the input device have a far far higher refresh rate, 30 Hz for game logic is too slow a respond.

I think... the converse should be better, i.e. clamp rendering FPS to 30, and let the logic go wild. Just make sure you are using the system timer to tick the progress, it should be fine.

[Edited by - ma_hty on July 17, 2008 5:16:56 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by ma_hty
Quote:
Original post by dgreen02
...
I usually clamp my logic FPS to 30, and let the rendering go wild.
...


Rendering more than 60 fps is not very useful as the refresh rate of the monitor is usually 60 fps. It just do nothing besides keeping the CPU busy.

However, the input device have a far far higher refresh rate, 30 Hz for game logic is too slow a respond.

I think... the converse should be better, i.e. clamp rendering FPS to 30, and let the logic go wild. Just make sure you are using the system timer to tick the progress, it should be fine.


Either way you're going to chew up the CPU, why leave it idle if your game is running fullscreen? Of course there's no point in rendering more than 60 times a second, nobody will notice it, though it's a nice way to gauge things. Every engine does it, unless you turn vsync on to get rid of the tearing.

I say to clamp the logic @ 30 times a second because I'm used to complex scenes and logic updates where I'm lucky if I can get 30FPS on a high end machine. I'm not sure what the OP has in mind for the future, but in a complex physics scene xxx,xxx collision triangles and 1000s of actors you'll be heavily CPU/logic limited.

I suppose for a 2D game or lite 3D game or something where the controls might matter to that degree, yea you should put the focus on the logic...but I can't tell a difference personally.


Anyways the solution to his issues lie in making the logic/rendering independent of eachother using a timer system. Once that's in there he can clamp either at whatever rate works best for his setup.

Here are two articles on the topic right here at gamedev if the OP hasn't already found them:

Achieving Frame Rate Independent Game Movement

Frame Rate Independent Movement

Share this post


Link to post
Share on other sites
Quote:
Original post by dgreen02
I say to clamp the logic @ 30 times a second because I'm used to complex scenes and logic updates where I'm lucky if I can get 30FPS on a high end machine. I'm not sure what the OP has in mind for the future, but in a complex physics scene xxx,xxx collision triangles and 1000s of actors you'll be heavily CPU/logic limited.


I'm sorry. I don't quite follow your logic.

Yes, although the game logic is usually less demanding than the graphics routines, it can happen to be more demanding. However, if it does happen this way, why would it help to force the game logic to perform at a lower rate explicitly?

[Edited by - ma_hty on July 17, 2008 9:34:39 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by ma_hty
Quote:
Original post by dgreen02
I say to clamp the logic @ 30 times a second because I'm used to complex scenes and logic updates where I'm lucky if I can get 30FPS on a high end machine. I'm not sure what the OP has in mind for the future, but in a complex physics scene xxx,xxx collision triangles and 1000s of actors you'll be heavily CPU/logic limited.


I'm sorry. I don't quite follow your logic.

Yes, although the game logic is usually less demanding than the graphics routines, it can happen to be more demanding. However, if it does happen this way, why would it help to force the game logic to perform at a lower rate explicitly?


For me I don't notice any difference + 30 frames per second in terms of the game "logic" updates, and clamp it at 30 so I can make sure things run the same on every computer...which infact would solve the user's issue above. When it comes to stability of physics engines and the 1000s of variables that can be tweaked it's nice to limit the range of possible updates-per-second, for instance. Also when doing multiplayer stuff, it's nice to limit the # of updates for certain things.

Also you have to understand that "setup" ie: building vertex buffers, potential visiblity, etc. all fall under the catagory of "logic" and not "graphics" and in what I was describing...in very complex scenes the physics and this other stuff will take up more time than rendering, it all depends on what you're doing.

Share this post


Link to post
Share on other sites
So you update your logic 30 times a second, render 60+ times a second...lerping between previous frames to provide smoother visuals, and using less CPU time.

If you are limited by the logic and let them both run un-checked you'll end up somewhere in-between at 45 FPS with mixed results on all types of hardware [ cpu/gpu combinations].

I find that computers these days [ say an Intel 6600 + Geforce 8800GTS ] are going to be CPU limited in complex games/applications.

Share this post


Link to post
Share on other sites
I'm sorry again. I find it nearly impossible to believe what you said. The flaws in your description are just too obvious. Anyway, our discussion has gone to far from the topic of this thread. Lets stop here.

Nice to have the discussion with you.

Gary

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!