Example of a Python bot using the RLBot framework
Wiki: RLBot/python-interface/wiki
- Install Python 3.11 or later
- Create a Python virtual environment
python3 -m venv venv
- Activate the virtual environment
- Windows:
.\venv\Scripts\activate - Linux:
source venv/bin/activate
- Windows:
- Install the required packages
pip install -r requirements.txt
- Download
RLBotServer.exeand place it in the root directory - Modify
rlbot.tomlto your liking- Note:
dev.tomlalso exists with a few changed settings that might be useful for development
- Note:
- Start a match with
python run.py
- Bot behavior is controlled by
src/bot.py - Bot appearance is controlled by
src/loadout.toml
-
pip install pyinstaller -
pyinstaller --onefile src/bot.py --paths src- This will create a file calledbot.spec. -
Create
bob.tomlin the same directory as the spec file with the following content:[[config]] project_name = "PythonExample" bot_configs = ["src/bot.toml"] [config.builder_config] builder_type = "pyinstaller" entry_file = "bot.spec"
project_namewill be the name of your bot's folder in the botpackbot_configsis a list of bot configs that will be included in the botpackbuilder_typeshould always bepyinstallerentry_fileis the name of the spec file
-
Commit both
bot.specandbob.tomlto your bot's repository. Note thatbob.tomlCANNOT be renamed, butbot.speccan be anything as long asentry_fileis also renamed to reflect the change.