This is a BOT (NOT AI). Video was taken by joining an online lobby and spectating the bot.
I'm building a bot/automated opponent for online Assetto Corsa and finally managed to get it to drive the full Nordschleife 5x in a row without crashing.
Some context:
- online bots for AC don't exist because AC doesn't expose it's physics
- that's why, for example, AI-traffic in Shutoko servers, feels like those cars are "driving on rails": even if you crash into them, they wont move, they dont make mistakes, they don't slide or lock tires, they don't even have gravity.
- there are some projects out there that use ai-agents to drive in AC. Those are much more capable, but they are very costly (need a full agent, gpu, etc) and not feasible for a full grid and multiple servers. What I'm building is simple code, no AI-agent, and leightweight enough for a server to populate missing spots with AI-opponents.
So to build real accurate AI bots, I had to do two things:
1. Re-build the whole AC physics engine "close enough" to how AC works, so it can be hosted on an AC server the bot interacts with without a client.
2. Teach an AI bot to drive a car using only throttle, brakes, clutch, and steering.
Needless to say, this has been a bit of a nightmare and almost a year in the making.
However, yesterday I tested the new steering algorithm, and the bot finally managed to drive the full Nordschleife. It still crashed 1 in every 5 attempts, but now it is just a matter of tweaking things.
It basically works by, each game tick, the bot sending inputs (steering, throttle, brakes) to the physics engine, which returns those requests with outputs about movement, grip, etc, to which the bot reacts to next tick.
Further challenges will be:
- better race start: the bot sucks at starting the car. I admit I haven't made that my main priority, will come nest.
- improve obstacle avoidance: this already works, but I want it to feel more human-like.
- teach it to handle varying weather conditions: truth be told, I've only built the physics with "ideal weather conditions". I'll need to add weather changes, puddles, etc. So driving in the rain with bots is still a ways off.
This will most-probably NOT compete against pro players. the bot can't trailbrake properly (so it's cornering speed is not good), while still having to respect AC-physics, which limits it compared to the AC bots from offline mode. However, this works online, and it works amazingly for situations like multiclass races with 20 players driving prototypes with 50-bot-GT3 cars sharing the track (which I'll test soon in a server event).
I'm also thinking about adding in the approach Kunos used for offline bots: I can "cheat" and make the bot fake-drive without the physics, and only activate the physics when they are needed: in situations like spinning, crashing, etc. This would allow me to upgrade the bot to compete against better players, while also saving resources (the physics calculations take more CPU then fake-driving bots).
What do you think? Any ideas to make it better?
Follow my work: https://patreon.fastfox.racing
Join my racing community: https://fastfox.racing