Jump to content
  • Advertisement
Sign in to follow this  
mjs2000

Problems with friction/frame rate scaling

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 trying to implement surface friction in my game. It's sort of working, but the effect is drastically different when run at different frame rates. I'm calculating friction with the equation velocity += -k * velocity (where k is the coefficient and v is the velocity vector), then multiplying velocity by delta-T and adding that vector to the object's position. This works fine at high frame rates, but at low rates (under 30) the object starts drifting on the surface after the movement force has been ceased (instead of promptly stopping). Is there a way around this?

Share this post


Link to post
Share on other sites
Advertisement
Never mind, I think I fixed it. Previously I hadn't bothered to look up realistic friction coefficients, and was using a very low coefficient of friction for normal terrain. I played with the numbers, set k to about 0.55, and now things look OK.

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!