https://github.com/virxec/rl_ball_sym_pybinds
RLBot Python bindings for the Rust crate rl_ball_sym
https://github.com/virxec/rl_ball_sym_pybinds
python rlbot rocket-league rust simulation
Last synced: 2 months ago
JSON representation
RLBot Python bindings for the Rust crate rl_ball_sym
- Host: GitHub
- URL: https://github.com/virxec/rl_ball_sym_pybinds
- Owner: VirxEC
- License: mit
- Created: 2021-07-06T22:23:27.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-05T23:04:10.000Z (11 months ago)
- Last Synced: 2024-07-06T03:06:32.206Z (11 months ago)
- Topics: python, rlbot, rocket-league, rust, simulation
- Language: Rust
- Homepage:
- Size: 412 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RLBot Python bindings for rl_ball_sym
[](https://forthebadge.com)
Pre-built binaries for Python 3.10 and beyond in Windows & Linux can be found [here in the build artifacts for the latest workflow run](https://github.com/VirxEC/rl_ball_sym_pybinds/actions).
## Prerequisites
+ [Rust & Cargo](https://www.rust-lang.org/)
+ [RLBot](https://rlbot.org) - Verify that the file `%localappdata%\RLBotGUIX\Python311\python.exe` exists. If it doesn't, please re-download and re-install from the website to update.
+ Maturin - Downloaded onto your main global Python installation, you can install via `pip install maturin`## Steps to build the Python bindings
1. Download this repository
2. Run `develop.bat`
3. The package will be automatically installed into RLBot's Python installation
4. `import rl_ball_sym_pybinds` in your Python file## Basic usage in an RLBot script to render the path prediction
See `script.cfg` and `script.py` for a pre-made script that renders the framework's ball path prediction in green and the rl_ball_sym's ball path prediction in red.
```python
from traceback import print_excfrom rlbot.agents.base_script import BaseScript
from rlbot.utils.structures.game_data_struct import GameTickPacketimport rl_ball_sym_pybinds as rlbs
class rl_ball_sym(BaseScript):
def __init__(self):
super().__init__("rl_ball_sym")def main(self):
rlbs.load_standard()while 1:
try:
self.packet: GameTickPacket = self.wait_game_tick_packet()
rlbs.tick(self.packet)
path_prediction = rlbs.get_ball_prediction_struct()self.renderer.begin_rendering()
self.renderer.draw_polyline_3d(tuple(path_prediction.slices[i].location for i in range(0, path_prediction.num_slices)), self.renderer.red())
self.renderer.end_rendering()
except Exception:
print_exc()if __name__ == "__main__":
rl_ball_sym = rl_ball_sym()
rl_ball_sym.main()
```## Documentation
For documentation, see `rl_ball_sym_pybinds.pyi`.
## Benchmarks
Results of `pytest.py`:
