├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENSE ├── README.md ├── examplebot.cc ├── examplebot.h ├── main.cc ├── port.cfg └── rlbot ├── CppPythonAgent.cfg ├── CppPythonAgent.py ├── RefreshEnv.cmd ├── appearance.cfg ├── port.cfg ├── requirements.txt ├── rlbot.cfg ├── run.bat └── run.sh /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeCache.txt 2 | CMakeFiles 3 | CMakeScripts 4 | Testing 5 | Makefile 6 | cmake_install.cmake 7 | install_manifest.txt 8 | compile_commands.json 9 | CTestTestfile.cmake 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "RLBotCPP"] 2 | path = RLBotCPP 3 | url = https://github.com/kipje13/RLBotCPP.git 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(CPPExampleBot LANGUAGES CXX) 3 | 4 | add_subdirectory(RLBotCPP) 5 | 6 | add_executable(CPPExampleBot main.cc examplebot.cc examplebot.h) 7 | target_include_directories(CPPExampleBot PRIVATE RLBotCPP/inc RLBotCPP/lib/inc) 8 | 9 | if (UNIX) 10 | target_link_libraries(CPPExampleBot RLBotCPP pthread) 11 | else (UNIX) 12 | target_link_libraries(CPPExampleBot RLBotCPP) 13 | endif (UNIX) 14 | 15 | target_compile_features(CPPExampleBot PRIVATE cxx_std_17) 16 | 17 | # Copy port config to output folder 18 | add_custom_command(TARGET CPPExampleBot POST_BUILD 19 | COMMAND ${CMAKE_COMMAND} -E copy_if_different 20 | "${PROJECT_SOURCE_DIR}/port.cfg" 21 | $) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 kipje13 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CPPExampleBot 2 | 3 | ### Prerequisites 4 | - Python 3.6 or 3.7 5 | - CMake 3.8 and higher 6 | - Compiler with c++17 support 7 | - GCC 8.1 and higher (9.1 if using mingw) 8 | - Visual studion 2017 and higher 9 | - Clang 7 and higher (not tested) 10 | 11 | ## How to use: 12 | - Make sure you've installed [Python 3.7 64 bit](https://www.python.org/downloads/). During installation: 13 | - Select "Add Python to PATH" 14 | - Make sure pip is included in the installation 15 | - Clone this repository by running: `git clone https://github.com/kipje13/CPPExampleBot.git --recursive` 16 | - Ensure that rlbot is installed on python by running `rlbot/run.bat`. You can shut it down again if it works. 17 | - Make sure you have CMake. If you don't have it, visit https://cmake.org/download/ and run the Windows win64-x64 Installer. 18 | - If you'd like to use Visual Studio for development: 19 | - Download Visual Studio from https://visualstudio.microsoft.com/. 20 | - In a command prompt (use a fresh one if you just installed cmake), navigate to the folder and run `cmake .` 21 | - Open Visual Studio and open the .sln file which now exists in the folder. 22 | - Confirm that Build->Build Solution works. 23 | - Right click on CPPExampleBot in the solution explorer and choose 'Set as StartUp Project' 24 | - Start a match by executing `rlbot/run.bat` 25 | - Choose Debug->Start Debugging (or F5), or press the green play button in Visual Studio. 26 | - Open up examplebot.cc and start changing stuff! Visual Studio has a restart button you can press (or Ctrl+Shift+F5) when you want to recompile and try your new changes. 27 | 28 | ## Auto-start 29 | The rlbot framework has the ability to launch the bot executable automatically. This is usefull when sharing your bot and usually required when you enter a tournament. 30 | 31 | In order to get auto-starting to work you will need to do the following things. 32 | - Build your bot executable. 33 | - Set the `cpp_executable_path` field in `rlbot/CppPythonAgent.cfg` so it points to the bot executable. It is recommended to copy your bot executable to the `rlbot` folder to make this process easier. 34 | 35 | ## Notes: 36 | - People might have issues when trying to run your bot if you have compiled it in debug mode. It is better to compile in release mode when you want to share your bot with others. 37 | -------------------------------------------------------------------------------- /examplebot.cc: -------------------------------------------------------------------------------- 1 | #include "examplebot.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "rlbot/bot.h" 8 | #include "rlbot/color.h" 9 | #include "rlbot/interface.h" 10 | #include "rlbot/rlbot_generated.h" 11 | #include "rlbot/scopedrenderer.h" 12 | #include "rlbot/statesetting.h" 13 | 14 | #define PI 3.1415 15 | 16 | ExampleBot::ExampleBot(int _index, int _team, std::string _name) 17 | : Bot(_index, _team, _name) { 18 | rlbot::GameState gamestate = rlbot::GameState(); 19 | 20 | gamestate.ballState.physicsState.location = {0, 0, 1000}; 21 | gamestate.ballState.physicsState.velocity = {0, 0, 5000}; 22 | 23 | rlbot::CarState carstate = rlbot::CarState(); 24 | carstate.physicsState.location = {0, 500, 1000}; 25 | carstate.physicsState.velocity = {500, 1000, 1000}; 26 | carstate.physicsState.angularVelocity = {1, 2, 3}; 27 | 28 | carstate.boostAmount = 50; 29 | 30 | gamestate.carStates[_index] = carstate; 31 | 32 | rlbot::Interface::SetGameState(gamestate); 33 | } 34 | 35 | ExampleBot::~ExampleBot() { 36 | // Free your allocated memory here. 37 | } 38 | 39 | rlbot::Controller ExampleBot::GetOutput(rlbot::GameTickPacket gametickpacket) { 40 | 41 | rlbot::flat::Vector3 ballLocation = 42 | *gametickpacket->ball()->physics()->location(); 43 | rlbot::flat::Vector3 ballVelocity = 44 | *gametickpacket->ball()->physics()->velocity(); 45 | rlbot::flat::Vector3 carLocation = 46 | *gametickpacket->players()->Get(index)->physics()->location(); 47 | rlbot::flat::Rotator carRotation = 48 | *gametickpacket->players()->Get(index)->physics()->rotation(); 49 | 50 | // Calculate the velocity of the ball. 51 | float velocity = sqrt(ballVelocity.x() * ballVelocity.x() + 52 | ballVelocity.y() * ballVelocity.y() + 53 | ballVelocity.z() * ballVelocity.z()); 54 | 55 | // This renderer will build and send the packet once it goes out of scope. 56 | rlbot::ScopedRenderer renderer("test"); 57 | 58 | // Load the ballprediction into a vector to use for rendering. 59 | std::vector points; 60 | 61 | rlbot::BallPrediction ballprediction = GetBallPrediction(); 62 | 63 | for (uint32_t i = 0; i < ballprediction->slices()->size(); i++) { 64 | points.push_back(ballprediction->slices()->Get(i)->physics()->location()); 65 | } 66 | 67 | renderer.DrawPolyLine3D(rlbot::Color::red, points); 68 | 69 | renderer.DrawString2D("Hello world!", rlbot::Color::green, 70 | rlbot::flat::Vector3{10, 10, 0}, 4, 4); 71 | renderer.DrawString3D(std::to_string(velocity), rlbot::Color::magenta, 72 | ballLocation, 2, 2); 73 | 74 | // Calculate to get the angle from the front of the bot's car to the ball. 75 | double botToTargetAngle = atan2(ballLocation.y() - carLocation.y(), 76 | ballLocation.x() - carLocation.x()); 77 | double botFrontToTargetAngle = botToTargetAngle - carRotation.yaw(); 78 | // Correct the angle. 79 | if (botFrontToTargetAngle < -PI) 80 | botFrontToTargetAngle += 2 * PI; 81 | if (botFrontToTargetAngle > PI) 82 | botFrontToTargetAngle -= 2 * PI; 83 | 84 | rlbot::Controller controller{0}; 85 | 86 | // Decide which way to steer in order to get to the ball. 87 | if (botFrontToTargetAngle > 0) 88 | controller.steer = 1; 89 | else 90 | controller.steer = -1; 91 | 92 | controller.throttle = 1.0f; 93 | 94 | return controller; 95 | } 96 | -------------------------------------------------------------------------------- /examplebot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "rlbot/bot.h" 4 | 5 | class ExampleBot : public rlbot::Bot { 6 | public: 7 | ExampleBot(int _index, int _team, std::string _name); 8 | ~ExampleBot(); 9 | rlbot::Controller GetOutput(rlbot::GameTickPacket gametickpacket) override; 10 | }; 11 | -------------------------------------------------------------------------------- /main.cc: -------------------------------------------------------------------------------- 1 | #include "rlbot/rlbot_generated.h" 2 | 3 | #include "examplebot.h" 4 | 5 | #include "rlbot/bot.h" 6 | #include "rlbot/botmanager.h" 7 | #include "rlbot/interface.h" 8 | #include "rlbot/platform.h" 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | uint16_t getPortFromFile(std::string filename) { 16 | std::ifstream file; 17 | file.open(filename); 18 | std::string line; 19 | std::getline(file, line); 20 | file.close(); 21 | 22 | return std::stoi(line); 23 | } 24 | 25 | rlbot::Bot *botFactory(int index, int team, std::string name) { 26 | return new ExampleBot(index, team, name); 27 | } 28 | 29 | int main(int argc, char **argv) { 30 | // Set the working directory to the directory of this executable so we can use 31 | // relative paths. 32 | rlbot::platform::SetWorkingDirectory( 33 | rlbot::platform::GetExecutableDirectory()); 34 | 35 | // Read the port that we use for receiving bot spawn messages. 36 | uint16_t port = getPortFromFile("port.cfg"); 37 | 38 | // Start the bot server. 39 | rlbot::BotManager botmanager(botFactory); 40 | botmanager.StartBotServer(port); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /port.cfg: -------------------------------------------------------------------------------- 1 | 12345 -------------------------------------------------------------------------------- /rlbot/CppPythonAgent.cfg: -------------------------------------------------------------------------------- 1 | [Locations] 2 | # Path to loadout config. Can use relative path from here. 3 | looks_config = appearance.cfg 4 | 5 | # Path to python file. Can use relative path from here. 6 | python_file = CppPythonAgent.py 7 | 8 | # Name of the bot in-game 9 | name = C++ ExampleBot 10 | 11 | [Bot Parameters] 12 | cpp_executable_path = CPPExampleBot.exe -------------------------------------------------------------------------------- /rlbot/CppPythonAgent.py: -------------------------------------------------------------------------------- 1 | import platform 2 | import os 3 | import socket 4 | import time 5 | 6 | import psutil 7 | 8 | from rlbot.agents.base_independent_agent import BaseIndependentAgent 9 | from rlbot.botmanager.helper_process_request import HelperProcessRequest 10 | from rlbot.utils.structures import game_interface 11 | from rlbot.agents.base_agent import BOT_CONFIG_AGENT_HEADER 12 | from rlbot.parsing.custom_config import ConfigHeader, ConfigObject 13 | 14 | class BaseCPPAgent(BaseIndependentAgent): 15 | 16 | def __init__(self, name, team, index): 17 | super().__init__(name, team, index) 18 | self.port = self.read_port_from_file() 19 | self.is_retired = False 20 | self.cpp_executable_path = None 21 | 22 | def run_independently(self, terminate_request_event): 23 | while not terminate_request_event.is_set(): 24 | message = f"add\n{self.name}\n{self.team}\n{self.index}\n{game_interface.get_dll_directory()}" 25 | try: 26 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 27 | s.connect(("127.0.0.1", self.port)) 28 | s.send(bytes(message, "ASCII")) 29 | s.close() 30 | except ConnectionRefusedError: 31 | self.logger.warn("Could not connect to server!") 32 | 33 | time.sleep(1) 34 | else: 35 | self.retire() 36 | 37 | def get_helper_process_request(self): 38 | if self.is_executable_configured(): 39 | return HelperProcessRequest(python_file_path=None, key=__file__ + str(self.port), executable=self.cpp_executable_path, exe_args = ["-dll-path", game_interface.get_dll_directory()]) 40 | return None 41 | 42 | def is_executable_configured(self): 43 | return self.cpp_executable_path is not None and os.path.isfile(self.cpp_executable_path) 44 | 45 | def get_extra_pids(self): 46 | """ 47 | Gets the list of process ids that should be marked as high priority. 48 | :return: A list of process ids that are used by this bot in addition to the ones inside the python process. 49 | """ 50 | while not self.is_retired: 51 | if platform.system() == 'Linux': 52 | return [] 53 | for proc in psutil.process_iter(): 54 | for conn in proc.connections(): 55 | if conn.laddr.port == self.port: 56 | self.logger.debug(f"C++ socket server for {self.name} appears to have pid {proc.pid}") 57 | return [proc.pid] 58 | if self.is_executable_configured(): 59 | return [] 60 | time.sleep(1) 61 | if self.cpp_executable_path is None: 62 | self.logger.info("Can't auto-start C++ executable because no executable is configured. " 63 | "Please start the C++ bot manually!") 64 | else: 65 | self.logger.info(f"Can't auto-start C++ executable because {self.cpp_executable_path} " 66 | "is not found. Please start the C++ bot manually!") 67 | 68 | def retire(self): 69 | port = self.read_port_from_file() 70 | message = f"remove\n{self.index}" 71 | 72 | try: 73 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 74 | s.connect(("127.0.0.1", port)) 75 | s.send(bytes(message, "ASCII")) 76 | s.close() 77 | except ConnectionRefusedError: 78 | self.logger.warn("Could not connect to server!") 79 | self.is_retired = True 80 | 81 | def read_port_from_file(self): 82 | try: 83 | location = self.get_port_file_path() 84 | 85 | with open(location, "r") as port_file: 86 | return int(port_file.readline().rstrip()) 87 | 88 | except ValueError: 89 | self.logger.warn("Failed to parse port file!") 90 | raise 91 | 92 | def get_port_file_path(self): 93 | # Look for a port.cfg file in the same directory as THIS python file. 94 | return os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__), 'port.cfg')) 95 | 96 | def load_config(self, config_header: ConfigHeader): 97 | self.cpp_executable_path = config_header.getpath('cpp_executable_path') 98 | self.logger.info("C++ executable is configured as {}".format(self.cpp_executable_path)) 99 | 100 | @staticmethod 101 | def create_agent_configurations(config: ConfigObject): 102 | params = config.get_header(BOT_CONFIG_AGENT_HEADER) 103 | params.add_value('cpp_executable_path', str, default=None, description='Relative path to the executable that runs the cpp bot.') 104 | -------------------------------------------------------------------------------- /rlbot/RefreshEnv.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: This file is taken from chocolatey: 3 | :: https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd 4 | :: 5 | :: RefreshEnv.cmd 6 | :: 7 | :: Batch file to read environment variables from registry and 8 | :: set session variables to these values. 9 | :: 10 | :: With this batch file, there should be no need to reload command 11 | :: environment every time you want environment changes to propagate 12 | 13 | ::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell" 14 | echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait..." 15 | 16 | goto main 17 | 18 | :: Set one environment variable from registry key 19 | :SetFromReg 20 | "%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL 21 | for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do ( 22 | echo/set "%~3=%%B" 23 | ) 24 | goto :EOF 25 | 26 | :: Get a list of environment variables from registry 27 | :GetRegEnv 28 | "%WinDir%\System32\Reg" QUERY "%~1" > "%TEMP%\_envget.tmp" 29 | for /f "usebackq skip=2" %%A IN ("%TEMP%\_envget.tmp") do ( 30 | if /I not "%%~A"=="Path" ( 31 | call :SetFromReg "%~1" "%%~A" "%%~A" 32 | ) 33 | ) 34 | goto :EOF 35 | 36 | :main 37 | echo/@echo off >"%TEMP%\_env.cmd" 38 | 39 | :: Slowly generating final file 40 | call :GetRegEnv "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd" 41 | call :GetRegEnv "HKCU\Environment">>"%TEMP%\_env.cmd" >> "%TEMP%\_env.cmd" 42 | 43 | :: Special handling for PATH - mix both User and System 44 | call :SetFromReg "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd" 45 | call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd" 46 | 47 | :: Caution: do not insert space-chars before >> redirection sign 48 | echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd" 49 | 50 | :: Cleanup 51 | del /f /q "%TEMP%\_envset.tmp" 2>nul 52 | del /f /q "%TEMP%\_envget.tmp" 2>nul 53 | 54 | :: capture user / architecture 55 | SET "OriginalUserName=%USERNAME%" 56 | SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%" 57 | 58 | :: Set these variables 59 | call "%TEMP%\_env.cmd" 60 | 61 | :: reset user / architecture 62 | SET "USERNAME=%OriginalUserName%" 63 | SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%" 64 | 65 | echo | set /p dummy="Finished." 66 | echo . -------------------------------------------------------------------------------- /rlbot/appearance.cfg: -------------------------------------------------------------------------------- 1 | [Bot Loadout] 2 | team_color_id = 60 3 | custom_color_id = 0 4 | car_id = 23 5 | decal_id = 0 6 | wheels_id = 1565 7 | boost_id = 35 8 | antenna_id = 0 9 | hat_id = 0 10 | paint_finish_id = 1681 11 | custom_finish_id = 1681 12 | engine_audio_id = 0 13 | trails_id = 3220 14 | goal_explosion_id = 3018 15 | 16 | [Bot Loadout Orange] 17 | team_color_id = 3 18 | custom_color_id = 0 19 | car_id = 23 20 | decal_id = 0 21 | wheels_id = 1565 22 | boost_id = 35 23 | antenna_id = 0 24 | hat_id = 0 25 | paint_finish_id = 1681 26 | custom_finish_id = 1681 27 | engine_audio_id = 0 28 | trails_id = 3220 29 | goal_explosion_id = 3018 30 | 31 | [Bot Paint Blue] 32 | car_paint_id = 12 33 | decal_paint_id = 0 34 | wheels_paint_id = 7 35 | boost_paint_id = 7 36 | antenna_paint_id = 0 37 | hat_paint_id = 0 38 | trails_paint_id = 2 39 | goal_explosion_paint_id = 0 40 | 41 | [Bot Paint Orange] 42 | car_paint_id = 12 43 | decal_paint_id = 0 44 | wheels_paint_id = 14 45 | boost_paint_id = 14 46 | antenna_paint_id = 0 47 | hat_paint_id = 0 48 | trails_paint_id = 14 49 | goal_explosion_paint_id = 0 50 | -------------------------------------------------------------------------------- /rlbot/port.cfg: -------------------------------------------------------------------------------- 1 | 12345 -------------------------------------------------------------------------------- /rlbot/requirements.txt: -------------------------------------------------------------------------------- 1 | # Include everything the framework requires 2 | # You will automatically get updates for all versions starting with "1.". 3 | rlbot==1.* 4 | -------------------------------------------------------------------------------- /rlbot/rlbot.cfg: -------------------------------------------------------------------------------- 1 | [RLBot Configuration] 2 | # Visit https://github.com/RLBot/RLBot/wiki/Config-File-Documentation to see what you can put here. 3 | 4 | [Team Configuration] 5 | # Visit https://github.com/RLBot/RLBot/wiki/Config-File-Documentation to see what you can put here. 6 | 7 | [Match Configuration] 8 | # Number of bots/players which will be spawned. We support up to max 10. 9 | num_participants = 2 10 | game_mode = Soccer 11 | game_map = Mannfield 12 | 13 | [Mutator Configuration] 14 | # Visit https://github.com/RLBot/RLBot/wiki/Config-File-Documentation to see what you can put here. 15 | Match Length = Unlimited 16 | 17 | [Participant Configuration] 18 | # Put the name of your bot config file here. Only num_participants config files will be read! 19 | # Everything needs a config, even players and default bots. We still set loadouts and names from config! 20 | participant_config_0 = CppPythonAgent.cfg 21 | participant_config_1 = CppPythonAgent.cfg 22 | participant_config_2 = CppPythonAgent.cfg 23 | participant_config_3 = CppPythonAgent.cfg 24 | participant_config_4 = CppPythonAgent.cfg 25 | participant_config_5 = CppPythonAgent.cfg 26 | participant_config_6 = CppPythonAgent.cfg 27 | participant_config_7 = CppPythonAgent.cfg 28 | participant_config_8 = CppPythonAgent.cfg 29 | participant_config_9 = CppPythonAgent.cfg 30 | 31 | # team 0 shoots on positive goal, team 1 shoots on negative goal 32 | participant_team_0 = 0 33 | participant_team_1 = 1 34 | participant_team_2 = 0 35 | participant_team_3 = 1 36 | participant_team_4 = 0 37 | participant_team_5 = 1 38 | participant_team_6 = 0 39 | participant_team_7 = 1 40 | participant_team_8 = 0 41 | participant_team_9 = 1 42 | 43 | # Accepted values are "human", "rlbot", "psyonix", and "party_member_bot" 44 | # You can have up to 4 local players and they must be activated in game or it will crash. 45 | # If no player is specified you will be spawned in as spectator! 46 | # human - not controlled by the framework 47 | # rlbot - controlled by the framework 48 | # psyonix - default bots (skill level can be changed with participant_bot_skill 49 | # party_member_bot - controlled by the framework but the game detects it as a human 50 | participant_type_0 = rlbot 51 | participant_type_1 = rlbot 52 | participant_type_2 = rlbot 53 | participant_type_3 = rlbot 54 | participant_type_4 = rlbot 55 | participant_type_5 = rlbot 56 | participant_type_6 = rlbot 57 | participant_type_7 = rlbot 58 | participant_type_8 = rlbot 59 | participant_type_9 = rlbot 60 | 61 | 62 | # If participant is a bot and not RLBot controlled, this value will be used to set bot skill. 63 | # 0.0 is Rookie, 0.5 is pro, 1.0 is all-star. You can set values in-between as well. 64 | # Please leave a value here even if it isn't used :) 65 | participant_bot_skill_0 = 1.0 66 | participant_bot_skill_1 = 1.0 67 | participant_bot_skill_2 = 1.0 68 | participant_bot_skill_3 = 1.0 69 | participant_bot_skill_4 = 1.0 70 | participant_bot_skill_5 = 1.0 71 | participant_bot_skill_6 = 1.0 72 | participant_bot_skill_7 = 1.0 73 | participant_bot_skill_8 = 1.0 74 | participant_bot_skill_9 = 1.0 75 | -------------------------------------------------------------------------------- /rlbot/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | @rem Change the working directory to the location of this file so that relative paths will work 4 | cd /D "%~dp0" 5 | 6 | @rem Make sure the environment variables are up-to-date. This is useful if the user installed python a moment ago. 7 | call ./RefreshEnv.cmd 8 | 9 | setlocal EnableDelayedExpansion 10 | 11 | @rem Run the is_safe_to_upgrade function and save the output to a temp file. 12 | python -c "from rlbot.utils import public_utils; print(public_utils.is_safe_to_upgrade());" > %temp%\is_safe_to_upgrade.txt 13 | 14 | IF %ERRORLEVEL% NEQ 0 ( 15 | @rem The python command failed, so rlbot is probably not installed at all. Safe to 'upgrade'. 16 | set is_safe_to_upgrade=True 17 | ) ELSE ( 18 | @rem read the file containing the python output. 19 | set /p is_safe_to_upgrade= < %temp%\is_safe_to_upgrade.txt 20 | ) 21 | del %temp%\is_safe_to_upgrade.txt 22 | 23 | IF "!is_safe_to_upgrade!"=="True" ( 24 | python -m pip install -r requirements.txt --upgrade 25 | ) ELSE ( 26 | echo Will not attempt to upgrade rlbot because files are in use. 27 | ) 28 | 29 | python -c "from rlbot import runner; runner.main();" 30 | 31 | pause 32 | -------------------------------------------------------------------------------- /rlbot/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd "$(dirname "$0")" 3 | 4 | python3 -m pip install -r requirements.txt --upgrade 5 | 6 | python3 -c "from rlbot import runner; runner.main();" --------------------------------------------------------------------------------