Tyre physics on a budget: a Pacejka-inspired grip model
Grip, slip, and the moment traction lets go. All of it comes from the contact patch.
You feel a car through its tyres. The grip as you turn in, the moment the rear steps out, the way a drift holds on a knife edge of throttle. A deformable body and detaching parts make a crash look right, but the tyres are what make the car feel like a car every second before the crash. This article is about the tyre model, and about doing it on a strict real-time budget.Everything passes through the contact patch
Almost every force a car produces, acceleration, braking, cornering, reaches the road through four contact patches, each about the size of a hand. Get the tyres right and the whole vehicle comes alive. Get them wrong and no amount of suspension detail will save the feel. So the tyre is the single most important model in the car, and also the one that runs most often: four wheels, every physics step, on top of a full deformable body that is already spending most of the frame budget.The Magic Formula, and why not all of it
The reference model for tyres is Pacejka's Magic Formula, an empirical curve that engineers fit to measured data to describe how much force a tyre makes as a function of how much it is slipping. It is accurate and widely used, and in its full form it carries a long list of coefficients and a genuine coupling between the forward and sideways directions. That completeness is exactly what a real-time game cannot always afford, especially when the tyre has to share the frame with everything else. So the model here is Pacejka-inspired rather than a full implementation: it keeps the shape of the physics and drops the parts that cost the most for the least perceived difference.A curve you can afford
Strip the tyre curve down to its essence and it is a simple story. As slip increases from zero, grip rises quickly and roughly linearly, the tyre biting into the road. It reaches a peak, the most grip the tyre will ever give. Push past that peak and grip falls away smoothly toward a lower sliding value, the tyre now scrubbing rather than gripping. That whole shape is captured by a handful of parameters: where the peak sits, how much grip it gives, how much is left when fully sliding, and how sharply it falls off. Evaluating it is a few scalar operations per wheel, which is the entire point. It gives the characteristic feel, the progressive edge of grip and the slide past it, without lookup tables or stiff differential equations.Two directions, one shape
The same curve shape does double duty. Along the wheel it governs traction and braking, driven by how fast the tyre is spinning relative to the ground. Across the wheel it governs cornering, driven by how far the tyre is sliding sideways relative to where it points. Drive too hard and you spin the wheel and light up the tyre. Turn too hard and you slide wide. Same physics, two axes.The friction ellipse
A tyre has a finite grip budget, and it has to share that budget between turning and accelerating. You cannot brake at full strength and also corner at full strength, which is why threshold braking and trail braking are skills. To capture this, the forward and sideways forces are computed and then clamped together so their combined magnitude stays inside a friction ellipse. The ellipse is deliberately asymmetric, since a tyre generally has a little more to give forward than sideways. This clamp is a cheap stand-in for the true combined-slip coupling of the full Magic Formula, and it is what makes power slides, trail braking, and the recovery from a slide behave the way a driver expects.The one-frame spike
The nastiest bug in a tyre model hides at low speed. Slip is naturally expressed as a ratio, and as the car crawls toward a standstill the denominator of that ratio heads toward zero, so the slip value and the force it implies can explode for a single frame. The visible symptom is a car that twitches or shudders as it pulls away or comes to rest. The fix has two parts. Below the grip peak the tyre is treated as static friction with a hard cap, so it holds rather than overreacting. And the update is integrated with a semi-implicit, spring-like step that stays stable at sixty steps a second, instead of an explicit step that happily overshoots. The reward is a car that launches cleanly and sits still when it should, which sounds trivial and is anything but.What I left out, on purpose
A production tyre model can keep going for a long time: camber thrust, temperature building and fading across a stint, load sensitivity as weight transfers, the tyre carcass itself deforming. Every one of those adds realism, and every one of those costs budget and, more expensively, tuning time. The goal of this project is a car that feels believable and reacts honestly to how you drive it, not a certification tool for a tyre manufacturer. So each of those was a conscious decision to leave out, at least for now, and knowing what to leave out is as much of the engineering as knowing what to put in.Grip, permanent deformation, and detaching parts: put those three together and the car finally feels alive. It drives like it has weight, it crashes like it has structure, and it comes apart like it is made of pieces. That was the whole goal of the project, and it is where this short series ends.