GT2 Braking System

  • Thread starter Thread starter grandtour99
  • 0 comments
  • 108 views
Messages
10
United States
East Coast
In modern, the same car in the same corner just held its line. Same car, same track, same inputs. So I recorded the same turn in both (300ZX GT at Laguna Seca, braking from about 220 km/h into the corner) and went through the numbers tick by tick.

Turns out it wasn't the weight shift at all. It was the ABS.

Put simply

GT2's brakes are way stronger than the tires. Every car's brake torque is about 2 to 3 times what the tires can actually use. The 300ZX's front brakes are 10.4 kN.m per wheel. So any time you're on the brake, you're in ABS. ABS in GT2 is always on, for every car. There's no on/off switch anywhere in the code.
GT2 only checks the ABS 30 times a second. That's once per physics tick, and that's the PS1's budget. A front wheel can go from rolling to locked in less than one tick. So the ABS sees a locked wheel, lets go completely, the wheel spins back up past the car's speed, the ABS grabs again... and it cycles like that 10 to 15 times a second.
That stutter hits the outside front tire the hardest. When you brake into a turn, the weight moves onto the outside front, and that's the wheel where the loop gets the worst. In my recording that wheel braked at about half its grip. 1 tick in 5 it let go completely, and another 1 in 5 it was actually pushing the car forward.
So the rear does half the braking. A tire that's busy braking has less grip left for cornering. The rears let go and the tail comes around. That's the GT2 trail-brake swing everyone knows. It comes from the ABS stuttering at 30Hz.
At 120Hz the stutter goes away.
Modern's ABS is smooth, so the outside front brakes at its full grip. And hard braking on the outside front pulls the nose out of the turn, which is basically what a stability control system does. Car stays straight.
How GT2 classic actually calculates it

The PS1 has no floating point unit, so everything in GT2's physics is whole numbers. Most values are "Q12" fixed point: 4096 means 1.0. Some of the tricks they used to make it fit:

The tick isn't exactly 1/30 s. It's 2184/65536 s (about 0.0333 s), a power-of-two denominator so it can be done with a bit shift instead of a divide.
Brake pedal: car+0x63E, 0 to 4096. On a button it ramps 1365 per tick, so full brake takes 3 ticks (0.1 s) each way. The ramp tables are rebuilt at race start (8003BA10). On analog it's x = 7x/8 + 512, so the lightest stick press is already 12.5% brake.
Every wheel gets the same pedal. 8003E070 copies the brake value to all four wheels (wheel+0x60).
Front/rear brake split comes from car+0x440 / +0x444.
The ABS is 8003DB94, once per tick, every car:
g = (wheel+0x2A * car+0x450[axle]) >> 12 // ABS gain
cap = (wheel+0x34 * car+0x458[axle]) >> 12 // grip x radius / brake torque
k = clamp((cap * (4096 - (((slip - target) * g) >> 12))) >> 12, 0, 4096)
wheel+0x60 = (k * wheel+0x60) >> 12 // or 1 if that comes out 0

So, brake on this wheel = pedal x (what the tire can take / brake torque) x (1 - gain x (slip past the peak)). The pedal neve rtries to take more torque than the tire can pass. The more the wheel slips past its peak, the more it lets go.

"or 1 if that comes out 0" means it never quite reaches zero, it just goes to 1/4096, which is practically nothing.

Grip (wheel+0x34) is stored in quarter-newtons so it fits the integer math.

The "Brake Balance Controller" doesn't balance the brakes.
This was fun: spec+0x2E / +0x2F, the brake controller part in the setup, gets read in exactly one place, and that's here, as the ABS gain per axle (car+0x450 / +0x454).

Steps 1 to 24, values 10 to 240, default 120.

So that setting is really "ABS strength front/rear".

The change the ABS causes in one tick scales with gain x grip x radius² x tick / (wheel inertia x speed).

When that number gets above about 3, a once-a-tick loop can't settle. It overshoots every tick. The front wheels of an FR car aren't connected to the engine and drivetrain, so they spin up and down the fastest and hit it first.

None of this is a bug in the sense of "they messed up". It's what you get when you run a brake loop at 30Hz in whole numbers on 1999 hardware and it gives you that drift vibe popular around that time.

What I did in modern

I want something more realistic:

Every car gets real-size brakes. Each car's brakes are now just strong enough to reach the tire limit in a hard stop from 200 km/h instead of 2 to 3 times past it. GT2's front/rear split is kept.
The ABS can only let off. It can reduce braking, never add to it.
Stopping distances didn't change. Across all 1,233 car and tire combos I checked (with a script), 100 to 0 km/h is within 0.3%.

On the same corner, heading after 1 second of braking:

Classic: 40.1°
Modern before: 28.9°
Modern, button (full brake): 30.2°
Modern, analog at 70%: 33.8°
Modern, analog at 40%: 36.3°, with almost the same body slip as classic (18.6° vs 19.6°), and carrying more speed.

On a button you get full ABS braking and the car mostly holds its line. That's realistic.. stomp the brake mid-corner in a real car with ABS and it pushes straight.

On the analog stick (the right stick set to throttle and brake), light trail braking brings the rotation back.

So in classic, the swing comes for free because of how the game runs. In modern, it's something you do: trail brake with the analog stick, and tune it. Next thing I'm testing is whether turning down the rear ABS strength in the setup lets you dial in more rotation.

I can go a bit deeper when I actually drive cars.

Here's a comparison video of the stick vs button throttle and brake on the GT2 classic physics and the remastered physics. In the bottom left, you'll see a debug overlay I added so you can see relevant inputs.

https://youtu.be/Uo6AS1dRzVA?si=QDSAxU4JvpX2JNAL
 
Back