Repository navigation
A Rust crate with RocketSim v3's API, zero-copy views of the whole simulation state, the game's car-to-car contacts and contact order as public state, and a ball-only path call. The physics is 1.4.0's: every result is the same. Speed is 1.4.0's: CUDA within 0.1% at every size from 96 to 16,384 arenas, CPU within noise at 96 to 1,024 (paired runs on the same machines).
New:
rust/: a crate with RocketSim v3's Rust API (therocketsimcrate, 0.3.6) on RocketGPU's arena, with the same type, field and method names. A v3 project depends on it asrocketsim = { package = "rocketgpu", git = ... }and keeps itsuse rocketsim::...lines.cargo buildbuilds the simulator with CMake.views.field_arrays(sim, array, by_env=True): anyget_full_statefield of every arena of aBatchSimas a zero-copy(env, element[, dims])view, on CPU and CUDA builds.sim.device_arrays()adds the wheel, solver and contact arrays, andArena.simis the arena's one-envBatchSim.CarCarContact(DeviceView::car_car, Pythonviews.car_car_contacts(sim)): the game's contact points between each pair of cars after a tick, with the point on either car in that car's frame, the normal and the distance.DeviceView::contact_order(Pythonviews.contact_order(sim)): the game's list of contacts in the order its solver visits them, withContactOrderKind,ContactOrderCarandContactOrderOtherCarto read an entry.BatchSim::ball_path(samples, ticks, goal_y, out, result): every arena's ball stepped alone (the arenas hold no cars), its position and velocity everyticksticks, the goal it enters and the tick it crosses the line on. One kernel launch on CUDA, whose first call must not be under stream capture. Bit-identical to stepping.get_full_statelistsenv_states.goal_latchedandenv_states.respawn_match_order, so a state copied from one arena to another carries the goal latch and the match's respawn order.
Changed:
get_state_v3().air_time_since_jumpcounts after a dodge or a double jump with no jump before it, as RocketSim v3 does. In 1.4.0 it stayed 0 there.set_state_v3with a state read from the car leaves the car unchanged.- CPU builds compile with GCC 11 (Ubuntu 22.04's default). 1.4.0 needed GCC 12 or Clang.
Arena::Clonekeeps the arena's mutators. In 1.4.0 a clone took the game mode's defaults, so a clone of an arena with changed mutators went its own way from the first tick.
Accuracy, on the full-state suite: unchanged, every body-tick bit-exact. The suite's get_state_v3 check now runs RocketSim v3 alongside through each segment; on it air_time_since_jump differs from v3 on 116 car-ticks of 11.8 million (1.4.0: 43,004).