Sign in to follow this  
mjs2000

Problems with friction/frame rate scaling

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this