Example of a Rocket League bot implemented in C#
- Make sure you've installed Python 3.6 64 bit. During installation:
- Select "Add Python to PATH"
- Make sure pip is included in the installation
- Make sure you've installed the .NET Framework 4.6.1 (or newer)
- Open Rocket League
- Double click on the bot executable (
RLBotCSharpExample/RLBotCSharpExample/bin/x64/Release/RLBotCSharpExample.exe) and leave it running. - Double click on run-gui.bat
- Click the 'Run' button
- Bot behavior is controlled by
RLBotCSharpExample/RLBotCSharpExample/ExampleBot.cs - Bot appearance is controlled by
CSharpPythonAgent/appearance.cfg - The bot executable's folder MUST contain
FlatBuffers.dllandRLBotDotNet.dll. - The bot executable's folder MUST contain a folder called
dllcontainingRLBot_Core_Interface.dll. - The port given in
port.cfgMUST match the port given to BotManager in the C# project.
The bot executable should work out of the box, however you'll want to recompile after making your own changes.
You won't need to recompile anything other than the bot but if you want the latest and greatest, you can also recompile FlatBuffers.dll, RLBotDotNet.dll, and RLBot_Core_Interface.dll. If you choose to recompile the DLLs, make sure that the bot project references the new DLLs you recompiled.
- Open
RLBotCSharpExample/RLBotCSharpExample.slnin Visual Studio 2015 or newer. - Click Build in the menu, then click Build Solution (or press Ctrl+Shift+B).
- The compiled executable should appear in a folder in
RLBotCSharpExample/RLBotCSharpExample/bin.
The example bot references both RLBotDotNet.dll and FlatBuffers.dll.
- Download/clone the FlatBuffers repository.
- Open
FlatBuffers.csproj(located innet/FlatBuffers). - Choose your configurations and build the project.
- Download/clone TheBlocks' fork's csharp-port branch.
- Open
RLBotDotNet.sln(located insrc/main/cs/RLBotDotNet). - Choose your configurations and build the solution.
- Download/clone the RLBot repository.
- Open
RLBotInterface.sln(located insrc/main/cpp/RLBotInterface). - Choose your configurations and build the solution.
The instructions for building the interface should be in the README in the above repository's interface solution folder.
The C# bot executable is a server that listens for Python clients.
When CSharpPythonAgent/CSharpPythonAgent.py is started by the RLBot framework, it connects to the C# bot server and tells it its info.
Then the C# bot server controls the bot through the RLBot_Core_Interface DLL.