Example of a Python bot using the RLBot framework
- 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.exe
and place it in the root directory - Modify
rlbot.toml
to your liking- Note:
dev.toml
also 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.toml
in 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_name
will be the name of your bot's folder in the botpackbot_configs
is a list of bot configs that will be included in the botpackbuilder_type
should always bepyinstaller
entry_file
is the name of the spec file
-
Commit both
bot.spec
andbob.toml
to your bot's repository. Note thatbob.toml
CANNOT be renamed, butbot.spec
can be anything as long asentry_file
is also renamed to reflect the change.