Simple Vehicle Physics


Adds simple drift physics to vehicles.

Tweaks
1 year, 8 months ago
1.1 - 2.0
4.86K
Transportation

i Car should slow down during a drift

2 months ago
(updated 2 months ago)

I'm seeing that car looks like accelerating after a hard U-turn drift even when i'm not pressing W. It's noticeable when you put settings to Drift: 30, Handling: 0, then driving a car with nuclear fuel.

Accelerate to full speed then let go of W and suddenly turn 180 degrees.

I guess it works as intended as far as vanilla mechanics is concerned, but physics would cause significant drag to the vehicle and almost act as breaking.

a month ago

There's a reason this mod is called "Simple" Vehicle Physics, it's not actually doing a physics simulation. The main way this mod works is by averaging out the direction and speed of the car over time, so even when you let go of W the car still has a forward speed value and it's still being used. There's no way to detect when the player is holding a button down, and I was trying to make this mod as generic as possible for compatibility reasons (think aircraft).

a month ago

Well, detecting W is not necessary i think. If we attempt simple workarounds then multiplying current vehicle speed by a value between 0..1 should cause it to slow down. How much it slows down depends on how much it is drifting. Say car's angle being 90 degrees against its actual moving direction would cause highest slowdown.. (not sure, some 0.7x?), while moving in aligned direction 0 drift keeps multiplier at 1.0.
I didn't look at code but you probably have values for it already, just to rescale.

I suppose this would also fix the issue of car retaining full speed when turning even if there is no drifting mechanic, if it was an issue. IRL turning would always have a cost to speed anyway, even to trains if ever so slightly.

New response