Skip to content

pjsny/RocketSimPy

 
 

Repository files navigation

RocketSimPy

A fork of RocketSim with Python bindings.

RocketSim is a C++ library that simulates Rocket League physics. This fork adds nanobind bindings so you can use it from Python.

What's different from upstream

Built on ZealanL's RocketSim, with ideas from mtheall's Python bindings:

  • nanobind instead of pybind11 (smaller, faster builds)
  • C++ and Python test suites with CI
  • Works with rlgym
  • scikit-build-core + uv for packaging

Quick Start

# Build and install Python bindings
cd python
uv build --wheel
uv pip install dist/*.whl
import RocketSim as rs

rs.init("collision_meshes")
arena = rs.Arena(rs.GameMode.SOCCAR)
car = arena.add_car(rs.Team.BLUE, rs.CAR_CONFIG_OCTANE)
arena.step(100)

Speed

About 20 minutes of game time per second on one thread. 12 threads gets you ~10 days of game time per minute.

Accuracy

Good enough to train ML bots to SSL, simulate shots, air control, pinches. Errors accumulate over time so it works best when you're running short simulations with frequent resets.

Building

  1. Clone this repo
  2. Get arena collision meshes with RLArenaCollisionDumper
  3. Build: mkdir build && cd build && cmake .. && make

For Python, see python/README.md.

Docs

Credits

Legal

RocketSim replicates Rocket League physics but doesn't contain any code from the game.

About

A high-performance Rocket League simulator written in C++, exposed to Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 94.6%
  • Python 3.3%
  • C 1.6%
  • Other 0.5%