Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Lazy303

How do I get a constant FPS?

This topic is 5656 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

Advertisement
Guest Anonymous Poster
Fix it.

Share this post


Link to post
Share on other sites
ahh thats helpful ap.

you could vsync your output, or just clamp it to it''s lowest value (by not rendering until a certain time has passed)


This room is green

Share this post


Link to post
Share on other sites
Why do you want a constant FPS?

Surely you're better off letting things run as fast as possible.

Or were you asking how to do time based (frame rate independant) movement, rather than relying on a steady FPS to acheive a similar effect?

Regards

[edited by - Shag on April 1, 2003 8:11:33 AM]

Share this post


Link to post
Share on other sites
Yeah, you can''t achieve a constant FPS (unless you have it constant at around 0.1fps, which all machines can achieve - albeit turning your game into a very boring slideshow in the process).

What do you mean by ''jumpy?'' If things keep moving at different speeds, then you need to uncouple the game''s physics from the framerate (''framerate-independent movement''); if things are moving ok but the game just appears jerky, then you need to optimise your graphics system (cut down the number of polys you are drawing, and make the ones you''re still drawing simpler to draw e.g. by batching your triangles).

People here should be able to help you out with either one...

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Share this post


Link to post
Share on other sites
Unless you mean it drops into unacceptable ranges. If so then profiling is the best path. Add a structure of counters. One of the main things you count is time and use the performance counter to do that, i.e. QueryPerformanceCounter. When you enter a routing get the time, at the end get it again and add the differance to the counter for that routine. You don''t want to get carried away and do every trivial function. Rather start at the frame time then add additional ones to break that time down, i.e. update, render, etc. There are major things you do in a program. Count those as well, i.e. polygon counts, number of objects, etc. Just keep accumulating the count.

Then periodically log that structure to disk. The frame gives a logical time to do that. You then use a seperate program to calculate the differances and detect wraps. If one reading is less than the previous one then you wrapped and you have adjust the count accordingly. Finally load that data into a database like Access. Split your data according to a threshold on frame rate/time. Then compare and contrast the same groups. As an example do the slower frames have a significantly higher average number of polygons or objects.

Done right it is a trivial amount of work added to a program. So you always leave it running and it is just a matter of whether you actually log the information or not. You can add a mailbox for turning it on and off as you are running along with a simple console application to send a message to that mailbox saying which and where.

Share this post


Link to post
Share on other sites
Hidden
It''s better to leave it normal and use time based movement. Don''t worry about it, except if you don''t want to use time based(which is not to complicated) it''s better to leave the FPS as is.

Share this post


Link to post

  • 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!