RL Policy Training
We train a team of three robots to play full 3v3 matches, with multi-agent PPO. The policy chooses how to move, whom to target, when to fire and what to buy. It plays through the same interface as a human driver. Most of the work is not the network. It is making a fast training world agree with the slow, accurate one.
- 38.8%
- best game-world win rate, 31 of 80 matches
- 3%
- game-world win rate before the gap work
- 74.5%
- best fast-world win rate, 200 matches
- 50%
- game-world target, not reached yet
The goal
The first goal is a policy that beats ScriptedBot in the MuJoCo game world. ScriptedBot is our hand-written team strategy, with path planning, target selection and resupply. After that, the policy improves through self-play. The team can then use it as a practice opponent for drivers and as a tool to test strategy.
Training only in MuJoCo is too slow. Our training logs show 2 to 3 batched decisions per second in the game world, against about 23 in the fast world on the same machine. So we train in a fast world that is fitted to the game world, and the game world is the only test that counts.
How it works
The fast world
The fast world is a 2.5D batched simulator in C++ with pybind11. It runs at about 20,000 times real time, and it uses the same referee and slot interface as the game world. Rounds do not fly. A learned hit model predicts each shot: target, other robot, or no hit. The model is an MLP over 26 features at launch time, trained on 886,213 logged shots. On held-out seeds, the log-loss is 0.409, accuracy is 0.815, and each reliability decile is within 0.03 of the observed rate.
The policy
All robots share one recurrent actor. Attention lets it handle enemies that appear and disappear, and a pointer head lets it choose among them. The critic sees the full referee state, but only during training. The actor sees only what its robot may know, with a command delay of 150 to 250 ms and decisions at 10 Hz. Rewards are shared by the team.
| Head | Size | Meaning |
|---|---|---|
| move | 25 | Stop, or 8 directions in the gimbal frame at 3 speeds |
| spin | 5 | Spin rate, 0 to 15 rad/s |
| target | 4 | Pointer over visible enemies, or no target |
| look | 8 | Gimbal sector to search |
| fire | 2 | Fire or hold |
| buy | 4 | Ammunition to buy |
PPO runs on an AMD RX 7900 XTX through ROCm in WSL. Blue matches are mirrored about the field center, so the policy always plays from one side. This one change took a checkpoint from 0 % to 34 % as blue in the fast world, with no new training.
Imitation first
PPO from random weights did not learn: 316 updates stayed at a 0 % win rate. So we started with behavior cloning. The clone had good accuracy on held-out data, but it lost 200 of 200 matches. It waited at spawn, because a robot at spawn is mostly labeled "wait". DAgger fixed this: the clone drives, and the expert labels the states the clone really reaches.
The sim-to-game gap
A policy with a 31.5 % win rate in the fast world won only 3 % of 100 game-world matches. The hit model was not the cause: it stayed calibrated on the policy's own shots. Each cause below came from logged data, and each physics fix went through the parity gate.
| What the logs showed | Cause | Fix |
|---|---|---|
| Scripted bots stuck for 75 % of the Hero's alive time | Recovery logic reversed its last backup, so the bot moved back and forth | Fixed the bot, then logged all matches again |
| Policy stuck on walls 25 to 63 % of its moving time | The fast world let robots slide along walls at full speed, so the policy learned to ride them | An along-wall deceleration, fitted to MuJoCo |
| Policy spent 77 % of its time in its base | The fast chassis ran about 37 % faster than the game chassis | Added the fitted velocity and spin gains |
| Greedy play won 0.5 %, sampled play 14.5 % | PPO trains a stochastic policy, and its most likely action is a different player | Evaluate the sampled policy |
| 25 % wins as red, 4 % as blue | The policy had never trained as blue | Mixed colors, then mirrored blue |
| A live robot pushed a parked robot too fast | No limit on push speed | A push cap fitted to MuJoCo |
Results so far
All results are against ScriptedBot with the sampled policy. Intervals are Wilson 95 %. These checkpoints are from the 2025-26 3v3 game, in the game world that uses fitted controllers.
Show the data as a table
| Update | Fast world (200 matches) | Game world (40 to 80 matches) |
|---|---|---|
| 250 | 43.5% (36.8 to 50.4) | 5.0% (1.4 to 16.5) |
| 500 | 28.5% (22.7 to 35.1) | 2.5% (0.4 to 12.9) |
| 750 | 40.5% (33.9 to 47.4) | 10.0% (4.0 to 23.1) |
| 1000 | 59.5% (52.6 to 66.1) | 10.0% (4.0 to 23.1) |
| 1250 | 33.0% (26.9 to 39.8) | 15.0% (7.1 to 29.1) |
| 1500 | 46.5% (39.7 to 53.4) | 10.0% (4.0 to 23.1) |
| 1750 | 45.0% (38.3 to 51.9) | 12.5% (5.5 to 26.1) |
| 2125 | 57.0% (50.1 to 63.7) | 11.3% (6.0 to 20.0) |
| 2375 | 40.5% (33.9 to 47.4) | 11.3% (6.0 to 20.0) |
| 2625 | 57.0% (50.1 to 63.7) | 10.0% (5.2 to 18.5) |
| 2875 | 60.5% (53.6 to 67.0) | 18.8% (11.7 to 28.7) |
| 3125 | 64.0% (57.1 to 70.3) | 10.0% (5.2 to 18.5) |
| 3375 | 69.0% (62.3 to 75.0) | 17.5% (10.7 to 27.3) |
| 3625 | 46.0% (39.2 to 52.9) | 8.7% (4.3 to 17.0) |
| 3875 | 74.0% (67.5 to 79.6) | 13.8% (7.9 to 23.0) |
| 4125 | 49.0% (42.2 to 55.9) | 6.2% (2.7 to 13.8) |
| 4375 | 74.5% (68.0 to 80.0) | 21.2% (13.7 to 31.4) |
| 4625 | 52.5% (45.6 to 59.3) | 15.0% (8.8 to 24.4) |
| 4875 | 57.5% (50.6 to 64.1) | 7.5% (3.5 to 15.4) |
| 5125 | 62.5% (55.6 to 68.9) | 16.3% (9.7 to 25.8) |
| 5375 | 58.5% (51.6 to 65.1) | 20.0% (12.7 to 30.0) |
| 5625 | 58.5% (51.6 to 65.1) | 13.8% (7.9 to 23.0) |
| 5875 | 42.5% (35.9 to 49.4) | 7.5% (3.5 to 15.4) |
| 6125 | 61.5% (54.6 to 68.0) | 16.3% (9.7 to 25.8) |
| 6375 | 38.0% (31.6 to 44.9) | 7.5% (3.5 to 15.4) |
| 6625 | 45.5% (38.7 to 52.4) | 15.0% (8.8 to 24.4) |
Show the data as a table
| Total update | Game world |
|---|---|
| 100 | 13.8% (7.9 to 23.0) |
| 200 | 16.3% (9.7 to 25.8) |
| 300 | 17.5% (10.7 to 27.3) |
| 400 | 30.0% (21.1 to 40.8) |
| 450 | 35.0% (25.5 to 45.9) |
| 500 | 18.8% (11.7 to 28.7) |
| 550 | 20.0% (12.7 to 30.0) |
| 600 | 30.0% (21.1 to 40.8) |
| 650 | 22.5% (14.7 to 32.8) |
| 700 | 31.2% (22.2 to 42.1) |
| 750 | 28.7% (20.0 to 39.5) |
| 800 | 38.8% (28.8 to 49.7) |
| 850 | 23.7% (15.8 to 34.1) |
| 900 | 21.2% (13.7 to 31.4) |
| 950 | 31.2% (22.2 to 42.1) |
| 1000 | 20.0% (12.7 to 30.0) |
| Stage | Fast world | Game world |
|---|---|---|
| DAgger clone (round 5) | 34.5 % | 3 % (3 of 100) |
| PPO, before the gap work (ppo2) | 31.5 % | 0 % (0 of 100) |
| PPO with the fixes (ppo7), best checkpoint in the game | 74.5 % | 21.2 % (17 of 80) |
| Game-world fine-tuning (game3), best checkpoint | not tested | 38.8 % (31 of 80) |
What we learned
- A fitted simulator needs a gate. Parity checks found bugs that win rate could not show, and one of them was in our own scripted bot.
- The policy finds each error in the simulator. Wall sliding was a small modeling error, and the policy made it a strategy.
- Evaluate what you trained. A greedy evaluation of a stochastic policy reported a player that did not exist.
- Report the interval. With 80 matches, a change of 10 points is often only noise.
What is next
- Close the fire-rate gap. In the game world the policy launches 0.455 shots per fire decision, against 0.591 in the fast world. A target that spins fast shows the largest difference.
- A refresh loop that adds new game-world logs during training, with each refit gated by held-out calibration.
- A surrogate over the full arena state, in place of the 26 hand-made features.
- A self-play league of frozen snapshots and scripted bots, after the policy beats the script.
- A port to the Season 2 rules on the S2 Arena, with
Level Kcommands to the real firmware stack.
The training code is in a private team repository.