For a while, Riff Racers had a problem that sounds pleasant until you think about it: I kept winning. Even on the highest difficulty I could often finish ten or fifteen seconds ahead, and a ten-second lead in a kart race isn’t really a race. It felt like a time trial with eleven other karts somewhere behind me.
I didn’t want to fix that with a bigger top speed, which only moves the gap around. So I measured what the AI was doing wrong. The karts that used to win lapped about five percent slower on average than a reference driver in the same kart who simply used everything the game offers: drifting into boosts, chaining them, taking shortcuts. On Thunderforge and Frostfire Run the AI never drifted at all, because it only drifted at spots I had marked by hand and those two tracks had none.
Here’s a short clip of where that ended up. It’s real footage from all five tracks of the first demo lineup, with all twelve karts driven by the AI, camera kart included. I shortened the Headliner races to three laps for recording, so you see the racing but not how grudges build over a full race.

Riff Racers – The Grid Fights Back | Racing AI & Rivalries Gameplay
By loading the video, content from YouTube will be loaded and data may be transferred to Google/YouTube.
Watch on YouTubeMaking the other drivers race properly
Every kart handles identically now: the kart you pick is a look and a sound, and the AI gets no speed bonus. So the opponents had to make better decisions with the same equipment. They brake, corner and hold their lines more precisely, drift and spend boost far more often, and use shortcuts and jumps more. On Warm-Up, an AI kart used to drift into a boost 0.8 times per lap. It’s about 2.6 now.

Rhythm Kaur airborne off the Catwalk Cut kicker on Razorline Riot.
Overtaking was harder. Karts of equal pace only pass when something gives them a speed difference, and about 92 percent of pass attempts in my test races never ended in a pass. So a driver stuck behind the same kart now gets more impatient over time, followers shade toward the inside of the next bend so a pass can start from open road, and fights restart sooner, so they last longer than one corner.

A tight pack on Cathedral Circuit. The camera follows Jax Monroe, with Luca Moretti and Mika Blaze within about four meters.
Defending needed restraint. A bold driver on the inside of a bend can now hold its line and close the door on a kart alongside, but only in corners, only at speed, at most six times per race and never near a jump or a shortcut. I wanted defenders who cover the inside, not ones who weave across the track.
Mistakes got the same treatment. A kart with another close behind it slips more often, but usually as a hesitation or a missed apex. That costs time and opens a gap you can use, and it doesn’t send the kart into a wall.
Twelve drivers shouldn’t drive like twelve clones
I wanted the twelve racers to make different decisions under pressure. Each now has a temperament that shapes how they race.
Mika Blaze is the front-runner, attacking more than anyone and making some of the biggest mistakes. Kira Pulse is the precision driver, one of the cleanest on the grid. Tex Rivers defends harder than anyone, which costs lap time, so Tex wins the least in my simulated races. That trade-off is deliberate. Jax Monroe takes every shortcut and jump on offer, and in my last batch of simulated races Jax won the most and made the most mistakes. Sage Chen weighs things up before committing, and Imani Reed stays composed after a bad moment and tends to make a move late in the race. The other six have their own styles too, from Rhythm Kaur’s patience to Zoe Volt’s quick temper.

Mika Blaze climbing from seventh to fourth in about six seconds on Frostfire Run, passing Imani Reed, Rhythm Kaur and Tex Rivers.

Imani Reed and Zoe Volt side by side on Iron Chorus. Imani held ninth place through this stretch.
Difficulty doesn’t flatten any of this. It changes how skilled and how intense everyone is, but the temperament belongs to the driver: Warm-Up Mika is still bolder than Warm-Up Kira.
What happens when another driver remembers you?
This is the part I’ve enjoyed building most: racers now remember what other racers did to them, within the current race. If a driver is pushed wide or loses places after a meaningful collision, it can hold that against the other driver. The memory is directed, so if, say, Jax shoves Kira wide, Kira holds a grudge against Jax and not the other way around. A grudge isn’t a command to ram anyone. It tilts decisions the AI already makes: defending harder, attacking sooner, staying alongside longer. It works between any two racers, so you’re not automatically the centre of every conflict.
Not every touch makes an enemy. A gentle brush counts for nothing, and blame is judged conservatively. If both karts held their lines, or it’s part of a pile-up, nobody is blamed, which is the case for between a third and a half of the serious incidents in my test races. A push that costs a place irritates the victim, a repeat escalates it, and a clean pass on the offender cuts it in half. Nothing carries over to the next race.
Each driver spends a grudge differently. In a test where everybody holds a strong grudge against the kart ahead, Mika goes for the pass within a second in about nine trials out of ten, and Sage Chen in fewer than one out of ten.
What I did record is a small real example, from an AI-only race on Thunderforge. About half a minute in, Luca Moretti hit the rear quarter of Mika Blaze’s kart. The game rated it meaningful, blamed Luca and logged a grudge, Mika against Luca. At 41 seconds Mika passed Luca back and the game marked it settled.

The HUD on Thunderforge. The camera follows Luca Moretti as Mika Blaze takes the place back.
In the fifteen races I recorded, no grudge holder hit the other driver, as the one at fault, within forty seconds of the grudge forming. The footage does not show a retaliatory collision.
Hard but fair
The balance I care about most is that the AI should be tough without cheating. Aggression alone doesn’t get there: too much and you get constant crashes, too little and the field is passive. That goes for every difficulty, not only Legendary Set.
Difficulty changes driving ability and behaviour: how cleanly drivers brake and corner, how they use boost and shortcuts, and how often they make mistakes or fight for position. All twelve racers take part in every race, and the length goes from three laps on Warm-Up to eleven on Legendary Set, which leaves more room for mistakes, position changes and rivalries.
I should be upfront about one thing, because “without cheating” isn’t the whole story. A field of equally fast, error-free drivers still finishes four or five seconds apart. Closing that gap takes catch-up, or an adaptive ladder that retunes the AI between races, and I had ruled catch-up out earlier. In the end I added a bounded version, pack pace. A driver more than about half a second behind drives closer to a flawless driver in the same kart, never beyond it, and the leader eases off the throttle slightly (at most twelve percent) when the pack is far behind. Nobody gets a faster kart, and the AI can’t tell who is human. It’s still rubber banding, and you may notice it.
It works on average, not in every race. Against the stand-in player described below, winning margins fell from five to twenty-four seconds to around two or less, but about six in ten Warm-Up races still end more than two seconds apart, and a tighter pack means more contact. I can only tell whether that’s racing or bullying by playing it.

A moment after the line on Thunderforge. Leo Cruz, Luca Moretti and Valen Koa finished within 0.28 seconds of each other.
Testing instead of guessing
I can’t tell by feel whether twelve drivers add up to a good race, so I measured. The loop was always the same: guess, change one thing, rerun, keep it only if the numbers agree. I’ve run several thousand simulated races, and plenty of ideas didn’t survive.
One finding stuck with me: the opening lap matters far more than the grid. A kart’s position after lap one correlates 0.69 with its final position, its starting slot only 0.22. Two cheap remedies, waiting longer after failed attacks and attacking more when a boost was ready, changed almost nothing, so I removed both.
The “player” in those simulations is a ghost: the same driving code with no random errors, a little slower than perfect. It’s a model of a strong, tidy driver, not a recording of anybody. Set 1.5 percent off the reference pace, it wins about 95 percent of Warm-Up races and about 5 percent of Legendary Set, which makes a useful ladder but isn’t a playtest.
On the real engine I ran 25 full-distance races on a single seed, all five tracks at all five difficulties with twelve AI racers. All finished, with no script errors. Everything above was measured on dry roads, so the weather system still needs its own runs, and as I write this the new behaviour has only been tested by machines so far.
Every race should have its own story
What I’m after was never just stronger opponents. I want a field where the drivers behave differently and react to what happens around them: a long defensive battle that ends with a clean pass in the closing laps, a leader’s mistake that lets the pack back in, two drivers falling out in the midfield while you’re busy fighting someone else. None of that is scripted. It comes out of the rules above, and the rules can still be wrong.
Next comes the part no simulation can do for me: playing these races myself and finding where the story the game tells isn’t the one I meant.
— Daniel
