Introduction to GTA V's handling physics
Thankfully, Grand Theft Auto V features a surprisingly comprehensive and detailed handling
physics system. While the engine simplifies very complex matters into only sets of two or three
variables, it does allow to make vehicles behave in a sufficiently complex manner that can
mimick IRL to a sufficient degree, allowing for concepts like weight transfer,
understeer/oversteer, wheelspin and per-wheel brake luckup to exist within the car's behavior on
the road.
V accomplishes this by implementing systems in an appropiate but simplified manner. For example
gearing actually modulates the car's acceleration depending on the gear, but torque isn't
actually a thing, as its just power scaled up and down by the gears. Wheels actually push (or
pull) the car forward, but the rim size on the model does not affect acceleration or speed given
the same power.
This guide is appropiate for both vanilla, lore-friendly and real vehicles, because the source of
the vehicle model is irrelevant. What's important is the style of handling you want it to have.
Keystones of handling
It is important to understand a few things before embarking on creating/editing handling files to
your liking.
- No section works isolated. Every thing you edit will partially affect other characteristics
of the car. Think of it as each item being a physical characteristic contributing to the
complete physical behavior of the car.
- A good chunk of items do not work the same way their IRL counterparts do, they only
approximate.
Center of Mass
vecCentreOfMassOffset
Starts as the model's center, visible with OpenIV's model viewer. vecCentreOfMassOffset
offsets it around so you can put the CoM wherever you want.
Must-knows
-
Y means ahead/behind, Z means up/down. You don't need to edit X (left/right) most
of the time.
- The car will pivot around the CoM while mid-air, but pivot around fRollCentreHeight while on
the ground.
- The most balanced car will have a CoM sitting exactly between the axles.
-
CoM is directly tied to fRollCentreHeight(Front/Rear) - together they control weight
transfer. Think of it as a line drawn from the CoM Z down to the fRollCentre. The longer it
is, the more weight transfer. Lowering CoM Z or raising fRollcentre reduces weight transfer,
overdo it and the car will never lean.
Where to put it
Usually the CoM can go on the vehicle's center, Y sitting bewteen the axles and Z sitting right
below the engine's height.
Do keep in mind the Center of Mass is a great way to define the vehicle's intrinsic stability, as
you define how
well balanced it is. Think of it as a basic tendency you can put onto the car's chassis.
A vehicle with a raised CoM (Z component) will tend to move around more, specially in landings
and mid-air. Here's how it looks:
You can move the CoM forward or back to destabilize the vehicle in a different way, a bit more
complex than high-low. Front or Rear biased vehicles can react to this fact in a multitude of
ways, in general being more or less prone to understeer or oversteer. A bias front or back bias
can also enhance turn-in ability, and take-off and landing behavior.
Moment of Inertia
vecInertiaMultiplier
To be written.
Grip & Traction
fTractionCurveMax, fTractionCurveMin, fTractionCurveLateral,
fTractionLossMult
One of the most important aspects of Handling, grip defines how quickly the wheels can make the
car accelerate, decelerate, or change direction.
Must-knows
- Grip is measured in G-Forces, remember 1G is 9.8m/s of acceleration.
- The car will pivot around the CoM while mid-air, but pivot around fRollCentreHeight while on
the ground.
Interestingly, Grip is measured in G-Forces, which translate to how fast the wheels can
accelerate-decelerate the car before starting to skid. This ties in directly with braking and
torque, which also are measured in G-Forces. If there's not enough grip to accomodate torque or
braking, the wheels are overwhelmed and will lose traction.
- fTractionCurveMax: Defines the base maximum ammount of Gs the vehicle is able to work with.
- fTractionCurveMin: Defines the base minimum ammount of Gs the vehicle has when skidding or
losing traction.
- fTractionCurveLateral: In degrees, acts as the tire slip angle. The tires will get the best
grip at the top half of this value
- fTractionLossMult: Defines how griploss scales on troublesome surfaces like grass, dirt or
snow. Check materials.meta to know how much grip each surface detracts.
Bodyroll & Suspension Pressure effects on Grip
Surprisingly, V simulates grip gains (and loses) from suspension pressure. This means that on
whichever tires the car is leaning to, get a significant ammount of traction, while tires on the
other side lose traction.
This is best seen on FWD vehicles, which have a real hard time getting traction on launch. If you
reduce bodyroll or move the center of gravity forward, the issue is greatly reduced.
Surfaces and fTractionLossMult
Only roads make the most of the vehicles' grip, and other surfaces like grass, dirt,plastic,
concrete
and snow reduce the overall grip. fTractionLossMult scales how important the effect is.
Braking
fBrakeForce, fBrakeBiasFront, fHandBrakeForce
Must-knows
- fBrakeForce applies per wheel. So don't put it equal to fTractionCurveMax, use about a 1/4 of it. Or 1/X where X is the nÂș of wheels on your thing.
- fBrakeBiasFront at 0.5 delivers the same brake pressureto all axles. 1.0 only delivers to the front axles, 0.0 only delivers to the rear.
- A well balanced fBrakeBiasFront allows full control of the car under heavy braking, this balance usually is between 0.55 and 0.7. You can produce oversteer by using a lower value, and understeer if using a higher value.
Aero
fInitialDragCoeff, fDownforceModifier
Air Drag
Air Drag is presented as a force that acts against the car's velocity, and tries to slow it down.
In V, air drag scales with the square of speed, but fInitialDragCoeff modifies the scaling so air
drag actually scales the way you need it to.
Air Drag can be measured in Gs, which presents how fast you are decelerated at certain speed.
Due to V's vehicle engines outputting "torque" in Gs, both values can be compared easily, which
gives
us more information about the vehicles' performance.
For example, as both the Gs from torque and the Gs from air drag even out, the vehicle stops
accelerating - at that speed, the vehicle can't push through the air anymore. You got your real
top
speed.
Downforce
This is one of the most arcade systems in V. Downforce translates directly to grip gain on the
wheel,
and can abide to wildly different rulesets depending on your needs.
The base math goes as follows:
Base
fDownforceModifier set to 1 or less
- 0.035Gs, double (0.07Gs) if a Spoiler is installed.
Dynamic
fDownforceModifier between 1.01 and 99.99
- 0Gs as the car is stopped, which ramps up to 0.035Gs as the car reaches its top speed.
Double
that if a Spoiler is installed.
- The value is multiplied by fDownforceModifier, so a modifier of x10 would net you 0.35Gs
gain
per wheel, double that with a Spoiler.
Active Spoilers
Vehicles with active Spoilers ignore fDownforceModifier entirely.
There are two types of
active spoilers in V:
Raising type (Like the T20):
- No gain when the spoiler is down. As the spoiler raises, you get 0.035Gs. When braking,
the
spoiler pitches, and you get 0.07Gs.
Dynamic type (Like the X8 Proto):
- 0.035Gs when the spoiler is down. Over certain speed (60mph or so)it raises up to
0.042Gs.
- When cornering or braking, it gets to 0.07Gs.
Power
fInitialDriveForce, nInitialDriveGears,
fInitialDriveMaxFlatVel,fClutchChangeRateScaleX
The base power is just a base value on top of which everything else works. Then, gearing
modulates that power simply multiplying it up and down (the ratio), which results in the torque
(also measured in Gs) sent to the wheels.
While the first and last gear's ratios are always the same (3.33 and 0.9) the gears in between
have different ratios depending on how many gears the engine has at its disposal. The more gears
it has, the smoother the torque drops from gear to gear - very few gears will result in an
incredibly high torque drop on the next gear.
Keep in mind the ratios always have to go from 3.33 to 0.9, so the more steps you give them, the
smaller the jump between each gear.
Those gears stretch over the engine's top speed, naturally.
Lastly, while the car is busy switching gears, you have no power. How quick this happens is
defined by fClutchChangeRateScaleX.
Suspension & Bodyroll
fSuspensionX, fAntiRollBarX
To be written.
Deformation
damageMapScale, damageOffsetScale, fDeformationDamageMult
There are three main players on deformation.
In vehicles.meta:
damageMapScale: How precise the deformation is. Higher - smaller dent radius.
damageOffsetScale: How deep the deformation is. Higher - deeper deformation dents.
In Handling.meta
fDeformationDamageMult: Scales how much speed affects deformation damage. Higher - higher
deformation damage at the same speed.
My Philosophy
Fun
If you're not just following IRL stats, specs and quirks (which are fun on their own right if
you achieve them)...
To me, a fun handling is a reactive handling. A fun vehicle reacts to the driver and the
terrain. This means vehicles should never fully ignore bumps, slides, jumps, overall rough
driving. Half
the fun in driving is wrestling with the car when pushing it to its limit, or even past it.
Center of Mass
Often times, you only need to take care so it sits between the front and rear axles, so the
suspension doesn't lean back or ahead. Then adjust rollcentres until you get the desired base
bodyroll.
I personally prefer to get it somewhat right and move it up as much as it makes sense for the
car. This is a bit harder, but pays off when the car ends up tumbling around (This is GTA) and
actually rolls downhill properly. Helps with the personality too.
Stability
As hard to work with as it is, vecInertiaMultiplier is very important to make cars heavier or
nimbler, and is responsible for the overall stability of the car. Do try to get it right.
Grip
Grip numbers are a good base, but vehicle stability is absolutely key to be able to make the
vehicle be able to use that grip. Just adjusting bodyroll, suspension strength and rebound you
can completely change
how much grip the car can actually use.
Downforce
Downforce is mandatory on almost every vehicle, doesn't matter the type or shape. I would only
avoid downforce in things like a semi
This is because, even at very low levels, downforce can be used
Dynamic Downforce (>1.0) is great to make cars specialize on high speed cornering.
Traction loss is more complex than numbers. You can make cars horrible offroading just by making
the suspension stiff or have little travel. fTractionLossMult is not that important.