This repository provides the necessary files to run a GigaLearnCPP agent within the RLBot framework for Rocket League.
The main purpose is to bridge the GigaLearn inference model with the RLBot client, allowing your trained bot to play in standard RLBot matches and events.
Before you begin, you should have:
- A working, compiled GigaLearnCPP project.
- RLBot installed and running on your machine.
You will need to replace files in your GigaLearnCPP directory to integrate the RLBot logic.
-
Copy
CMakeLists.txt:- Source:
CMakeLists.txtfrom this repository. - Destination: replace
GigaLearnCPP\CMakeLists.txt.
- Source:
-
Copy Source Files:
- Source:
RLBotClient.h,RLBotClient.cpp, andrlbotmain.cppfrom this repository. - Destination: Place these in
GigaLearnCPP\src\, replacing any existing files.
- Source:
-
Add the Agent Config:
- Source:
CppPythonAgent.cfgfrom this repository. - Destination:
GigaLearnCPP\rlbot\CppPythonAgent.cfg
- Source:
-
Set Your Executable Path: You must edit
CppPythonAgent.cfgto point to your compiled bot's executable.- Open
GigaLearnCPP\rlbot\CppPythonAgent.cfg. - Find the line
cpp_executable_path =. - Add the full path to your compiled
rlbot.exefile.
Example:
[Locations] # Path to the C++ executable cpp_executable_path = C:\path\to\your\GigaLearnCPP\build\Release\rlbot.exe
- Open
- After replacing the files, re-compile your GigaLearnCPP project and use regular build tool (ex: Visual Studio).
- Ensure you have a
checkpointsfolder with your trained model inside the same directory as your final executable (e.g.,GigaLearnCPP\build\Release\). The bot will automatically load the latest model. - Add the
GigaLearnCPP\rlbot\CppPythonAgent.cfgto rlbot. - Launch a match from the RLBot GUI, and your bot should appear.
By default, the bot loads the latest checkpoint. To force it to use a specific model, you can hardcode the path.
- Open
GigaLearnCPP\src\rlbotmain.cpp. - Find the commented-out line that begins with
// checkpointPath =. - Uncomment it and replace the path with the full path to your
POLICY.ltfile.
Example:
// On Windows, you must use double backslashes (\\) or forward slashes (/) in the path.
checkpointPath = "C:\\Users\\YourUser\\GigaLearnCPP\\build\\Release\\checkpoints\\14594451456\\POLICY.lt";-
Bot doesn't appear in RLBot?
- Double-check that the
cpp_executable_pathinCppPythonAgent.cfgis absolutely correct and points to therlbot.exefile you compiled.
- Double-check that the
-
Could not connect to server?
- Ensure CppPythonAgent.cfg correctly points to your compiled
rlbot.exe, and that the port numbers inrlbotmain.cppmatch the one inGigaLearnCPP\rlbot\port.cfg
- Ensure CppPythonAgent.cfg correctly points to your compiled
-
Event Loop Stopped?
- Make sure your port matches, if problem still occurs
pip install websockets==12.0
- Make sure your port matches, if problem still occurs
-
Ball prediction: Not supported. If your observation uses ball prediction, modify
rlbotmain.cppand pass a RocketSimArena to it. This is straightforward. -
Padded observations: Likely supported. To use, change:
auto obsBuilder = std::make_unique<AdvancedObs>();to
auto obsBuilder = std::make_unique<YourObsNamePadded>(3);Replace 3 with the value used during training.