Skip to content

fix(gta-core-five): decouple wheel integration from frame rate - #4398

Open
DaniGP17 wants to merge 1 commit into
citizenfx:masterfrom
DaniGP17:fix/wheel-integration-fixed-step
Open

DaniGP17 wants to merge 1 commit into
citizenfx:masterfrom
DaniGP17:fix/wheel-integration-fixed-step

Conversation

@DaniGP17

Copy link
Copy Markdown
Contributor

Goal of this PR

Make vehicles drive the same no matter the framerate. On high FPS cars accelerate harder and reach a higher top speed than on low FPS ones, this fixes it so everyone gets the same speed.

New take on #4059, which got reverted because of the skid sounds and tilting vehicles.

How is this PR achieving the goal

The wheel integrator ran once per frame using the frame time as its step, and the result changes with the step size. With this the integrator always runs with a fixed 1/60 step, and on the frames in between I reuse the last wheel acceleration while still running the post-process (slip, wheel flags, applying the force) every frame with the real timestep. #4059 skipped the whole function instead, so those frames had no gravity and stale wheel data.

Convar enabled by default: game_enableFrameRateIndependentWheelPhysics

This PR applies to the following area(s)

FiveM

Successfully tested on

Game builds: 3889
Platforms: Windows, Linux

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant