Jump to content
  • Advertisement
Sign in to follow this  
BanEvadingGordon

physics goes mad at low timestep?

This topic is 3619 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 have some physics going based on damped springs, it works fine at frame rates between say 20 fps and 60fps - but when my framerates get over a 100, then strange things start to happen. I was wondering if anybody has seen this before and what might be a likely cause. cheers. merry xmas.

Share this post


Link to post
Share on other sites
Advertisement
Hard to tell without further information.

Maybe your datatypes are not precise enough or your epsilon is too big...

However, if you want consistent results from your physics engine, you will need to use a fixed timestep anyways. So just fix it at the value that works best.

Share this post


Link to post
Share on other sites
Use a fixed time step of, say, 1/60 s. If your render fps go above 60 call the physics several times each frame. So, for instance, if your render fps is 120 call the physics twice. That should give you better results. Some physics libraries, for instance PhysX, will even handle this for you automatically.

Edit: That didn't make sense... If your timestep is 1/60 and your fps is 120 you want to call the physics every second frame. If your fps is below 60 you call the physics more than once per frame. The basic idea is to keep the time between physics updates constant.

Share this post


Link to post
Share on other sites
Sounds weird, I've never had my damped spring sims go haywire by *increasing* the framerate. Maybe the trouble is that your pc isn't physically able to go higher than - say - 60 fps, even though you want it to go higher?

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!