BakkesMod plugin
The plugin that runs scenarios in the real game.
8 min read
PhysLab is the BakkesMod plugin that runs our scenarios in the real Rocket League. It sets the ball and the Free Play car, replaces the car's input with the scenario's, and records both every physics frame. It runs only in local Free Play: it refuses online games, paused games, any game speed other than 1.0, and physics rates other than 120 Hz.
The plugin is deliberately simple. It runs a flat plan written by physlab realgame prepare and
records raw state. Validation, coordinate conversion and trace building happen in Rust
(crates/realgame).
Build and install#
Needs Visual Studio 2022 with the C++ workload (MSVC + bundled CMake) and the
SDK at .external/BakkesModSDK (or -DBAKKESMOD_SDK=...).
just plugin-build # bakkesmod-plugin/build/Release/PhysLab.dll
just plugin-test # Rust-rendered plan -> C++ parser round trip
just plugin-install # copy into %APPDATA%\bakkesmod\bakkesmod\pluginsUse#
BakkesMod only works with the game running without Easy Anti-Cheat (EAC), an official mode for
offline and LAN play. Start BakkesMod, then launch Rocket League from the Epic Games Launcher with
its launch-without-EAC option (or ⋯ > Manage > Launch Options: -noeac), and confirm with
just rl-check. Running Launcher.exe -noeac directly doesn't work: the game hands off to Epic
for sign-in and comes back with EAC on. Full steps:
Running the real-game harness.
Then enter Free Play in a car with the Octane hitbox (Octane and Fennec are known-good). Keep your hands off the controller during ball-only captures. In car scenarios the plugin replaces the car's input on every tick, so the controller doesn't matter.
just rl-console plugin load physlab
just real-probe # once per game build: verify tick timing
just m1 # sim trace + 5 real captures + comparisons
just car-suite 1 "car-jump-*" # car scenarios: sim + real captures + comparison table
just car-suite 1 "*" scenarios/car-ball # the same for another folderEverything is driven through BakkesMod's RCON plugin (enabled by default; the CLI reads the password from your BakkesMod config). The same commands work by hand in the BakkesMod console (F6):
| Command | Effect |
|---|---|
physlab_run <scenario_id> [repeats] | Run data/physlab/plans/<id>.plan |
physlab_probe [seconds] | Tick-timing investigation |
physlab_abort | Stop the current run or probe (partial data is kept, marked incomplete) |
physlab_status | State and exchange folder |
| Cvar | Default | Effect |
|---|---|---|
physlab_tick_hook | Function TAGame.Car_TA.SetVehicleInput | The hook that drives capture; it must fire once per physics frame |
physlab_tick_hook_post | 0 | 1 = capture in that hook's post-hook instead |
physlab_probe_extra_hooks | empty | Extra ;-separated hooks for physlab_probe |
physlab_log_hooks | empty | ,-separated game events to log, with the sample index, during a run (for example Function TAGame.VehiclePickup_TA.OnTouch) |
physlab_park_car | a spot near a corner | Ball-only scenarios: where the car is parked, at rest, out of the ball's way |
physlab_car_hop_z | 1800 | Before setting the start state, lift the car to this height and move it across, so it can't collect a boost pad on the way (0 = move directly) |
physlab_car_set_mode | physics | physics sets the car's rigid-body state in one call, quaternion included; actor uses the actor setters and an integer rotator |
physlab_car_settle_frames | 1 | Frames the car is held at its starting pose, with neutral input, before the run starts (see Findings) |
physlab_car_default_prefs | 1 | 1 = during a run, the car's controller settings are RocketSim's (see Findings) |
physlab_dodge_from_stick | 1 | 1 = fill the dodge direction from the stick, as the game's controller code does |
Capture protocol#
The plan lists the ball, the car if there is one (position, velocity, angular velocity, quaternion,
boost), and one control line per control step of the scenario.
Hop and settle the car. In the first tick-hook calls after
physlab_run, the plugin lifts the car straight up tophyslab_car_hop_z, moves it above the start, then sets the car's state and lets the game step once at that pose with neutral input.Set the state. On the next call it sets the car again, and the ball's location, velocity, angular velocity and rotation (identity), then reads them back. That reading is the
set_framesample (tick 0 before warmup). The car is set withRBActor::SetPhysicsState, so its quaternion is exact, with no integer rotator in between. In a ball-only scenario the car is parked out of the way instead.Drive the car. On every pre-step call the plugin replaces the input parameter of
Car_TA.SetVehicleInputfor the local car with the scenario's input for that step. Input is neutral during warmup and outside control steps.Count frames. On every later hook call it reads the engine physics frame counter. A call in an already-recorded frame is counted as a duplicate and ignored. A jump of more than one frame is counted as missing frames. Nothing is recorded by sample order.
Write. After
warmup + durationframes it writesdata/physlab/raw/<id>/<session>-rNN.raw.jsonlwith environment metadata (BakkesMod version, Psyonix build id, physics framerate, max substeps, gravity, ball radius, ...), then waits 0.5 s and repeats.
Each sample holds two readings, GetCurrentRBState() and GetRBState().
The importer uses current by default (--state-source rb switches), and
the probe tells you which one is updated when.
With a car, each sample also holds a car record: its rigid-body state, Actor::GetRotation (for
cross-checks only), boost, on-ground, wheel contacts, jumped, double-jumped, has-flip, and the
input stored on the car. The importer then:
infers landings from on-ground turning true, like RocketSim's
car_landed;checks that the input the game stored equals the scenario's on every step;
checks the car's hitbox and the readback of the set state;
warns if the run didn't use RocketSim's controller settings.
It doesn't detect car–ball touches yet; matching ball states are the evidence for them.
Findings#
Game build 261001.2867.529371, BakkesMod 228, 2026-10-15.
Tick timing (probe): the engine steps at 119.93 Hz.
Car_TA.SetVehicleInputandEngineShare_TA.EventPostPhysicsStepeach fire exactly once per physics frame.SetVehicleInputruns before the frame's step andEventPostPhysicsStepafter it. Render-rate hooks (PlayerTick,GameViewportClient.Tick) fire about 2x per frame, andRBActor_TA.PreAsyncTickabout 4x.State setting: values set in the pre-step hook take effect in that frame's step.
GetCurrentRBState()reflects them immediately, whileGetLocation()/GetVelocity()still return the old actor state until the step.The state is rounded onto a grid every tick, in the game and in RocketSim, and the
RBStatewe read is the rounded state. So real − sim shows up to ~0.005 uu even when the physics is identical (Measurement floor). An earlier version of this page said the game's state was unrounded; that was wrong.Actor readings (
GetLocation()/GetVelocity()/GetAngularVelocity()) are unquantized but lag the physics state by a varying fraction of a tick, which looks like render interpolation. Don't use them for precision work.Determinism: 5/5 real ball drops were bit-identical, and so is every repeated car capture.
Wheel contacts survive a teleport. Right after the car is set, the game still has the wheel contacts from where it was. On the first step it applied the on-ground "sticky" force (half of gravity, toward the ground) to a car in mid-air: a constant 2.704 uu/s error in
car-air-none. The settling frame fixes it, andcar-air-nonethen matches at the measurement floor.Controller settings scale the input. The game scales input inside the car by the player's aerial sensitivity, steering sensitivity and dodge deadzone. At 1.95 / 1.95 / 0.5, half-stick pitch rotated the car nearly as fast as full stick. During a run the plugin sets RocketSim's values (1, 1, 0.5) and restores the player's afterwards. Both are recorded in the capture.
Dodge direction. The game dodges along its own
DodgeForwardandDodgeStrafefields, which the controller code normally fills from the stick. The plugin setsDodgeForward = -pitchandDodgeStrafe = yaw, and front, back and side flips match RocketSim.Input grid. The game stores analog input on an 8-bit grid (0.5 reads back as 64/127 = 0.5039), as RocketSim does internally.
Boost. When a scenario sets boost, the plugin turns off Free Play's unlimited boost and sets the amount.
Teleports collect boost pads. After a state set, the game moves the car along the straight line from where it was, and any pad on that line gives boost and goes on cooldown. That's why the plugin hops the car over the arena first (
physlab_car_hop_z). Car captures with and without the hop are identical.GetRadius()reads 95.487, but the ball collides like RocketSim's 91.25 uu sphere (same bounce tick, rest height 93.14 vs 93.15).RCON allowlist: BakkesMod only executes RCON commands listed in
data/rcon_commands.cfg. Addphyslab_run,physlab_probe,physlab_abortandphyslab_status(and any cvar you set over RCON, such asphyslab_log_hooks), then sendrcon_refresh_allowed.Hot-unloading once crashed the game:
plugin unload physlabwas followed ~15 s later by a crash inside BakkesMod'spluginsdk.dllon the render thread. That is still unexplained. Unload, copy and load later worked three times with the plugin idle, but restarting the game is the safe way to update it.
Open questions#
Contacts are observed through
LastHitWorldTimechanges. They carry no contact point, and the game may rate-limit that field. Car–ball touches aren't detected at all yet.Hidden flip state. The game exposes
HasFlip(a flip is available), not RocketSim'shas_flipped, sohas_flippedis unknown in real traces.A second car. Free Play has one car. Car–car scenarios need a local match or bots; whether the plugin can drive and record those is unchecked.
Coordinate handedness is settled: the game-to-schema conversion
(crates/realgame/src/frames.rs) is the identity for the ball and for car
orientation (Coordinate systems).