Skip to main content

rlviser-py

Python implementation that manages a UDP connection to RLViser, it launches the RLViser binary from the current working directory upon first calling any render function.

The backbone of RLGym's env.render() functionality.

Example usage

import time

import rlviser_py as vis
import RocketSim as rs

game_mode = rs.GameMode.SOCCAR

# Create example arena
arena = rs.Arena(game_mode)

# Set boost pad locations
vis.set_boost_pad_locations([pad.get_pos().as_tuple() for pad in arena.get_boost_pads()])

# Setup example arena
car = arena.add_car(rs.Team.BLUE)
car.set_state(rs.CarState(pos=rs.Vec(z=17), vel=rs.Vec(x=50), boost=100))
arena.ball.set_state(rs.BallState(pos=rs.Vec(y=400, z=100), ang_vel=rs.Vec(x=5)))
car.set_controls(rs.CarControls(throttle=1, steer=1, boost=True))

# Run for 3 seconds
TIME = 3

steps = 0
start_time = time.time()
for i in range(round(TIME * arena.tick_rate)):
    arena.step(1)

    # Render the current game state
    pad_states = [pad.get_state().is_active for pad in arena.get_boost_pads()]
    ball = arena.ball.get_state()
    car_data = [
        (car.id, car.team, car.get_config(), car.get_state())
        for car in arena.get_cars()
    ]

    vis.render(steps, arena.tick_rate, game_mode, pad_states, ball, car_data)

    # sleep to simulate running real time (it will run a LOT after otherwise)
    time.sleep(max(0, start_time + steps / arena.tick_rate - time.time()))
    steps += 1

# Tell RLViser to exit
print("Exiting...")
vis.quit()

Metadata

Release files for rlviser-py 0.6.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rlviser-py 0.6.14
File Size Uploaded
rlviser_py-0.6.14.tar.gz 23.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rlviser-py 0.6.14
File Interpreter ABI Platform
rlviser_py-0.6.14-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
rlviser_py-0.6.14-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
rlviser_py-0.6.14-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details

Total release size: 762.2 kB

Release files / rlviser_py-0.6.14.tar.gz

Download URL rlviser_py-0.6.14.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
555ac09f8ce8a36e42104e1899b01c6efaa3988b9c30f2d69ad2cecccb468960
BLAKE2b-256 checksum
How to use checksums
1b98393a9d5c33749c50105bfa8ec7f16559d674c9dd2d8a3ac3d165e9020995
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.13.3

Release files / rlviser_py-0.6.14-cp37-abi3-win_amd64.whl

Download URL rlviser_py-0.6.14-cp37-abi3-win_amd64.whl
Size 202.8 kB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9fd2e5e61df26df3ec5c6d0d4997276dcdd27d259a7a433d0d78ca17744ff167
BLAKE2b-256 checksum
How to use checksums
851915c46bb0824c1d1d193b69209a3e5ec7348408aeae864fabd4d0e87311f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.13.3

Release files / rlviser_py-0.6.14-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rlviser_py-0.6.14-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 285.7 kB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
16713fb38aeda60475d86ec014bfcad4c6fc50bcf3e49e4f553ef3debcd77cb6
BLAKE2b-256 checksum
How to use checksums
342b601a39cff6ad707645f7fb61752228af057c5a93017f16f80488bef13461
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.13.3

Release files / rlviser_py-0.6.14-cp37-abi3-macosx_11_0_arm64.whl

Download URL rlviser_py-0.6.14-cp37-abi3-macosx_11_0_arm64.whl
Size 250.0 kB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0e8889b0620e8509cf953088bd8cb183647eef7c1f1d733d2482db87275468c3
BLAKE2b-256 checksum
How to use checksums
c3b83b7a10572a3ed43304189c13b7bdf443863335ac7cc150f2dafe14c728e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.13.3

Release history Release notifications | RSS feed

This release

0.6.14 This release

4 release files

0.6.13

4 release files

0.6.12

4 release files

0.6.11

4 release files

0.6.10

4 release files

0.6.9

4 release files

0.6.8

4 release files

0.6.7

4 release files

0.6.6

4 release files

0.6.5

4 release files

0.6.4

4 release files

0.6.3

4 release files

0.6.2

4 release files

0.6.1

4 release files

0.6.0

4 release files

0.5.0

4 release files

0.4.1

4 release files

0.4.0

4 release files

0.3.2

4 release files

0.3.1

4 release files

0.3.0

4 release files

0.2.3

4 release files

0.2.2

4 release files

0.2.0

4 release files

0.1.1

4 release files

0.1.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page