Jump to content
  • Advertisement
Sign in to follow this  
Lord Caius

Time and C++

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

I'm writing a DirectX program and need to find a way to keep the frames the same length - to avoid the jumpiness and so on. What are some time-related functions that could be of use to me?

Share this post


Link to post
Share on other sites
Advertisement
You don't want to fix the framerate, just calculate your changes dependent on the frame time.

Share this post


Link to post
Share on other sites
Quote:
Original post by noVum
You don't want to fix the framerate, just calculate your changes dependent on the frame time.


Often you do want to fix the framerate, You'll hear console games often refer to a "solid 30 frames a second" or 60 frames a second.

YOu never hear them say, "well we just let the framerate depend on the frametime, sometimes its 2 frames a second , sometimes its 60, but ho one really cares if the game runs at 2 frames a second:)"

Cheers
Chris

Share this post


Link to post
Share on other sites
Why should they fix the framerate? Either you have the power for >30FPS or you don't. Fixing it to 30FPS will only have drawbacks.

I've never seen a PC game that does it, I would be very astonished if console games would be different.

Share this post


Link to post
Share on other sites
Quote:
Original post by chollida1
Often you do want to fix the framerate, You'll hear console games often refer to a "solid 30 frames a second" or 60 frames a second.

YOu never hear them say, "well we just let the framerate depend on the frametime, sometimes its 2 frames a second , sometimes its 60, but ho one really cares if the game runs at 2 frames a second:)"

Cheers
Chris


Yeah, because "fixing the framerate" will make a game that runs at 2fps magically run at 30fps.
You (usually) let your system do everything you need as fast as possible, and do all the movment, physics, etc. calculations time-since-last-frame based.

Share this post


Link to post
Share on other sites
Quote:
Original post by noVum
Why should they fix the framerate? Either you have the power for >30FPS or you don't. Fixing it to 30FPS will only have drawbacks.

I've never seen a PC game that does it, I would be very astonished if console games would be different.


Doom3 limits your framerate at 60. If your frame difference is very small it can cause problems with physics code IIRC. And to chollida1: You cant just limit the rendering to 30fps and then have any code that would usually run at 2fps to magically run 15 times faster;)

Ive read some articles that make a point for keep the physics steps the same (e.g. every 20ms) as apparently this makes using some syswtems more accurate but im not to clue'd up on physics to be able to comment more.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
With round-off error, having consistant timesteps for physics code is a GREAT help when it comes to making fully deterministic game engines.

That being said, you shouldn't fix the framerate. It's better to draw as often as possible and interpolate the positions as nessesary. ( And with usual physics timesteps [100ms or lower], straight linear interpolation is fast and looks fine. )

Share this post


Link to post
Share on other sites
Quote:
Original post by noVum
Why should they fix the framerate? Either you have the power for >30FPS or you don't. Fixing it to 30FPS will only have drawbacks.

I've never seen a PC game that does it, I would be very astonished if console games would be different.


Almost all console games now limit the framerate. You can say they don't but it won't make it anymore true:) As for PC games, as mentioned above Doom3 does it and the guys at ID know a little about PC games:)

If they can't get 60 frames they cap at 30 usally so the frame rate doesn't vary.

Cheers
Chris

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!