{"id":26159630,"url":"https://github.com/virxec/rlviser-py","last_synced_at":"2025-06-11T03:37:22.842Z","repository":{"id":173041717,"uuid":"649761586","full_name":"VirxEC/rlviser-py","owner":"VirxEC","description":"Easy communication with RLViser from Python","archived":false,"fork":false,"pushed_at":"2024-07-08T15:46:00.000Z","size":68,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T03:38:52.111Z","etag":null,"topics":["pyo3","python","rlbot","rlgym","rust"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/rlviser-py/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VirxEC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-05T15:18:43.000Z","updated_at":"2024-07-08T15:45:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"7735d28f-6963-485b-9b1f-1b71c68b4a1f","html_url":"https://github.com/VirxEC/rlviser-py","commit_stats":null,"previous_names":["virxec/rlviser-py"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frlviser-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frlviser-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frlviser-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frlviser-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VirxEC","download_url":"https://codeload.github.com/VirxEC/rlviser-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868772,"owners_count":21174757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pyo3","python","rlbot","rlgym","rust"],"created_at":"2025-03-11T11:33:06.361Z","updated_at":"2025-04-14T10:53:53.971Z","avatar_url":"https://github.com/VirxEC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## rlviser-py\n\nPython 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.\n\nThe backbone of RLGym's `env.render()` functionality.\n\n### Example usage\n\n```python\nimport time\n\nimport rlviser_py as vis\nimport RocketSim as rs\n\ngame_mode = rs.GameMode.SOCCAR\n\n# Create example arena\narena = rs.Arena(game_mode)\n\n# Set boost pad locations\nvis.set_boost_pad_locations([pad.get_pos().as_tuple() for pad in arena.get_boost_pads()])\n\n# Setup example arena\ncar = arena.add_car(rs.Team.BLUE)\ncar.set_state(rs.CarState(pos=rs.Vec(z=17), vel=rs.Vec(x=50), boost=100))\narena.ball.set_state(rs.BallState(pos=rs.Vec(y=400, z=100), ang_vel=rs.Vec(x=5)))\ncar.set_controls(rs.CarControls(throttle=1, steer=1, boost=True))\n\n# Run for 3 seconds\nTIME = 3\n\nsteps = 0\nstart_time = time.time()\nfor i in range(round(TIME * arena.tick_rate)):\n    arena.step(1)\n\n    # Render the current game state\n    pad_states = [pad.get_state().is_active for pad in arena.get_boost_pads()]\n    ball = arena.ball.get_state()\n    car_data = [\n        (car.id, car.team, car.get_config(), car.get_state())\n        for car in arena.get_cars()\n    ]\n\n    vis.render(steps, arena.tick_rate, game_mode, pad_states, ball, car_data)\n\n    # sleep to simulate running real time (it will run a LOT after otherwise)\n    time.sleep(max(0, start_time + steps / arena.tick_rate - time.time()))\n    steps += 1\n\n# Tell RLViser to exit\nprint(\"Exiting...\")\nvis.quit()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirxec%2Frlviser-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirxec%2Frlviser-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirxec%2Frlviser-py/lists"}