Trackmania AI and Noseboost
Reinforcement Learning for High-Speed Trackmania Driving
The noseboost: exploiting the game’s physics
In Trackmania, driving on all four wheels is not always the fastest way to move. A technique called a noseboost exploits a glitch in the game’s physics: when the car is driven on its nose in a particular way, the physics can abruptly accelerate it to the game’s maximum speed.
A noseboost is difficult because it requires precise, rapid control. The car’s motion becomes harder to predict as its speed rises, and a mistake can end the attempt. Human players cannot reliably make the necessary real-time adjustments, but an AI can act much more frequently—at about 100 actions per second—so it may be able to control movements that are too fast for a person.
A related, smaller effect is a nosebug. By accelerating, steering, and braking while the car is oriented vertically, a driver can trigger a sharp turn. A single nosebug does not necessarily produce much speed, but chaining several nosebugs can build into a noseboost.
A nosebug is a smaller physics effect that can create a sharp turn; a noseboost is a larger speed gain that can result from chaining the relevant movements.
Learning to drive through reinforcement learning
The AI begins with no knowledge of the game. It learns through reinforcement learning, a process in which an agent takes actions, receives rewards, and gradually develops a strategy that produces higher rewards.
The learning loop is:
The AI observes information about the car.
It selects an action.
The game responds to that action.
The AI receives a reward based on the result.
It uses repeated attempts to improve its future choices.
The AI’s observations include dynamic properties such as the car’s velocity, rotation, and wheel information. These observations shape how it perceives the game and therefore affect which action it selects.
To encourage speed, the initial training setup gives the AI a reward equal to its current speed for each action. Its aim is to choose actions that accumulate as much reward as possible over a run. A specially designed training track includes a jump intended to make the car land on its nose, giving the AI an opportunity to discover the noseboost.
Why an apparently simple objective can produce unexpected behavior
The AI is not directly told, “Perform a noseboost.” It is given a reward objective and must discover whatever behavior best satisfies it. This makes the learning process open-ended, but it also creates a risk: the AI may find an easier way to earn rewards that does not match the intended technique.
On the original training track, the AI found it could cancel the car’s rotation, land on all four wheels, and collect rewards safely. When encouraged to drive on its nose, it found other alternatives, including sliding upside down or again landing on all four wheels. These strategies were effective ways of collecting reward without solving the intended control problem.
This is an example of reward hacking: an agent exploits the reward setup in an unintended way. The behavior may satisfy the objective as written while failing to achieve the designer’s actual goal.
Guiding exploration toward nose-driving
A more guided training attempt starts with a human-driven run. The human drives to a point on the track, and the AI takes over from there. This puts the AI in a position where it is more likely to try nose-driving.
The AI soon discovers a nosebug, showing that it has found a relevant interaction with the game’s physics. However, discovering the effect is not the same as using it effectively. The AI initially prefers safer strategies that earn rewards more reliably.
Constraining the AI’s behavior
To encourage nose-driving, the training setup adds constraints based on the car’s orientation and height:
If the car tilts too far from the desired position, the AI receives no more reward and the run ends.
If the car rises too high, the AI also receives no more reward and the run ends.
These constraints make balancing on the front wheels—and thus driving on the nose—necessary for a successful attempt. Under this setup, the AI eventually achieves an initial, noticeable speed gain from a noseboost. It does not yet reach maximum speed, but it has discovered a promising route to higher rewards.
However, after this initial success, the AI returns to simply balancing on its front wheels. It has found that this safer behavior produces a reliable stream of reward, whereas continuing to attempt a noseboost is risky.
Reward design and risk-taking
The AI’s reluctance to attempt a full noseboost can be understood through the reward structure. At the start of a run, the car already earns moderate rewards by moving at ordinary speeds. A noseboost could produce much larger rewards, but it also makes the car’s behavior less predictable. A single mistake may end the run and stop further reward accumulation.
The AI can therefore learn to favor small, dependable rewards over a potentially much larger but uncertain gain. This is not necessarily a failure of learning; it can be a rational response to how rewards and risks are structured.
The reward scheme is then adjusted so that ordinary, low-speed behavior is less attractive relative to a successful boost. This makes the potential gain from noseboosting much more significant. After this change, the AI becomes more willing to take risks, even when a risky attempt may end the run.
With further training, it performs a complete noseboost and reaches the game’s maximum speed. It then begins to pursue a more difficult objective: not just triggering the boost, but sustaining it for longer.
Reward design influences not only what an agent learns to do, but also how much risk it is willing to take while learning.
From triggering a noseboost to sustaining it
Reaching maximum speed is only the beginning of the control challenge. The AI must stabilize the car at that speed, where small errors can have large consequences. It initially manages to sustain the noseboost for only a short period—at best, around two seconds—which is not enough to complete a full track.
Many further adjustments to rewards, observations, and training parameters do not immediately solve the problem. The continued difficulty suggests that success depends not just on adding more training, but also on whether the learning method itself is effective.
To investigate, training is moved to a more standard track where performance is easier to measure and where there is known room for improvement. Experiments with different learning methods and parameters gradually improve the AI’s general ability to learn the game. Inspiration from another comparable AI project also helps reveal areas where the training approach can be improved.
After these core changes, a new training attempt succeeds: the AI learns to maintain control of the noseboost for a much longer period, driving at maximum speed almost indefinitely.
Emergent movement strategies and steering
Once the AI can sustain a noseboost, different training runs produce visibly different movement patterns. Some form circles, triangles, stars, or zigzags; others appear nearly random.
These patterns are emergent strategies: behaviors that arise from the learning process rather than being explicitly programmed as movement plans. The AI cannot see the stadium boundaries, so a circular path should not be interpreted as a conscious effort to stay away from visible walls. Instead, the pattern is a strategy that has developed from the AI’s available observations and reward objective.
To test whether the AI can control its direction, training adds two things:
A target-related reward when the car moves toward a designated location.
Additional inputs that help the AI determine the target’s location.
The AI learns to steer the noseboost toward the target. Initially, its steering is hesitant. With more training, it adopts a smoother strategy and keeps a safer distance from a pillar. That behavior makes sense under the reward setup: avoiding a collision lets it continue moving and collecting reward. When the target is moved, the AI adapts its movement, demonstrating that it can control where it goes rather than merely sustaining an uncontrolled pattern.
This illustrates how an agent’s behavior changes when the objective changes. A movement pattern that was useful when the AI only needed to maintain a noseboost may be replaced when it is rewarded for traveling toward a target.
Completing a track with a sustained noseboost
The final challenge is to navigate a track with 30 corners while maintaining a single noseboost from start to finish. The training proceeds in stages:
Learn to gain enough speed: The AI receives rewards for increasing speed until it can noseboost reliably.
Learn to make progress along the track: Once the boost is established, the speed-based signal is replaced with a reward for progressing along the road.
Use track-position information: Additional inputs help the AI locate itself on the track.
The AI is fast but initially inconsistent. It often loses control in corners, particularly when its spinning motion stops.
Why spinning matters
During a noseboost, the AI makes spinning movements that appear to help keep the car balanced on its nose. Analysis of the car’s rotation reveals a pattern:
When making a right turn, the AI tends to increase its spin.
When turning the other way, it tends to reduce or cancel the spin.
On open space, the AI can preserve its rotation by repeatedly turning in the same direction. This may help explain why some training runs produce circular paths. On a track, however, the AI must alternate between left and right turns, making it harder to maintain the spin that stabilizes the noseboost.
With further training, the AI gets better at chaining turns in both directions while maintaining its spin. It eventually completes the full track with a noseboost, finishing about 25 seconds faster than the human developer’s personal time.
This result depends on several learned abilities working together:
Triggering a noseboost.
Sustaining it at maximum speed.
Steering while controlling the boost.
Maintaining the necessary spinning movement through alternating corners.
Using track information to make progress along the route.
AI control and tool-assisted speedruns
A recorded noseboost does not necessarily show a person or an AI making real-time decisions. A tool-assisted speedrun is a prerecorded sequence of actions that has been carefully constructed by humans, often with programming tools. Such a sequence can produce strategies more advanced than those used by a real-time AI because its actions are prepared in advance rather than selected during live play.
The distinction is between:
Real-time AI control: The AI observes the current state and chooses actions as the game progresses.
Tool-assisted control: A preconstructed action sequence is played back, with no live decision-maker controlling each action.
Thus, a tool-assisted run and an AI-driven run can both show advanced driving, but they are produced by different methods.

Ask anything
We've read this whole study set, so questions about it get the best answers.