Traction Curve Merge

Along with my changes to the suspension model where to refine the traction model for

The previous model uses a simplifed Pacejka Magic Formula as noted in a previous blog post. That only covers each direction individually, I found a good blog post ( which basically describes the math behind how it all has to work. The summary is that you want each direction to contribute to the maximum slip irrelevent of whether what its maximum slip value is. This can result in a maximum which is actually ellipse shaped. This math mostly goes over my head, but the graphs below should help.

So trying to implement this I found that it was very hard to tell whether or not the combined values where actually combining successfuly - although running the game and seeing the car accelerate in a uncontrolled spin and roll was helpful it didn’t tell me what was going wrong.

In comes the wonderful scatter plot, which I made myself ( which takes in a list of x,y,color and plots it for you. The javascript is available to use if you just copy it from the source.

poorly mapped traction merge

Basically this comes down to how to normalise each of them based on their maximal value. The math goes like this:

float ratiofract = slipratio/maxLong;
float anglefract = slipangle/maxLat;
float p = FastMath.sqrt(ratiofract*ratiofract + anglefract*anglefract);

fz = (ratiofract/p)*formula(p*maxLong) * susForce;
fx = -(anglefract/p)*formula(p*maxLat) * susForce;

So to explain this: *fract lines = fraction comparing the value to the maximal value p = combined total maximal value, if equal to 1 the tyre has no more to give. More and we are more slipping than gripping. f* = calculate the value for the normalised traction value

Which results in a graph like this: correctly mapped traction merge

With this change it feels like a ‘real’ car game, hopefully this helps someone else. My source for this is at: