Skip to content

Commit

Permalink
Add supplimental resources
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Jun 6, 2023
1 parent 89536eb commit 9e0e46c
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 40 deletions.
61 changes: 26 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
[package]
name = "rlviser-py"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
description = "Python implementation that manages a UDP connection to RLViser"
license = "MIT"
repository = "https://github.com/VirxEC/rlviser-py"
readme = "README.md"
keywords = ["rlviser", "rocket-league", "udp", "python", "rlbot"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "rlviser_py"
crate-type = ["rlib", "cdylib"]
crate-type = ["cdylib"]

[dependencies]
glam = "0.24.0"
Expand All @@ -16,5 +21,6 @@ pyo3 = "0.19.0"
[profile.release]
lto = true
strip = true
opt-level = "z"
codegen-units = 1
panic = "abort"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## rlviser-py

[![forthebadge](https://forthebadge.com/images/badges/made-with-rust.svg)](https://forthebadge.com)

Python implementation that manages a UDP connection to RLViser, it launches the [RLViser binary](https://github.com/VirxEC/rlviser) from the current working directory upon first calling any render function.

Currently able to visualize RLGym GameState objects, but requires the boost pad locations to be sent first.

The backbone of RLGym's `env.render()` functionality.
13 changes: 13 additions & 0 deletions rlviser_py.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def set_boost_pad_locations(locations: list) -> ...:
pass

try:
from rlgym_sim.utils.gamestates.game_state import GameState

def render_rlgym(gym_state: GameState) -> ...:
pass
except ImportError:
pass

def quit() -> ...:
pass
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub const OCTANE: CarConfig = CarConfig {

/// Reads the RLGym state and sends it to RLViser to render
#[pyfunction]
fn render_rlgym(gym_state: GymState) -> PyResult<()> {
fn render_rlgym(gym_state: GymState) {
// construct the game state
let game_state = GameState {
tick_count: TICK_COUNT.fetch_add(1, Ordering::SeqCst),
Expand Down Expand Up @@ -125,8 +125,6 @@ fn render_rlgym(gym_state: GymState) -> PyResult<()> {
};

socket::send_game_state(&game_state).unwrap();

Ok(())
}

/// Send the quit signal to RLViser
Expand Down

0 comments on commit 9e0e46c

Please sign in to comment.