TMNF-C: TrackMania’s New Life Is Fast, Clever and Slightly Bonkers

An old favourite is becoming an AI test track, and one of its experimental drivers takes inspiration from a fruit fly.

Blue-and-white racing car on a Stadium circuit transitioning into cyan wireframe, beneath a glowing fruit-fly neural overlay.
An old favourite becomes an AI test track, with one experimental driver inspired by fruit-fly neural circuitry.

There is a particular kind of optimism involved in racing games. You miss the corner, ruin the landing and immediately decide that the next attempt will be the one. TrackMania Nations Forever, Nadeo’s free 2008 racer, supplied an excellent setting for this ritual: fast cars, increasingly demanding tracks and a whole Stadium environment in which to discover the limits of your talent.

Now TMNF-C, a project published on GitHub by adonis-singh, is approaching that challenge differently. It is a TrackMania Forever simulator written in C for training artificial intelligence. Less glossy remaster, more experimental garage. And the work going on inside is rather more interesting than a fresh coat of paint.

Same obsession, different driver

TMNF-C runs its physics at the original game’s 100 Hz rate: 100 updates per simulated second. The developer reports testing across 212 Nations and United campaign tracks, covering all seven vehicle environments. It supports both CPU processing and NVIDIA’s CUDA technology.

The idea behind its reinforcement learning is straightforward: let an automated driver attempt the course, reward useful progress and keep practising. It is essentially the bargain a human player makes with the Restart button, minus the swearing and the eventual need to go to bed.

There is a proper training workflow behind that premise. Runs can be saved, evaluated and resumed, with tools for checking reproducibility. Crucially, the documentation distinguishes between finishing a course inside the simulator and proving that the same driving inputs work in the actual game. One does not automatically establish the other.

That distinction matters. A computer becoming brilliant at an inaccurate imitation would be rather like learning to park using a shopping trolley: potentially entertaining, but not quite the qualification advertised.

A gamer promises one last attempt, a robot continues while he sleeps, then boasts about parking a shopping trolley as the gamer points to a racing car.
Humans need sleep. AI needs another 80,000 attempts, and a check that its skills survive outside the simulator.

The stopwatch has something to say

According to the project, five trained driving policies have beaten author-medal targets across four tracks. On B05-Race, the reported result is 25.750 seconds, against a 26.280-second target. On C03-Acrobatic, it is 12.660 seconds, against 13.900. These agents were trained without human demonstrations.

There is an important qualification. Validation involved replaying the agents’ saved control inputs in the original game and checking the resulting times. It did not involve running the trained decision-making system live inside the game. These are also track-specific results, not evidence that one digital racing genius can arrive at any unfamiliar circuit and immediately embarrass everyone. The main medal-beating policies’ weights and raw game captures are not included in the repository. Still, matching the real game’s results is a meaningful step beyond producing an impressive number in a separate simulator.

The testing also ventures into TrackMania’s stranger physics. Documented comparisons include tool-assisted runs featuring noseboost and uberbug manoeuvres, with the simulator matching the captured game states on CPU and CUDA after the stated normalization of certain non-physical memory fields. The developer explicitly limits those findings to the tested runs, rather than claiming every possible glitch has been conquered.

There is something pleasing about that ambition. Reproducing a game’s sensible behaviour is one challenge. Reproducing the occasions when it appears to have swallowed a firework is another.

Then somebody brought a fruit fly

The project’s most unexpected experiment uses mapped fruit-fly neural connections as the basis for a software driving system. Not an actual insect with a miniature steering wheel, and not a claim to have recreated a complete living mind. The learning component models the fly’s mushroom-body circuitry, using a dopamine-inspired reward mechanism to adjust its behaviour. It receives numerical information about the car and the route.

A programmer introduces a digital fruit fly, compares two driving systems, then questions its winning lap photo beside a pile of failed attempts.
A career beyond bananas, a few successful laps, and plenty of footage that won’t make the trailer.

There is also a separate visual and reflex system with a simulated compound-eye view. The distinction is worth keeping: the documentation says this reflex driver avoids walls but does not finish the tested courses. The learning circuit has completed some tracks, but its action selection remains weak, and its saved learned settings rarely finish reliably without continued exploratory choices. The showcase laps are selected successful attempts, not proof of consistently excellent driving.

Frankly, the limitations make it more interesting. This is not a miraculous insect chauffeur. It is an unusual experiment with enough detail exposed to show where the idea works and where it falls apart.

Bring your own game, and some patience

Before anyone clears an evening for a quick download, TMNF-C is firmly in tinkerer territory. The setup involves building software and preparing data from a legitimate TrackMania Forever installation. The repository does not supply the game executable, tracks, textures or captured game memory. United content requires the corresponding United installation.

The complete import process currently relies on a running game through Wine and TMInterface to capture the necessary track, vehicle and route information. Simply pointing it at a folder of game files is not enough. The documentation also acknowledges that the initial capture setup has not been validated end to end on a clean machine. In other words, expect a project, not an installer with a large reassuring Play button.

The original code carries an MIT licence, allowing others to inspect, modify and build upon it under the licence’s terms. That should not be confused with permission to redistribute the separately sourced game data.

A gamer looks for a Play button, struggles through setup with coffee and notes, then watches a digital fruit fly celebrate a completed race.
Game supplied. Coffee consumed. Patience tested. One improbable driver reaches the finish.

What makes TMNF-C appealing is not that it replaces an old favourite. It suggests another way to keep one interesting. Instead of merely sharpening the textures and selling the memories again, it opens up a space for experiments, awkward questions and gloriously improbable drivers. There are worse second careers for a racing game than becoming the place where computers learn to corner and a simulated insect occasionally makes it to the finish.

Source: TMNF-C on GitHub

Leave a Reply

Your email address will not be published. Required fields are marked *