Jump to content
  • Advertisement

Archived

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

MOVSW

Game timer frequency?

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

What''s the optimal game timer frequency? I know it depends on a game. For example a complex game like Tribes 2 or Half Life?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
as fast as you can get it.

Share this post


Link to post
Share on other sites
I'm talking about game logic timer. That is used for time-based movement quantities like velocity and animation. You need to have some kind of a logic timer if you want accurate velocities for moving objects. Some sample code what I'm talking about.

double logicTimerFrequency=37; // 37 milliseconds
double objVelocity=20; // 20 units/sec
double preTickVelocity=objVelocity/1000*logicTimerFrequency;

// loop
object.x+=objVelocity;
...

Or, do modern games use totally different approach that I haven't thought of ?

[edited by - MOVSW on March 25, 2003 12:12:12 AM]

Share this post


Link to post
Share on other sites
I think what most games do is loop through as quickly as possible, each loop making adjustments proportional to the amount of time elapsed since the last loop.

object.x += objVelocity * secondsElapsed;

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!