Expand description

RLBot is a framework for creating offline Rocket League bots. This crate lets you write bots using a simple, safe interface that should feel comfortable to Rust developers.
Most types in this crate are exported directly from RLBot, so for anything not documented here, you’ll need to use RLBot’s docs as the authoritative reference.
There are two ways to use this crate:
run_bot
andBot
– This is the high-level interface. It plays a single match from start to finish. It expects the app to have been launched by the RLBot framework, and runs its own game loop under framework control.init
andRLBot
– This is the low-level interface. You can use this to directly access the innards of RLBot for scripting, integration tests, or any other custom use-case.
§Examples
This crate comes with plenty examples to get you started. All the examples can be run directly from the repo. Follow these steps to run an example:
-
Run Rocket League with the
-rlbot
flag. The flag causes Rocket League to start a local UDP server that lets RLBot control the game. It also disables the online features of the game.Steam.exe -applaunch 252950 -rlbot
-
Run
RLBot.exe
, which is included as part of the Pythonrlbot
package. This is a service process that helps bots communicate with the game. -
Run the example (here we run the example called
simple
):cargo run --example simple
§examples/simple (Source)
This is a simple ATBA, or Always Towards Ball Agent.
Key APIs:
§examples/simple_flatbuffer (Source)
Another ATBA, but using the lower-level flatbuffer functions. All of the low-level functions in RLBot’s interface make use of flatbuffers.
Key APIs:
Packeteer::next_flatbuffer
- [
RLBot::update_player_input_flatbuffer
]
§examples/rendering (Source)
This example shows how to draw simple shapes to the game window. If you don’t see anything, try pressing PageUp, which is RLBot’s shortcut for turning on rendering.
Key APIs:
§examples/gravity (Source)
A fun example showing how to set game state.
Key APIs:
- [
RLBot::set_game_state_struct
]
§examples/gravity_flatbuffer (Source)
This works exactly the same as the previous example, except it uses the low-level flatbuffer interface.
Key APIs:
§examples/bot (Source)
I saved the best for last. This is a full-fledged RLBot bot that can run within the RLBot framework. It’s different than the other examples, in that it requires a working RLBot Python setup. Follow the instructions in RLBotPythonExample to make sure you have all the necessary dependencies installed. Once you have that working, you are ready to roll.
Do not run Rocket League or RLBot.exe—the framework will take care of that automatically. Just run this command:
cargo build --example bot && python -c "from rlbot import runner; runner.main()"
Key APIs:
Modules§
Structs§
- Ball
Info - Boost
PadState - Color
- A color that can be used to draw in a
RenderGroup
. - Controller
State - The inputs that control a car.
- Desired
Ball State - State which can be set on the ball.
- Desired
Boost State - State which can be set for a boost pickup.
- Desired
CarState - State which can be set on a car.
- Desired
Game Info State - State which can be set for a boost pickup.
- Desired
Game State - The top-level struct containing all settable game state.
- Desired
Physics - Rigid-body state which can be set.
- Dropshot
Ball Info - Dropshot
Tile - Framework
Args - The arguments passed by the RLBot framework.
- Game
Info - Game
Tick Packet - Init
Options - Options for customizing the way the framework is initialized.
- Loadout
Paint - Specification for ‘painted’ items. See https://github.com/RLBot/RLBot/wiki/Bot-Customization
- Match
Settings - Options for starting a match.
- Mutator
Settings - Packeteer
- An iterator-like object that yields packets from the game as they occur.
- Physicist
- An iterator-like object that yields physics ticks from the game as they occur.
- Physics
- Player
Configuration - Describes one of the players in a match.
- Player
Info - Player
Loadout - The car type, color, and other aspects of the player’s appearance. See https://github.com/RLBot/RLBot/wiki/Bot-Customization
- Psyonix
BotPlayer - A psyonix bot, e.g. All Star bot
- Quaternion
- Expresses the rotation state of an object. Learn about quaternions here: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation You can tinker with them here to build an intuition: https://quaternions.online/
- RLBot
- The low-level interface to RLBot. All RLBot calls that are available can be made through this struct.
- Render
Group - A render group in the process of being built.
- Rotator
- Expresses the rotation state of an object in Euler angles, with values in radians.
- Rotator
Partial - A rotation in 3D space represented by Euler angles.
- Score
Info - Team
Info - Touch
- Represents contact between a car and the ball.
- Vector3
- Vector3
Partial - Represents a vector in 3D space.
Enums§
- Ball
Bounciness Option - Ball
MaxSpeed Option - Ball
Size Option - Ball
Type Option - Ball
Weight Option - Boost
Option - Demolish
Option - GameMap
- Game
Mode - Game
Speed Option - Gravity
Option - Match
Length - MaxScore
- Overtime
Option - Player
Class - Respawn
Time Option - Rumble
Option - Series
Length Option - Tile
State
Traits§
- Bot
- A bot that can run within the RLBot framework. Instances of
Bot
are used by therun_bot
function.
Functions§
- init
- Initializes RLBot and returns a ready-to-use
RLBot
object. - init_
with_ options - Initializes RLBot and returns a ready-to-use
RLBot
object. - parse_
framework_ args - Parse the arguments passed by the RLBot framework.
- run_bot
- Runs a bot under control of the RLBot framework.