Skip to main content

This is Rocket League!

Project description

image

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, Dropshot, 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

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rocketsim-2.2.1-0-cp36-abi3-win_amd64.whl (395.7 kB view details)

Uploaded CPython 3.6+Windows x86-64

rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_x86_64.whl (596.4 kB view details)

Uploaded CPython 3.6+manylinux: glibc 2.27+ x86-64

rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_aarch64.whl (565.6 kB view details)

Uploaded CPython 3.6+manylinux: glibc 2.27+ ARM64

rocketsim-2.2.1-0-cp36-abi3-macosx_14_0_arm64.whl (351.1 kB view details)

Uploaded CPython 3.6+macOS 14.0+ ARM64

File details

Details for the file rocketsim-2.2.1-0-cp36-abi3-win_amd64.whl.

File metadata

  • Download URL: rocketsim-2.2.1-0-cp36-abi3-win_amd64.whl
  • Upload date:
  • Size: 395.7 kB
  • Tags: CPython 3.6+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rocketsim-2.2.1-0-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e5a8bce3883e0f11a75b9bb23600ca7465ef9a455862985da355857f2cb0d9c3
MD5 e2a98e144a586ec5336dc6c4d8cb6c07
BLAKE2b-256 59a806a952a92095bcd833d07599a04027e6c22f2b8ddb53e68758e9c661f2de

See more details on using hashes here.

Provenance

The following attestation bundles were made for rocketsim-2.2.1-0-cp36-abi3-win_amd64.whl:

Publisher: main.yml on mtheall/RocketSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 2f9518e9895447d2480680b7825866e881981102c66365c1d9fea62589a0dd9d
MD5 636cbc2e4c58ebd1b4241846bfea7cc1
BLAKE2b-256 0b5d949c965df733e25c1de1de1de3e4fa023d600ac7170356fc9fd17dea36ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_x86_64.whl:

Publisher: main.yml on mtheall/RocketSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_aarch64.whl.

File metadata

File hashes

Hashes for rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_aarch64.whl
Algorithm Hash digest
SHA256 b244a9c0070a43c746d522f8286efa0ddff703ddc8e45caa6e182d352953254a
MD5 fc3d8f9545b9095f05337da39cda9495
BLAKE2b-256 540586b5a72b0200dfc1e023da2177cfdf60a6d7add300940dd63678ae97a573

See more details on using hashes here.

Provenance

The following attestation bundles were made for rocketsim-2.2.1-0-cp36-abi3-manylinux_2_27_aarch64.whl:

Publisher: main.yml on mtheall/RocketSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rocketsim-2.2.1-0-cp36-abi3-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for rocketsim-2.2.1-0-cp36-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ea2fac9d1b5dec59fe394a1ce1fdc704fc60601d506bb0adbc839b6a76cf4840
MD5 973f42419fed19d2810577faa5f79197
BLAKE2b-256 81c34ddc46cb2c0d38721f73d1ede93520f6f3a198e33b70467f27b074580e79

See more details on using hashes here.

Provenance

The following attestation bundles were made for rocketsim-2.2.1-0-cp36-abi3-macosx_14_0_arm64.whl:

Publisher: main.yml on mtheall/RocketSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page