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.Boiled all the way down, the model is two lines:
slip = (wheelSpeed - groundSpeed) / max(abs(groundSpeed), vmin) F = μ(slip) · loadThe first line is the slip: how fast the contact patch is sliding, with that max flooring the denominator at low speed so it cannot blow up (more on that shortly). The second line is the force: a friction coefficient that is itself a function of slip, scaled by the load pressing the tyre onto the road. Everything else in the model is the shape of that μ(slip) curve, and how the forward and sideways forces share a single tyre's worth of grip.
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.Put together, each wheel runs the same short pipeline on every physics step:
slip (longitudinal + lateral)
│
▼
grip curve: rise -> peak -> slide
│
▼
longitudinal force + lateral force
│
▼
clamp to the friction ellipse
│
▼
apply force to the car body
This runs four times on every physics step, once per wheel, right next to the softbody solver that is already eating most of the frame, and the whole loop has to close at a fixed 100 Hz. That budget is the design constraint, not a footnote. It ruled out the heavier options, a full Pacejka fit with its coefficient set, per-tyre state carried between frames, an iterative combined-slip solve, and pushed the model toward a handful of scalar operations that still capture the feel. Almost every simplification in this article traces back to it.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 independently and then clamped together so their combined magnitude satisfies a single inequality:(Fx / Fx_max)² + (Fy / Fy_max)² ≤ 1Fx_max and Fy_max are the forward and sideways grip budgets, deliberately asymmetric since a tyre has a little more to give forward than sideways. If a combined maneuver would break that inequality, both forces are scaled down together until it holds again. 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 100 Hz, where an explicit step would overshoot and buzz. The reward is a car that launches cleanly and sits still when it should, which sounds trivial and is anything but.The hard part was tuning
The implementation, in the end, was not the hard part. The tuning was. The entire character of a car lives in a couple of numbers: where the grip peak sits, and how steeply grip falls away past it. Make the falloff too sharp and the car snaps into a slide the instant the peak is crossed, which feels like driving on ice. Too gentle and it never really lets go, which feels like driving on rails. The target is the narrow band in between, where the back of the car eases out progressively and a drift becomes something you hold on the throttle rather than something that happens to you. Finding that band, and holding it across different cars and surfaces, took far longer than writing the code that uses it.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.