How do truck transmission work?
-
For a while I've had trouble dealing with messing with the transmission code stuff for trucks. The weird behavior can be seen when in the first gear, the truck keeps holding its RPM at the maximum value while still accelerating. The first gear also attempts to shift up only once. Pinning the gears just makes it stay in first gear, but due to the lack of the "let me shift up" thing, it keeps on trucking and accelerates way up to top speed, all in first gear.
For a while I've had a list in my manual transmission code (just checking for name), but that won't work for add-on models which use different model names. Some way of detecting if something is a truck or not would be nice.
So, for the data. The left column is the expected max speed for that gear. I calculate this by
DriveMaxFlatVel / ratio[gear]
. The right column is the actual values where the game decides it's a good time to shift up.Here's a normal car (Futo) with expected redline (speeds where RPM == 1.0). The upshift speeds match the expected values nicely.
Here's the truck, a Hauler with Killatomate's Realistic Driving V, v2.3. You can see the first gear being way much more than the gear should be able to hold. Strangely, when doing a burnout, the wheels only spin up to 11.5 m/s too. As far as I know, there's not much in the handling.meta or vehicles.meta that indicates it should work like this.
And finally, the Hauler Custom. It seems to use the normal vehicle transmission code, as it properly limits speed in first gear. However, on inspecting vehicles.meta, it has this flag:
FLAG_DONT_HOLD_LOW_GEARS_WHEN_ENGINE_UNDER_LOAD
, which probably causes the new behavior.
So, anybody have an idea on what's going on and how I can cleanly/properly detect this? The normal Hauler's flags seem inconclusive. The
FLAG_BIG
is used for the ambulance, camper, riot, etc too and those aren't revving like this.
-
Another flag to consider is AIHandling in the vehicles.meta. Trucks have it set to TRUCK. Once I changed it to AVERAGE, the engine doesn't cut anymore around 50 to 55 Mph with a driving task. While you're at it, change CRAP to AVERAGE as well.
Sorry I can't help you more with this.