JustInvoke / Randomation-Vehicle-Physics

Vehicle physics system for the Unity engine.
https://justinvoke.com/game-assets/#randomation-vehicle-physics
864 stars 184 forks source link

Better Behavior of Automatic Gearbox Transmission During Wheel Free Spin #11

Open JustInvoke opened 7 years ago

JustInvoke commented 7 years ago

As it stands, the automatic gearbox transmission doesn't perform optimally when engine torque is increased enough that wheels lose grip and spin freely while accelerating. The transmission will respond to the quickly rotating wheels by upshifting and reducing the torque output to the wheels. However, this also leads it to respond again by downshifting, because now the wheels are not spinning as fast. This creates an infinite cycle of upshifting and downshifting without the vehicle ever being able to gain speed.

There is a way around this with the help of the "feedback RPM bias" variable on the Wheel script, but it feels a bit kludgy. This variable modifies the feedback RPMs sent to the transmission by interpolating them with the velocity of the wheel object, rather than its rotation rate. It creates more stable behavior, but it would be better if the transmission could handle the issue by itself.

(Feedback RPMs are send backwards up the drivetrain from the wheels for the sake of controlling engine and transmission behavior.)