It took 3 years to build an "unbeatable" racing AI for the wildest driving game in the world

Trackmania AI
(Image credit: Ubisoft/Yosh)

After three years, a Trackmania player's quest to build an "unbeatable" racing AI finally appears to be at an end.

If you're not familiar with Trackmania, it's a pretty wild take on racing games, focused largely on time trials through user-created tracks filled with absurd corners, corkscrews, and other hyper-unrealistic obstacles. I know it primarily for weird custom servers with chill vibes and pirated music playlists, but it's got a robust driving model that makes it a popular competitive pastime, too.

The fact that it's all about time trials and custom tracks also means that Trackmania is a terrific testbed for AI training - at a minimum, it inspired a player who goes by Yosh to start building an AI that could beat his times. He's been running a YouTube channel documenting the AI training process for some time, and three years later he's finally done it. (Thanks, PC Gamer.)

To start, Yosh built a simple track made of simple curves, a bit like a gently sloped waveform. Through numerous iterations, the AI pretty quickly learned how to complete the track with a decent time, but it was still well behind Yosh's own times. "So, like my AI," Yosh explains, "I entered a trial and error loop of guessing what to fix, re-running the training, and waiting to see if it got better. Usually it didn't. This was a painful process."

Eventually, that trial and error process paid off - the AI beat Yosh's time, and kept getting better, shaving more and more fractions of a second off the record. But that was just a simple track, so Yosh built a new training ground in the form of a massive maze without any boundaries. Here, the AI took about 35 hours of training in order to beat Yosh's time - which isn't bad when you consider that it's competing against a human with 17 years of experience.

But there was something missing at this point: the AI hadn't yet been trained to use the brakes. In the spirit of fairness, Yosh hadn't been using brakes either, but after the AI's successes he decided to try something unfair. He set a better time about nine seconds faster by drifting around corners with the brakes - and the AI almost instantly managed to beat that time too, even though it was still suffering from the no-brake handicap.

Yosh did eventually manage to train the AI in the mystic art of braking and drifting, and at this point it's effectively unstoppable - particularly on a track in the style of a massive maze, where the consistency of a machine is best able to push past the small mistakes a human might make on such a long track, but the AI's been able to beat his times on much shorter versions, too.

For me, the interesting part isn't so much that an AI can beat a human's times - like yeah, I expect a computer to be good at playing a computer game - but rather the insight into how machine learning works and the amount of work it takes to train an AI algorithm for a given purpose. Recently we had another excellent example of this kind of thing with the Pokemon Red AI that took 7,000 hours to beat the first gym.

AI-generated content remains controversial - with good reason - but machine learning technology is likely to be with us for a long time to come. These sorts of projects serve as a very interesting way of learning how that tech actually works.

Enjoy your own times in the best racing games before the AI inevitably comes for them. 

Dustin Bailey
Staff Writer

Dustin Bailey joined the GamesRadar team as a Staff Writer in May 2022, and is currently based in Missouri. He's been covering games (with occasional dalliances in the worlds of anime and pro wrestling) since 2015, first as a freelancer, then as a news writer at PCGamesN for nearly five years. His love for games was sparked somewhere between Metal Gear Solid 2 and Knights of the Old Republic, and these days you can usually find him splitting his entertainment time between retro gaming, the latest big action-adventure title, or a long haul in American Truck Simulator.

Read more
Pikachu fainted, looking worn out on the ground in the Pokemon anime.
An AI is trying to 'teach' itself Pokemon Red after its previous versions weren't smart enough to solve it, and it's very slowly working its way through the Kanto gym leaders
Screamer
A 29-year-old PC racing game going cyberpunk anime with Troy Baker, Initial D drifting, and cutscenes from the Metroid: Other M studio sure wasn't on my Game Awards bingo card
Donkey Kong
After 44 years, Donkey Kong player discovers that the legendary kill screen isn't really the end
Jet The Hawk, Shadow The Hedgehog, Sonic The Hedgehog, Knuckles The Echidna, and Tails The Fox race towards us on a variety of vehicles in Sonic Racing CrossWorlds, emerging from ring portals depicting various levels from Sonic history
Sonic driving a car in Sonic Racing: Crossworlds makes perfect sense, and after 30 years I'm sick of explaining why
Balatro cards featuring The Witcher 3 characters
Just like Tetris, someone's found Balatro's "true ending" by chasing a score so high that it actually crashes the game
A factory being built and managed in Satisfactory
Forget AAA: this year, all I wanted to do was optimize my conveyor belts in Satisfactory
Latest in Racing
Mario Kart 8 Deluxe
Nintendo knows you're waiting for Mario Kart 9, but it still wants you to run a million laps in Mario Kart 8 first
Wheel World
The spirit of Burnout Paradise lives on in this fabulous bicycle racing game from the makers of my favorite indie fighting game – a true Steam Next Fest gem
Sonic Racing CrossWorlds
Sonic Racing CrossWorlds announcement trailer proves Sega is coming for Mario Kart 9's throne with transforming cars and a closed beta this month
Need For Speed Unbound
The Need For Speed series is pumping the brakes as "Criterion are joining their colleagues working on Battlefield" instead of tuning more cars
Forza Horizon 5 the real deal reasonably priced car seasonal championship volvo 850 R racing
Forza Horizon 5 is the latest Xbox game to make the leap to PS5, and it's launching this spring with all of the same content and DLC
Tokyo Xtreme Racer
Cult classic racing series returns 18 years after its once-final entry on Xbox 360 to 95% overwhelmingly positive Steam reviews
Latest in News
InZOI screenshot from creation studio demo which depicts a shockingly realistic character model rendered in Unreal Engine 5
The director behind The Sims competitor InZOI spent 20 years making MMOs, but he ditched the massive RPGs after playing life sims with his son
Demon Slayer season 4 episode 2
True to the anime, Stardew Valley's hottest mod adds two romanceable Demon Slayer dudes who are both "rude and standoffish" at first
A group of Men wearing armour during the TV show, Vikings.
Vikings creator is heading back to his Norse roots with this new historical drama on Amazon
Balatro screenshot showing an assortment of joker cards
Balatro creator intentionally avoided roguelikes but did eventually play and "steal from" Slay the Spire anyway: "Holy s***. Now that is a game"
Batman and Catwoman talking
Robert Pattinson is hoping to team up with his The Batman co-star Zoe Kravitz on another project soon
Helldivers 2 screenshot showing a fully geared/armored diver standing with gun in hand as three jets soar the skies behind him
Arrowhead reveals the Helldivers 2 ideas left on its cutting room floor, from 5-player squads to low-gravity planets and a whole new armor system