rlviser-py


Namerlviser-py JSON
Version 0.6.9 PyPI version JSON
download
home_pageNone
SummaryPython implementation that manages a UDP connection to RLViser
upload_time2024-07-08 15:48:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT
keywords rlviser rocket-league udp python rlbot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## rlviser-py

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.

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

### Example usage

```python
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()
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rlviser-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "rlviser, rocket-league, udp, python, rlbot",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4e/58/2fb82c73b60f0617d2aef17b910c51ed77b75a141bd0e40a9cd250060626/rlviser_py-0.6.9.tar.gz",
    "platform": null,
    "description": "## 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\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python implementation that manages a UDP connection to RLViser",
    "version": "0.6.9",
    "project_urls": {
        "Source Code": "https://github.com/VirxEC/rlviser-py"
    },
    "split_keywords": [
        "rlviser",
        " rocket-league",
        " udp",
        " python",
        " rlbot"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dfbcf4a7cb1667513183d8410b337fb72b1246ebf9fa1dc06d5be889aa7869bb",
                "md5": "d46d5046399713a3c8ddaf2780ecb317",
                "sha256": "d38d340c80e5a3057a6cc2b09743350d5554ea1f48ecdd6aa604ad47be0c2e53"
            },
            "downloads": -1,
            "filename": "rlviser_py-0.6.9-cp37-abi3-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "d46d5046399713a3c8ddaf2780ecb317",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 201157,
            "upload_time": "2024-07-08T15:48:39",
            "upload_time_iso_8601": "2024-07-08T15:48:39.205381Z",
            "url": "https://files.pythonhosted.org/packages/df/bc/f4a7cb1667513183d8410b337fb72b1246ebf9fa1dc06d5be889aa7869bb/rlviser_py-0.6.9-cp37-abi3-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d77b25ea113113f408a084a1e27192a062d3761fb359430e4741277f336ff0e1",
                "md5": "edbf6dc4b3ce26d673e2ad45ee472ee5",
                "sha256": "40327ec20548349ffbc31e904ea67b38b2355e2b92fcd487baff2c2d7776d5db"
            },
            "downloads": -1,
            "filename": "rlviser_py-0.6.9-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "edbf6dc4b3ce26d673e2ad45ee472ee5",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 225058,
            "upload_time": "2024-07-08T15:48:40",
            "upload_time_iso_8601": "2024-07-08T15:48:40.645088Z",
            "url": "https://files.pythonhosted.org/packages/d7/7b/25ea113113f408a084a1e27192a062d3761fb359430e4741277f336ff0e1/rlviser_py-0.6.9-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "045ed5b2d0fbc3c21236c46f0aac8d33dde8c7268f9e763b7a0580712a2492e5",
                "md5": "49ab34867069d6302e05a526b00b3713",
                "sha256": "5204ab11e6c7f58e7dd48ee3528d2afbf773507e11aaa77cb24c4ce9f5e9ce61"
            },
            "downloads": -1,
            "filename": "rlviser_py-0.6.9-cp37-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "49ab34867069d6302e05a526b00b3713",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 153387,
            "upload_time": "2024-07-08T15:48:42",
            "upload_time_iso_8601": "2024-07-08T15:48:42.925139Z",
            "url": "https://files.pythonhosted.org/packages/04/5e/d5b2d0fbc3c21236c46f0aac8d33dde8c7268f9e763b7a0580712a2492e5/rlviser_py-0.6.9-cp37-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4e582fb82c73b60f0617d2aef17b910c51ed77b75a141bd0e40a9cd250060626",
                "md5": "e3dac749deb3af718069dc88321f5e8c",
                "sha256": "7679198d2181afef95d1a3c945ecf1fa489f05fe3d3ff1d2ec22f494724501ea"
            },
            "downloads": -1,
            "filename": "rlviser_py-0.6.9.tar.gz",
            "has_sig": false,
            "md5_digest": "e3dac749deb3af718069dc88321f5e8c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 13554,
            "upload_time": "2024-07-08T15:48:44",
            "upload_time_iso_8601": "2024-07-08T15:48:44.371233Z",
            "url": "https://files.pythonhosted.org/packages/4e/58/2fb82c73b60f0617d2aef17b910c51ed77b75a141bd0e40a9cd250060626/rlviser_py-0.6.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-08 15:48:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "VirxEC",
    "github_project": "rlviser-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rlviser-py"
}
        
Elapsed time: 1.03240s