Play against the bot
Watch the bot, score it, and the plan for real-game play.
7 min read
How to watch a trained bot play and score it against other bots, all inside RocketSim. You can't yet drive a car against it yourself, and it doesn't run in the real game.
What works today#
| What | How | Status |
|---|---|---|
Watch a checkpoint play ball_chaser, idle, random, itself or another checkpoint | just watch → RLViser | done |
| Walk a run's progression, or follow a run that's still training | just watch --progression, --follow | done |
| Score a checkpoint against opponents, with Wilson intervals | just eval-match, just eval-bots, just league-match | done |
| Export a game and replay it exactly in RLViser | --export, then just view --live or the Command Center | done |
| Drive a car yourself against the bot | – | not implemented |
| Play it in the real Rocket League client (RLBot) | plan below | adapters built, not run in the game |
Watch a checkpoint in RLViser#
just watch plays games with a checkpoint and streams them to RLViser, a 3D viewer. It runs on one
CPU thread, so it can run next to training. Details: Watching bots.
Build RLViser once:
just rlviser.Start watching; RLViser opens by itself:
shjust watch runs/selfplay/main-1v1-s11/final.ptIn RLViser, press
1to follow the bot. It's always Blue, car 1. Press9for the director camera,Pto pause, and+/-to change speed.
The console prints one line per game: the result, who scored, the duration, touches, the bot's largest reward terms, and the checkpoint's evaluation score and rating.
Other ways to watch:
just watch runs/selfplay/main-1v1-s11 --opponent self # mirror match
just watch runs/selfplay/main-1v1-s11 --opponent prev:10 # vs the checkpoint 10 saves earlier
just watch runs/selfplay/main-1v1-s11/final.pt \
--opponent runs/selfplay/main-1v1-s11/checkpoints/step_104857600.pt # vs a specific checkpoint
just watch runs/selfplay/main-1v1-s11 --progression # 6 checkpoints, same kickoff
just watch runs/selfplay/<running-run> --follow # newest checkpoint each episode
just watch runs/selfplay/main-1v1-s11 --training-starts --sample # varied starts and actionsEvaluate a checkpoint yourself#
just eval-match runs/selfplay/main-1v1-s11/final.pt # vs ball_chaser + the run's 3 previous checkpoints
just eval-bots runs/selfplay/main-1v1-s11/final.pt # vs ball_chaser, Necto and Nexto
just eval-match runs/selfplay/main-1v1-s11/final.pt --opponents ball_chaser idle \
runs/selfplay/main-1v1-s11/checkpoints/step_524288000.pt --export 1
just league-match runs/selfplay/main-1v1-s11 --every 10 --episodes 128 # round robin -> <run>/league/ratings.jsonOpponents (
--opponents): scripted names (ball_chaser,idle,random), the community bots (necto,nexto,nexto:<beta>; how they run),prev:K(the run's K previous checkpoints), or checkpoint paths, including from other runs.Games: every held-out kickoff seed of the task (256 for
match-1v1-v1), unless you pass--episodes N.Output:
<run>/eval/<ckpt>.<task>.match.json.--ratings FILEadds the games to aratings.jsonand refits it.How results are scored and what they mean: Bot standings.
Export a game and replay it#
--export K writes the first K evaluation games as ordinary scenarios to <run>/eval_scenarios/.
It doesn't write traces: replaying re-simulates the scenario in RocketSim, bit-exactly,
demolitions included
(Export and replay of match episodes).
The main run has one exported game: final.pt vs ball_chaser from the first held-out kickoff
(seed 2^63 + 3000000). Blue scored at tick 1653 (13.8 s), with 21 touches to Orange's 2.
# re-simulate it in RocketSim and stream it to RLViser
just view --live runs/selfplay/main-1v1-s11/eval_scenarios/match-1v1-v1-step-1023541248-vs-ball-chaser-seed-9223372036857775808.jsonThe Command Center lists a run's exported games with a Replay in RLViser button that runs the same command.
Playing it yourself: not possible yet#
No human input. The environment only takes actions from bots, and RLViser is just a viewer. Nothing reads a gamepad or keyboard.
No real-game deployment yet (adapters built). The observation and action adapters exist (below), but the bot hasn't run in the game.
Plan: real-game play through RLBot#
The goal is to play the bot in the real game, local and offline only, and compare it with its
simulator results. The natural route is RLBot, the framework Necto and Nexto
ship through; their RLBot wrappers are in .external/Necto/rlbot-support/. Some simulator events
may not be observable through BakkesMod, so the comparison can't rely on them.
Bot wrapper. Write an RLBot agent that loads a checkpoint with
evaluate.load_frozenon the CPU, aswatchalready does. Nexto'sbot.pyis a working template: an RLBotBaseAgentthat asks for 120 ticks/s and decodes the packet into anrlgym_compatGameState. Its requirements pinrlbot==1.*,torch==1.9.1+cpuandrlgym-compat==1.0.2. Which RLBot version to target is an open choice.Observation adapter. Rebuild the task's exact layout from the game packet: 119 floats for
match-1v1-v1, named byenv.info.obs_names(Observation layout).Scales: positions and velocities ÷ 2300, angular velocities ÷ π, boost ÷ 100.
Mirroring: Orange sees the field rotated 180° about Z, so both teams attack +Y.
Car flags:
has_flip_or_jump,has_jumped,has_double_jumped,has_flipped,is_flipping,is_supersonic,demolished. Nexto getshas_flipfromrlgym_compat; each of our flags needs a packet field or a tracker that matches RocketSim's definition.The last 5 actions (the action stack).
time_remaining_frac: in training this is the fraction of the 5-minute episode limit left, and an episode ends at the first goal. Decide what to feed it in a real match.score_diff: always 0 in training.Check: before going live, test the adapter for parity against the env's observations on recorded sim states, the way the mirror tests do (to 1e-4).
Action adapter. Map the policy's index into the 90-row table (
physlab_rl.env.action_table(), columns[throttle, steer, pitch, yaw, roll, jump, boost, handbrake]) to the controller state. Hold each action for 8 ticks:tick_skip = 8, 15 decisions/s, the same as Nexto.One tick of latency. Our env applies an action from the next tick. RLGym's
rlbot_delaymodels one tick more, and we deliberately don't, so exported episodes replay bit-exactly (Environment conventions). A bot deployed through RLBot therefore sees one extra tick of latency. There are two ways to handle it; compare them in the game:Send the new controls one tick early, as Nexto's
bot.pydoes: it applies the action attick_skip - 1. Necto's copy has that line commented out.Fine-tune with a delayed-action task option.
Match flow. The bot has only played single-goal games from kickoffs and has no hard-coded kickoff (Nexto has one). A real match has a kickoff after every goal and a clock, and the bot's behaviour there is unmeasured.
Real-game constraints.
Our BakkesMod tooling only works with the game launched without anti-cheat (how).
Real-game work is limited to sanctioned local or offline testing. Automating online competitive matches is an explicit non-goal of the project.
Whether RLBot runs with the game launched without EAC has not been checked here.
Sim-to-real. Single-car physics (driving, jumps, flips, air control, car–ball hits) matches the real game closely in Free Play, but car–car contacts and the bot's own play haven't been checked there (Sim vs real differences), so expect some transfer gap. Once the bot runs, play it against the RLBot builds of Nexto and Necto and against humans, and compare with its sim results (what that comparison needs).