Skip to content

Commit 31a173d

Browse files
committed
Optional ability to hardcode the agent id
1 parent 344b644 commit 31a173d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

rlbot/managers/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class Bot:
3232
_latest_packet: Optional[flat.GamePacket] = None
3333
_latest_prediction = flat.BallPrediction()
3434

35-
def __init__(self):
36-
agent_id = os.environ.get("RLBOT_AGENT_ID")
35+
def __init__(self, default_agent_id: Optional[str] = None):
36+
agent_id = os.environ.get("RLBOT_AGENT_ID") or default_agent_id
3737

3838
if agent_id is None:
3939
self.logger.critical("RLBOT_AGENT_ID environment variable is not set")

rlbot/managers/hivemind.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Hivemind:
3434
_latest_packet: Optional[flat.GamePacket] = None
3535
_latest_prediction = flat.BallPrediction()
3636

37-
def __init__(self):
38-
agent_id = os.environ.get("RLBOT_AGENT_ID")
37+
def __init__(self, default_agent_id: Optional[str] = None):
38+
agent_id = os.environ.get("RLBOT_AGENT_ID") or default_agent_id
3939

4040
if agent_id is None:
4141
self._logger.critical("RLBOT_AGENT_ID environment variable is not set")

rlbot/managers/script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class Script:
3131
_latest_packet: Optional[flat.GamePacket] = None
3232
_latest_prediction = flat.BallPrediction()
3333

34-
def __init__(self):
35-
agent_id = os.environ.get("RLBOT_AGENT_ID")
34+
def __init__(self, default_agent_id: Optional[str] = None):
35+
agent_id = os.environ.get("RLBOT_AGENT_ID") or default_agent_id
3636

3737
if agent_id is None:
3838
self.logger.critical("RLBOT_AGENT_ID environment variable is not set")

tests/necto/bot.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ loadout_file = "loadout.toml"
44
run_command = "..\\..\\venv\\Scripts\\python bot.py"
55
run_command_linux = "../../venv/bin/python bot.py"
66
logo_file = "necto_logo.png"
7-
group_id = "rlgym/necto"
7+
agent_id = "rlgym/necto"
88

99
[details]
1010
description = "Necto is the official RLGym community bot, trained using PPO with workers run by people all around the world."

0 commit comments

Comments
 (0)