This is Rocket League!
Project description
A C++ library for simulating Rocket League games at maximum efficiency
RocketSim is a complete simulation of Rocket League's gameplay logic and physics that is completely standalone. RocketSim supports the game modes: Soccar, Hoops, Heatseeker, and Snowday.
Speed
RocketSim is designed to run extremely fast, even when complex collisions and suspension calculations are happening every tick. On an average PC running a single thread of RocketSim with two cars, RocketSim can simulate around 20 minutes of game time every second. This means that with 12 threads running RocketSim, you can simulate around 10 days of game time every minute!
Accuracy
RocketSim is not a perfectly accurate replication of Rocket League, but is close enough for most applications (such as training ML bots). RocketSim is accurate enough to:
- Train machine learning bots to SSL level (and probably beyond)
- Simulate different shots on the ball at different angles to find the best input combination
- Simulate air control to find the optimal orientation input
- Simulate pinches
However, the tiny errors will accumulate over time, so RocketSim is best suited for simulation with consistent feedback.
Installation
- Clone this repo and build it
- Use https://github.com/ZealanL/RLArenaCollisionDumper to dump all of Rocket League's arena collision meshes
- Move those assets into RocketSim's executing directory
Documentation
Documentation is available at: https://zealanl.github.io/RocketSimDocs/
Bindings
If you don't want to work in C++, here are some (unofficial) bindings written in other languages:
- Python: https://github.com/mtheall/RocketSim by
mtheall - Python: https://github.com/uservar/pyrocketsim by
uservar - Rust: https://github.com/VirxEC/rocketsim-rs by
VirxEC
Official Python bindings are currently in the works.
Performance Details
RocketSim already heavily outperforms the speed of Rocket League's physics tick step without optimization.
Version performance comparison:
OS: Windows 10 (Process Priority = Normal)
CPU: Intel i5-11400 @ 2.60GHz
Ram Speed: 3200MZ
Compiler: MSVC 14.16
=================================
Arena: Default (Soccar)
Cars: 2 on each team (2v2)
Inputs: Randomly pre-generated, changed every 2-60 ticks for each car
=================================
Single-thread performance (calculated using average CPU cycles per tick on the RocketSim thread) (1M ticks simulated):
v1.0.0 = 30,334tps
v1.1.0 = 48,191tps
v1.2.0 = 50,763tps
v2.0.0 = ~50,000tps
v2.1.0 = 114,481tps
Example Usage
#!/usr/bin/env python3
import RocketSim as rs
# Make an arena instance (this is where our simulation takes place, has its own btDynamicsWorld instance)
arena = rs.Arena(rs.GameMode.SOCCAR)
# Make a new car
car = arena.add_car(rs.Team.BLUE)
# Set up an initial state for our car
car.set_state(rs.CarState(pos=rs.Vec(z=17), vel=rs.Vec(x=50)))
# Setup a ball state
arena.ball.set_state(rs.BallState(pos=rs.Vec(y=400, z=100)))
# Make our car drive forward and turn
car.set_controls(rs.CarControls(throttle=1, steer=1))
# Simulate for 100 ticks
arena.step(100)
# Lets see where our car went!
print(f"After {arena.tick_count} ticks, our car is at: {car.get_state().pos:.2f}")
Issues & PRs
Feel free to make issues and pull requests if you encounter any issues!
You can also contact me on Discord if you have questions: mtheall#6174
Legal Notice
RocketSim was written to replicate Rocket League's game logic, but does not actually contain any code from the game. To Epic Games/Psyonix: If any of you guys have an issue with this, let me know on Discord and we can resolve it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rocketsim-2.2.0-0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: rocketsim-2.2.0-0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 395.6 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72d52dc5b140b8eca17cfe6b351d09b0e0957fd287a1eaf91bfa974d36496297
|
|
| MD5 |
0b087020136fd4cd6c25d4454b2431b2
|
|
| BLAKE2b-256 |
660491a51581cd2c7ba2907a22a53dd831c44f675c8ac5dfb53e1f5128554a5e
|
Provenance
The following attestation bundles were made for rocketsim-2.2.0-0-cp39-abi3-win_amd64.whl:
Publisher:
main.yml on mtheall/RocketSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rocketsim-2.2.0-0-cp39-abi3-win_amd64.whl -
Subject digest:
72d52dc5b140b8eca17cfe6b351d09b0e0957fd287a1eaf91bfa974d36496297 - Sigstore transparency entry: 927322233
- Sigstore integration time:
-
Permalink:
mtheall/RocketSim@2277369f6f3101afd2e0c8122f1e8f939dd14b46 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/mtheall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@2277369f6f3101afd2e0c8122f1e8f939dd14b46 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rocketsim-2.2.0-0-cp39-abi3-manylinux2014_x86_64.whl.
File metadata
- Download URL: rocketsim-2.2.0-0-cp39-abi3-manylinux2014_x86_64.whl
- Upload date:
- Size: 596.4 kB
- Tags: CPython 3.9+
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
373c5198e97ea69e15f356127d4220e569146258b5053e9a7929b4985c258439
|
|
| MD5 |
e1c236f35006a676c8ed1e1c62649fb7
|
|
| BLAKE2b-256 |
3d5dad6ca96f7dd1601363072c1bc243ee523fa9a82123b64b240df9fb386cc3
|
Provenance
The following attestation bundles were made for rocketsim-2.2.0-0-cp39-abi3-manylinux2014_x86_64.whl:
Publisher:
main.yml on mtheall/RocketSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rocketsim-2.2.0-0-cp39-abi3-manylinux2014_x86_64.whl -
Subject digest:
373c5198e97ea69e15f356127d4220e569146258b5053e9a7929b4985c258439 - Sigstore transparency entry: 927322230
- Sigstore integration time:
-
Permalink:
mtheall/RocketSim@2277369f6f3101afd2e0c8122f1e8f939dd14b46 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/mtheall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@2277369f6f3101afd2e0c8122f1e8f939dd14b46 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rocketsim-2.2.0-0-cp39-abi3-macosx_14_0_arm64.whl.
File metadata
- Download URL: rocketsim-2.2.0-0-cp39-abi3-macosx_14_0_arm64.whl
- Upload date:
- Size: 351.0 kB
- Tags: CPython 3.9+, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db5220eb126108c100558fdb91861f5031d6676e5ae164300eded0bcc7951ae7
|
|
| MD5 |
436a30c36bd6ddc6ef0273f0f07c6cc5
|
|
| BLAKE2b-256 |
274a88855bfb49a07f8955b5102880a33dbecea2115c02957f984d6c0632e48e
|
Provenance
The following attestation bundles were made for rocketsim-2.2.0-0-cp39-abi3-macosx_14_0_arm64.whl:
Publisher:
main.yml on mtheall/RocketSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rocketsim-2.2.0-0-cp39-abi3-macosx_14_0_arm64.whl -
Subject digest:
db5220eb126108c100558fdb91861f5031d6676e5ae164300eded0bcc7951ae7 - Sigstore transparency entry: 927322228
- Sigstore integration time:
-
Permalink:
mtheall/RocketSim@2277369f6f3101afd2e0c8122f1e8f939dd14b46 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/mtheall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@2277369f6f3101afd2e0c8122f1e8f939dd14b46 -
Trigger Event:
push
-
Statement type: