Skip to main content

Python bindings for RocketSim - Rocket League physics simulation

Project description

nitro-sim

Python bindings for RocketSim - High-performance Rocket League physics simulation.

Quick Start

# Install in development mode
uv sync

# Verify installation
uv run python -c "import nitro as rs; print('Version:', rs.__version__)"

# Run tests
uv run pytest tests/

Usage

Direct API

import nitro as rs

# Initialize RocketSim
rs.init("collision_meshes")

# Create arena
arena = rs.Arena.create(rs.GameMode.SOCCAR, tick_rate=120.0)

# Add cars
car1 = arena.add_car(rs.Team.BLUE, rs.CAR_CONFIG_OCTANE)
car2 = arena.add_car(rs.Team.ORANGE, rs.CAR_CONFIG_DOMINUS)

# Set controls
car1.controls.throttle = 1.0
car1.controls.boost = True

# Simulate
arena.step(120)  # 1 second

# Get state
state = car1.get_state()
print(f"Position: {state.pos}")
print(f"Velocity: {state.vel.length()}")

PettingZoo API (for Multi-Agent RL)

from pettingzoo_env import parallel_env

# Create 2v2 environment
env = parallel_env(num_blue=2, num_orange=2)

# Reset
observations, infos = env.reset(seed=42)

# Training loop
while env.agents:
    actions = {
        agent: policy(observations[agent])  # Your RL policy here
        for agent in env.agents
    }
    observations, rewards, terminations, truncations, infos = env.step(actions)

env.close()

Features

  • Complete RocketSim API - All major types and functions exposed
  • PettingZoo API - Multi-agent RL compatible interface
  • Ball Prediction - Predict ball trajectories for AI/bots
  • Event Tracking - Detect shots, goals, saves, and assists
  • Callbacks - React to goals, bumps, and game events
  • Type hints - Full LSP/autocomplete support with .pyi stubs
  • Pythonic - Snake_case naming, properties, and operators
  • Fast - Direct C++ bindings with minimal overhead
  • Tested - 85 passing tests covering all functionality

Examples

See the examples/ folder for:

  • example_advanced.py - Ball prediction, event tracking, callbacks
  • test_autocomplete.py - Basic usage and IDE autocomplete demo

Building

# Development install
uv sync

# Build wheel
uv build

# Install from wheel
pip install dist/*.whl

See BUILD.md for detailed build instructions and troubleshooting.

Testing

# Run all tests (auto-downloads collision meshes)
uv run pytest tests/

# Run without collision meshes
uv run pytest tests/ -k "not simulation and not boost and not prediction"

See tests/README.md for more testing options.

Requirements

  • Python 3.12+
  • CMake 3.15+
  • C++20 compiler
  • Collision meshes (auto-downloaded in tests)

Test Results

$ uv run pytest tests/
================= 85 passed, 2 skipped in 2.09s =================

Includes tests for:

  • Core API (72 tests)
  • PettingZoo API (13 tests)

License

This project provides Python bindings for RocketSim. See LICENSE for details.

Project details


Download files

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

Source Distribution

nitro_sim-0.1.0.tar.gz (492.2 kB view details)

Uploaded Source

Built Distributions

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

nitro_sim-0.1.0-cp313-cp313-win_amd64.whl (470.6 kB view details)

Uploaded CPython 3.13Windows x86-64

nitro_sim-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (731.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

nitro_sim-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (472.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

nitro_sim-0.1.0-cp313-cp313-macosx_10_15_x86_64.whl (530.2 kB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

nitro_sim-0.1.0-cp312-cp312-win_amd64.whl (470.6 kB view details)

Uploaded CPython 3.12Windows x86-64

nitro_sim-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (731.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

nitro_sim-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (472.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

nitro_sim-0.1.0-cp312-cp312-macosx_10_15_x86_64.whl (530.3 kB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

File details

Details for the file nitro_sim-0.1.0.tar.gz.

File metadata

  • Download URL: nitro_sim-0.1.0.tar.gz
  • Upload date:
  • Size: 492.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nitro_sim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1be924afae89430356f5b0b319ce751d53e9352a0a92c5c6b2baea8e79808b6
MD5 ca08f879ae437a37f717ad29e655fcc0
BLAKE2b-256 a030746ea9769f1ee58c77b8bdfd9cf87d87d1d20f3967ff66d452917723710a

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0.tar.gz:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nitro_sim-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 470.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nitro_sim-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 401898e55604e271feb247dcce0e8e8668502939461d17715f5ddb18d05a4589
MD5 1890f903e8bb9b6e2414db204910e9a2
BLAKE2b-256 ea8c31ed95144db3bc3f7fba01289c0f15af90f06dd95cd2e4e8bbcd1c7f384d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp313-cp313-win_amd64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nitro_sim-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 af71e2e287d385af2adaf092b3db9f180a6905b9a9e4bc4ec7cd517e2101c67a
MD5 d46200d8d212d6ca849fee506c9aba2b
BLAKE2b-256 6cd557fe0bdd4d6a7409bc755e7a788a372da5740dd4d9b2f0b8293ceade5b9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nitro_sim-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 067f07450293939c83dcf052f2a6d1b59de52a5403f322be6312897175d951ca
MD5 7dbe8e77daaf346f74f56576e55e5889
BLAKE2b-256 b2937446fdc9c3ef7fdfb178a392863dba60fcca368b9a2dd30530d21b65de64

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp313-cp313-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for nitro_sim-0.1.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fa530b173b17b439f7bbf8f55f64fe39c438d109d209af4a0974f8d85e9c54f1
MD5 126e965618e2a68f17cc9d8ceee32810
BLAKE2b-256 1d5d1364edd0f8f41ca9af703040784af6e65d56742907065b25bc2f728ed668

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp313-cp313-macosx_10_15_x86_64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: nitro_sim-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 470.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nitro_sim-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bc43a644ab896b168aed9dae28eb22c177f0941902f2084091ac9881c684c2e1
MD5 0b2ae52f87cbec40a3bc32c0a3b83d35
BLAKE2b-256 1bc41fcc7c5ba6f0b78118032c576b8ac3d012b1bb4f058172f362e5af52ca15

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nitro_sim-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 da0164b54219fca2cdcaa847991719bbb265c3b2225d705fce869b9b95ebf9b4
MD5 8b12e5b71a7cfed8e38f131ec7ce1883
BLAKE2b-256 0eaca79ec43866b61befb89ac285032d015f87559bd17e5869bbf4dbe6fd0e24

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nitro_sim-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 10b1d8d2c7150fac090978c64ba4807bbe5a4a18c2c01695ae9e60de838595d8
MD5 e0260e23c95d3593288b3b8f8eddb90e
BLAKE2b-256 0d085b314bff623aea77df8cadf3bee4a6b92519304c822eeb2c5f4d324ae855

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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

File details

Details for the file nitro_sim-0.1.0-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for nitro_sim-0.1.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d520eb57336a0f9420a353be5e8fbf6f64755a45f56be42ba407aae725440b01
MD5 a40d0cb2eed9a5b9613988711e377ad6
BLAKE2b-256 1c4eba2910a05b2665797ab9584b2921a96f581b42d2a90299b94d2a5fe2d613

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitro_sim-0.1.0-cp312-cp312-macosx_10_15_x86_64.whl:

Publisher: build-wheels.yml on 2ToTheNthPower/nitro

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