Skip to content

race: add new settings to control vehicle physics behavior #655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 12, 2025

Conversation

xLive
Copy link
Member

@xLive xLive commented Jul 30, 2025

This PR adds new settings that can be configured globally by the server or per map to control vehicle physics behavior. By default, they do not change the current behavior unless set in race or map settings. These settings were added to fix issues caused by multitheftauto/mtasa-blue#4243, which broke many custom maps and made them unfinishable. They allow server owners and mappers to bring back the old physics on specific maps by disabling the fix and setting the FPS those maps were designed for, without affecting other maps. The old behavior can also be enabled globally.

New settings:

  • vehicle_physics_mode
    Controls physics behavior. fixed for FPS-independent physics, or legacy to restore the old behavior. Default is fixed.
  • vehicle_physics_fps
    Sets the FPS limit when vehicle_physics_mode is set to legacy. -1 to keep the current limit, or set a specific FPS value. The original FPS limit is restored when the map or race resource stops. Default is -1.
  • vehicle_physics_mode_map_can_override and vehicle_physics_fps_map_can_override
    Allow maps to override the global vehicle_physics_mode and vehicle_physics_fps values. Default is true.

vehicle_physics_mode: "fixed" or "legacy" (restores old physics behavior).

vehicle_physics_fps: sets the FPS limit when using "legacy" mode.
@Dutchman101
Copy link
Member

Dutchman101 commented Aug 7, 2025

This is my proposal for a perfect design:

  • If a racing map has no physics (legacy or fixed) flag in meta.xml / Map settings, default to legacy. So that old maps need no intervention to provide the same experience as which they were designed for.
  • When a racing map starts that has a specific physics flag in meta.xml / Map settings, apply it accordingly.
  • Make sure that if "race" gamemode stops, it restores the glitch state to what it was when "race" loaded, or what it was before the first map that "race" decided a physics setting for (based on the map properties).

So then, racing servers only need to update mtasa-resources when MTA 1.7 releases in the coming few weeks, something that has been stressed with every new release anyways.
@xLive

@xLive
Copy link
Member Author

xLive commented Aug 8, 2025

This is my proposal for a perfect design:

  • If a racing map has no physics (legacy or fixed) flag in meta.xml / Map settings, default to legacy. So that old maps need no intervention to provide the same experience as which they were designed for.

When a racing map hasn’t set the physics mode, it will use whatever the server has set in the race resource settings. By default, it was fixed, but I’ve now changed it to legacy.

  • When a racing map starts that has a specific physics flag in meta.xml / Map settings, apply it accordingly.
  • Make sure that if "race" gamemode stops, it restores the glitch state to what it was when "race" loaded, or what it was before the first map that "race" decided a physics setting for (based on the map properties).

The PR already does both of these. It applies the new settings based on what each map has in its meta settings. If the map hasn’t set anything, it uses the values from the race resource settings. It also restores the glitch state when the race resource stops.

Side note: I suggest we use fixed physics mode for the default race maps to benefit from the physics fix. From quick testing on several maps, it’s very unlikely they will be broken by fixed mode. If that’s okay, I will change them in a future PR.

@Dutchman101
Copy link
Member

Side note: I suggest we use fixed physics mode for the default race maps to benefit from the physics fix. From quick testing on several maps, it’s very unlikely they will be broken by fixed mode. If that’s okay, I will change them in a future PR.

Fine by me, when it comes to "Racing maps becoming unplayable" with the physics fix, it's about more complicated "DM/OS" race maps that involve crazy loops and stunts that are shaped/reclined in a way that it's for a specific timing of moves and physics behavior on approach of the vehicle and its deceleration and yaw. If not for that, it will be for the muscle memory of players that have trained and memorized how to pass these map portions without failure or time loss.

It doesn't apply to classic street racing maps, like the ones in official resources. But if anyone thinks im wrong, please correct me.

And thanks, nice PR, i didnt look at the whole thing before my previous comment. Seems you've got it all covered!

@Dutchman101 Dutchman101 self-requested a review August 12, 2025 20:19
@Dutchman101 Dutchman101 merged commit 2b051f1 into multitheftauto:master Aug 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants