Experiment log · Mad Pod Racing
I trained a bot for Mad Pod Racing, a 2v2 race where each side steers two pods through a loop of checkpoints, three laps to win. The bot reached the world top 0.2%, but the real output was the lessons. A detailed, low-noise reward designed in depth before training anything. No diversity tricks: precision, and a small league of 15 where the worst team drops each iteration and good blood replaces it. Training games kept separate from evaluation games, so a net is never punished for exploring. With those from day one, three weeks becomes three days. Here's how each lesson got paid for, in order.
TL;DRI trained a 2v2 racing bot end to end on one RTX 4060: PPO self-play, DAgger imitation, then small leagues with precise per-role rewards. Three weeks and 29 experiments got it to 459th of 233,508 on the world leaderboard, the top 0.2%. The recipe those experiments distilled would do it again in about three days.
This is the exact bot I shipped (submission_hybrid.py, verified byte-identical).
Blue: A0 races, A1 is the hybrid defender. It computes
a block point (gold) ~700 units before the leader's next winnable checkpoint and
camps on it: the gold line is A1 driving to that point, and it only re-picks a new
one when the leader moves on. Here it pins the league's best racer (#37) to just 6 checkpoints
while A0 wins 12. On short tracks this camp-and-hold is decisive; on long ones a fast racer out-runs it, which
is why the shipped dispatch bot uses the pure racer on those maps.
The arc fits on one axis: how often the learned bot could beat the strong hand-coded bot I was trying to replace. With coarse, game-level rewards it stuck near 18% no matter how long I trained. DAgger imitation broke the stall, not by teaching a secret skill but by handing the same reward a better base to grow from. Precise, role-level rewards finished the climb. Every point is a win-rate logged in that experiment's own directory.
The wall was reward precision. Game-level rewards stalled at ~18%, the jump is DAgger imitation plus evolution past it, and precise rewards reached 100%. In the end even pure racers could max out the hand-coded bot.
Act I A racer, and the wall
The first trainer was a plain genetic algorithm with a curriculum: learn to drive one pod, then race as a pair, then fight in a league. No gradients, just mutate-and-keep-if-better. It produced a competent racer, the seed for everything after it. What it couldn't do was fight; it had never been rewarded for it.
Champion vs champion on a short sprint: a clean racer, no blocking anywhere.
Evolution is wasteful: a 500-turn game yields one bit, did you win. So I rewrote the sim to run thousands of games in parallel on the GPU and trained a population with PPO, a critic assigning credit turn by turn. It learned fast and crushed its own genetic-algorithm champion. Then I put it against the hand-coded blocker.
Blue is my PPO champion, red is the hand-coded bot. Blue loses.
The reason it lost is worth a detour, because it's the thing I got most wrong all project: the reward. Here's the reward that teaches a pod to race, drawn live over a match it won.
A checkpoint reward alone is a locked door: a random net never crosses one, so it never gets a gradient. The blue shaping (reward for getting closer) lets a from-scratch net climb in; the time drip only becomes safe once it already finishes, or it learns to crash on purpose to stop the bleeding.
Act II A better base, then a better reward
The obvious guess: the racing wasn't good enough. So I grew four genetically separate racer pools that never interbreed, with all the randomness concentrated in immigrants (each with its own mutation size, exploration noise, and entropy) shielded by a grace period. More diversity, more racing. It didn't move.
Still losing to red. More racers and more diversity changed nothing; the reward was too coarse to teach anything new.
I gave up on discovering blocking and cloned the hand-coded bot into a net. First attempt, plain cloning on the expert's own games: it barely drove. The net learns the expert's line, then plays its own slightly-wrong version into states it never saw, and the errors compound (distribution shift). The fix is DAgger: roll out the current net, label the states it actually visits with the expert, retrain, repeat. Now it genuinely learned to block, and pushed the hand-coded bot to the wire.
The clone (blue) copies the human's blocking and loses this one by a single checkpoint, 11 to 12. Copying a stateful expert frame-by-frame has a ceiling. To pass the teacher you have to stop imitating and start optimizing, which is the next experiment.
So I seeded a three-pool league from the clones (a racer, a full-heuristic clone, a hybrid clone) and let PPO evolve them against a shared Hall of Fame, a frozen archive of past champions each generation must beat. The same game-level reward that had stalled from scratch grew fast from the better base. One lineage pulled clear, and the exact matchup that lost by a checkpoint before now flips.
Same opponent, opposite result: blue now beats the bot it was copied from. The first all-neural team to clearly do it.
The evolved champions had drifted blocking-heavy and lost sprints, so I added a from-scratch pure racer, kept pure by a dense racing reward plus a small loss penalty: the project's first precise, role-level reward. It evolved alongside the clones, with advantages normalized per pool so the dense racer's big numbers don't drown the sparse win/loss signal.
The bot I set out to replace was, at this point, solved.
Act III Raising the bar
With the hand-coded bot maxed at 100%, it stopped being a useful ruler. From here the opponents are my own strongest past champions, so 100% now means "beat the best thing I had." And blocking is the hardest control problem left. Here's what a defender actually does, and the reward that scores it.
A guard point computed in code (700 units in front of the first checkpoint the defender can still win the race to). The net doesn't plan; it just holds.
That guard point is the target. Getting a 24-neuron net to sit on it, with a real racer trying to get past, is the part of this project I'm proudest of. The drill: one defender, one attacker, one computed destination (the next checkpoint it can still reach first). The reward is a balance found by hand: pay for being on the point, weighted by urgency (worth almost nothing while the attacker is far, worth everything as it closes), against a pass-penalty smeared back over the run-up so the net feels the breach coming. Too much penalty and it panics; too little and it wanders. Here is that reward, read off a real training run.
The final defender (blue, A1) with the gold tether to its point: it holds 68 to 1,100 units off while the attacker (red) is kept 1,000+ units out for the whole lap. The green reward grows with urgency as the attacker bears down and it refuses to move; a breach would flip it red. This fight has none.
The hard part is physical: a pod coasts about 5.7 times its own speed, so a defender that floors it toward the point sails thousands of units past while the attacker strolls in behind. I didn't train my way out of that, I engineered around it: a hand-coded ferry drives out and brakes for its own stopping distance so it settles dead on the spot, and the net only takes over for the last ~1,500 units, the close-quarters shoving it is genuinely good at.
The meanest upgrade came last: spawn the attacker on the checkpoint's doorstep at racing speed with a random heading, so it drifts in sideways from every angle a real racer might. Training against that drift is what made the camp hold in real matches; a purely positional reward that scored perfectly in the clean drill let the real, moving leader through about twice a game (league_state_dest_position → _position_real). The winner graduated to full 2v2 games (league_state_deffull), where it picks which checkpoint to camp on the fly. That defender is the one at the very top, camping against the best racer I had.
Everything so far ran on one chunky shared network. I reset the architecture to two tiny role-nets trained from scratch: a 40→24→5 racer and a 30→24→5 defender, each fed only the inputs its job needs. Small and specialized leapfrogged big and general.
Two of the light-net champions fighting. The bigger, more expressive model kept losing to the smaller one that only saw what it needed.
All project I'd argued with myself about rewards: pure win/loss, dense shaping, or a potential-based reward that's provably neutral? Instead of guessing, I ran them as a controlled experiment: one seed, eight copies differing only in their reward and which job the second pod did, co-evolving against the same Hall of Fame so the scores were comparable.
Potential-based shaping won, and its racer became the one every final submission is built on. When you can't reason it out, build the experiment that controls everything but the one variable.
If I started over The three-day recipe
Design the reward first. In depth, before any training run. A detailed, low-noise reward beats hoping the network figures it out; every plateau in this project traced back to reward noise, not network capacity.
Skip the diversity machinery. Four pools and immigrants never moved a number. Precision did.
Keep the league small. 15 teams, the worst one drops every iteration, good blood takes its place.
Never score a net on its training games. Exploration noise belongs in training. Promotion is decided on separate, clean evaluation games, so a net is never punished for experimenting.
Budget: about three days. But honestly, the longer you work on the project and the more experiments you do, the more you learn.
My actual row on the Mad Pod Racing world leaderboard: 459th of 233,508, the top 0.2%. Score 31.45, all in Python 3.