Skip to content

Make suspension damping independent of the tick rate - #342

Open
Sycatle wants to merge 1 commit into
StyledStrike:mainfrom
Sycatle:fix/damper-tickrate-independence
Open

Make suspension damping independent of the tick rate#342
Sycatle wants to merge 1 commit into
StyledStrike:mainfrom
Sycatle:fix/damper-tickrate-independence

Conversation

@Sycatle

@Sycatle Sycatle commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Addresses #341.

The change

local damperForce = ( ( state.lastSpringOffset - offset ) / dt ) *
    params.springDamper * DAMPER_REFERENCE_DT

with DAMPER_REFERENCE_DT = 1 / 33.

Dividing by dt turns the position difference into a rate, which is what a damper needs. Multiplying by the reference interval scales the result back so that at 33 tick the force is exactly what it is today, and every existing springDamper keeps its meaning.

What disappears is the dependence: a server at 66 tick now gets the same damping as one at 33, where before it got half.

Choosing the reference

33 is the GMod default and the rate almost every published vehicle was tuned against. Any other choice silently retunes the whole ecosystem, which is the outcome this PR exists to avoid. The constant is named rather than inlined so the decision stays visible — and so it is one edit if you disagree with the value.

How to see it

Drive a vehicle over the same bump at 33 and at 66 tick and compare the rebound. Before this change they differ; after it they should not. That difference is the clearest way to see the defect itself.

Known issues

I have not driven every vehicle class through this, and suspension feel is subjective — if any vehicle feels different at 33 tick after this patch, that is a bug in it and I would want to know.

Touches the same file as #336 and #340, so they will conflict textually if several are taken; they are independent in substance.

lastSpringOffset - offset is a difference of positions between two calls, not a
rate, so the damper force is missing a division by dt. The same suspension is
therefore damped half as much at 66 tick as at 33, with nothing telling whoever
tuned the vehicle.

Dividing by dt and scaling back by a reference interval of 1/33 keeps the force
exactly as it is today at the default tick rate, so every published springDamper
value keeps its meaning, and only the dependence disappears.
@StyledStrike StyledStrike added the enhancement New feature or request label Aug 4, 2026
@StyledStrike

Copy link
Copy Markdown
Owner

Please note that the default tickrate in Gmod is 66.66..., and that's what base vehicles were developed with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants