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

1. Log the game world
800 scripted matches gave 889,124 shots. Each shot stores the full state of all six robots.
2. Fit the fast world
Tables for terrain and mobility, plus a learned hit model.
Parity gate: the same matches in both worlds must agree on checks such as time to kill and victory points
3. Clone, then DAgger
Start from imitation of ScriptedBot, not from random play.
4. MAPPO in the fast world
Against scripted bots and frozen snapshots of the policy.
Evaluate each checkpoint in the fast world and the game world
5. Fine-tune in the game world
Slow, but it trains on the true physics.
6. Find each gap, and refit
New logs refit the hit model. A refit needs held-out calibration and parity to pass.
Figure 1. The training loop. The game world is the source of truth. The parity gate stops a bad fit from reaching training.

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.

Own state
Self, armor hits by plate, robot type
MLP
Entities
3 enemies and 2 teammates, 13 features each
Shared MLPMulti-head attentionMasked mean pool
Concatenate
GRU
Memory across decisions, for enemies out of sight
Six action heads
move
25 options
spin
5 options
target
4 options
look
8 options
fire
2 options
buy
4 options
Figure 2. The MAPPO network. Invalid actions and missing entities are masked. The critic is not used at match time.
HeadSizeMeaning
move25Stop, or 8 directions in the gimbal frame at 3 speeds
spin5Spin rate, 0 to 15 rad/s
target4Pointer over visible enemies, or no target
look8Gimbal sector to search
fire2Fire or hold
buy4Ammunition 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.

Fast-world win rate after each DAgger round
Clone0.0%
Round 10.0%
Round 21.5%
Round 310.5%
Round 421.0%
Round 534.5%
Round 633.5%
Figure 3. DAgger rounds, 200 fast-world matches each, against ScriptedBot. The quantised bot itself wins 42 %, so this is close to the limit of imitation.

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 showedCauseFix
Scripted bots stuck for 75 % of the Hero's alive timeRecovery logic reversed its last backup, so the bot moved back and forthFixed the bot, then logged all matches again
Policy stuck on walls 25 to 63 % of its moving timeThe fast world let robots slide along walls at full speed, so the policy learned to ride themAn along-wall deceleration, fitted to MuJoCo
Policy spent 77 % of its time in its baseThe fast chassis ran about 37 % faster than the game chassisAdded 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 playerEvaluate the sampled policy
25 % wins as red, 4 % as blueThe policy had never trained as blueMixed colors, then mirrored blue
A live robot pushed a parked robot too fastNo limit on push speedA 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.

Win rate by checkpoint, fast world and game world
Fast world (200 matches)Game world (40 to 80 matches)
0%25%50%75%100%25015252800407553506625Update50 %
Show the data as a table
UpdateFast world (200 matches)Game world (40 to 80 matches)
25043.5% (36.8 to 50.4)5.0% (1.4 to 16.5)
50028.5% (22.7 to 35.1)2.5% (0.4 to 12.9)
75040.5% (33.9 to 47.4)10.0% (4.0 to 23.1)
100059.5% (52.6 to 66.1)10.0% (4.0 to 23.1)
125033.0% (26.9 to 39.8)15.0% (7.1 to 29.1)
150046.5% (39.7 to 53.4)10.0% (4.0 to 23.1)
175045.0% (38.3 to 51.9)12.5% (5.5 to 26.1)
212557.0% (50.1 to 63.7)11.3% (6.0 to 20.0)
237540.5% (33.9 to 47.4)11.3% (6.0 to 20.0)
262557.0% (50.1 to 63.7)10.0% (5.2 to 18.5)
287560.5% (53.6 to 67.0)18.8% (11.7 to 28.7)
312564.0% (57.1 to 70.3)10.0% (5.2 to 18.5)
337569.0% (62.3 to 75.0)17.5% (10.7 to 27.3)
362546.0% (39.2 to 52.9)8.7% (4.3 to 17.0)
387574.0% (67.5 to 79.6)13.8% (7.9 to 23.0)
412549.0% (42.2 to 55.9)6.2% (2.7 to 13.8)
437574.5% (68.0 to 80.0)21.2% (13.7 to 31.4)
462552.5% (45.6 to 59.3)15.0% (8.8 to 24.4)
487557.5% (50.6 to 64.1)7.5% (3.5 to 15.4)
512562.5% (55.6 to 68.9)16.3% (9.7 to 25.8)
537558.5% (51.6 to 65.1)20.0% (12.7 to 30.0)
562558.5% (51.6 to 65.1)13.8% (7.9 to 23.0)
587542.5% (35.9 to 49.4)7.5% (3.5 to 15.4)
612561.5% (54.6 to 68.0)16.3% (9.7 to 25.8)
637538.0% (31.6 to 44.9)7.5% (3.5 to 15.4)
662545.5% (38.7 to 52.4)15.0% (8.8 to 24.4)
Figure 4. Main run (ppo7). The fast-world win rate rose, but the game-world rate rose much less. This gap is why we moved to fine-tuning in the game world. Move the pointer over the chart to read each checkpoint.
Game-world win rate during fine-tuning
0%15%30%45%60%1002804606408201000Total updategame3 startsTarget: 50 %
Show the data as a table
Total updateGame world
10013.8% (7.9 to 23.0)
20016.3% (9.7 to 25.8)
30017.5% (10.7 to 27.3)
40030.0% (21.1 to 40.8)
45035.0% (25.5 to 45.9)
50018.8% (11.7 to 28.7)
55020.0% (12.7 to 30.0)
60030.0% (21.1 to 40.8)
65022.5% (14.7 to 32.8)
70031.2% (22.2 to 42.1)
75028.7% (20.0 to 39.5)
80038.8% (28.8 to 49.7)
85023.7% (15.8 to 34.1)
90021.2% (13.7 to 31.4)
95031.2% (22.2 to 42.1)
100020.0% (12.7 to 30.0)
Figure 5. Fine-tuning in the game world, 80 matches per point, with the Wilson interval as a band. The first run (game1) reached 30 % at update 400. A second run (game3) continued from that checkpoint with only the victory-point shaping term, a longer rollout and a lower learning rate.
StageFast worldGame 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 game74.5 %21.2 % (17 of 80)
Game-world fine-tuning (game3), best checkpointnot tested38.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 K commands to the real firmware stack.

The training code is in a private team repository.