As a big caveat, this app is hard coded to work best with Formula and GT cars (or anything using racing slicks). Some of the work to be done is to somehow graph all the tire compounds in AC and discover the real slip angle curves (slip angle vs lateral force or coefficient of friction).
In terms of the logic I have hard coded values for min_slip (3) and max_slip (10). I have assumed that "optimum slip" is right in the middle of these two values. The colors in the video are as such:
While Braking (brake input > 20%) it shows Tire Slip:
color starts as black and become brighter purple as you approach the braking threshold. If you lock up (or get dangerously close to locking up) it turns red.
slip < min_slip starts as black and becomes whiter the closer the value gets to min_slip
min_slip < slip < optimum_slip starts as medium green and becomes bright green
optimum slip < slip < max_slip starts as bright blue and fades to medium blue
max_slip < slip is bright red
"Graphically" this would look like
0 ------------- 3 | 3 --------------------------- 6.5 | 6.5 --------------------- 10 | 10 +
black to white | med green to bright green | bright blue to med blue | bright red
A tire has maximum grip at the optimum slip angle, which I am assuming is 6.5 for racing tires. If you keep the tires in the bright green while cornering, then you should be getting near maximum grip in the corners while also giving yourself a little lee-way if the slip angle increases.
Any feedback is appreciated, especially suggestions for how to make it better.