Jump to content
  • Advertisement
Sign in to follow this  
Ozwald

Standardizing program speed

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

If my title is confusing, I'll try to explain it. Basically, I have a p3 in my laptop and an atholon in my PC. I'm writing a program on my laptop, but when i try it on my PC, it goes about 3x faster. How abouts would I make some type of delay that would adjust to the computer? if you want to take a look at the program, you are more than welcome to; it's located at this link: http://www.atosoftpp.digitalblackie.com/uploads/Hard%20Nova%20remake.rar Feel free to poke around on it. Ozwald~

Share this post


Link to post
Share on other sites
Advertisement
The easiest thing to do is to base the movement speed of everything on the so called delta time.

Delta time is the time it took to render the last frame and it should be good enough for most things.

If you are using nehes basecode then the deltatime should be fed directly to the update function, it's in miliseconds so you have to divide it by 1000 to get a better value to work with.
then just multiply every movement with this value like this.
x=x+(xmovement*deltatime);

there are other ways to do this, i have four diferent methods implemented in my engine and i bet that there are sill more than that.

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!