The AI

Bad Physics = Bad AI

As I stated on the Home page, I believe the attempt to model real-world automobile suspensions does not work very well in AC. In my testing and development I discovered that the difference between a working suspension and a disaster can be as little as 0.001.

As a programmer it is clear to me that the AC physics engine and AI code would have limits. Exceed those internal limits and chaos happens. Stay within the limits and all will be well.

In looking through the data files I found quite a mess. The mod car files were generally the worst but even the original Kunos have problems. Typos and configuration errors abound.

The oldest saying in programming is “Garbage in, garbage out”. Unfortunately many of the AC cars data files are garbage. Despite that the AC physics engine and AI code do their best to make this mess work.

I do not mean to piss all over Kunos and all the many mod authors but the AC code is very precise. There are many parameters that have a tolerance of 0.001 or less.

Early on when I was still hand editing the data files, I made a typo. An extra 0 on one parameter. Now as a human driver the car felt a little odd but I easily adapted and was not having trouble getting around the track. However the results on the AI were hilarious. As the AI came to a corner and tried to brake, the front of the cars dipped and the cars would roll end over end.

It took me quite a while to track the typo. One parameter that should have been 0.001 instead of 0.0001. That was all it took to completely mess up the physics and the AI.

For those who are interested I will release some test cars where I change one parameter, out of the hundreds of parameters, by 0.001 and you will see and feel the difference. The “bad” test car will drive like a carnival bumper car.

The configuration errors also cause issues. Trying to map real-world suspensions onto the AC physics leads to configurations that just can not work.

The AI drivers became my best test drivers. The AI are Goldilocks drivers. Everyting has to be just right, not too much or too little. Get everything right and the AI will drive circles around you. Get one parameter wrong by 0.001 and the AI will not be able to get out of the pits.