Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to newest spec
  • Loading branch information
VirxEC committed Jun 14, 2025
commit ef8005a0d534a0c0e4c53b261d540854c38b16b5
19 changes: 15 additions & 4 deletions rlbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def load_match_config(config_path: Path | str) -> flat.MatchConfiguration:
load_player_config(abs_config_path, team, name, loadout_file)
)
case "psyonix":
abs_config_path = (config_path.parent / car_config).resolve()
abs_config_path = (
(config_path.parent / car_config).resolve() if car_config else None
)
players.append(
load_psyonix_config(
team,
Expand Down Expand Up @@ -153,6 +155,17 @@ def load_match_config(config_path: Path | str) -> flat.MatchConfiguration:
audio=__enum(mutator_table, "audio", flat.AudioMutator),
)

try:
enable_rendering = (
flat.DebugRendering.OnByDefault
if __bool(match_table, "enable_rendering")
else flat.DebugRendering.OffByDefault
)
except ConfigParsingException:
enable_rendering = __enum(
match_table, "enable_rendering", flat.DebugRendering.AlwaysOff
)

return flat.MatchConfiguration(
launcher=__enum(rlbot_table, "launcher", flat.Launcher),
launcher_arg=__str(rlbot_table, "launcher_arg"),
Expand All @@ -168,9 +181,7 @@ def load_match_config(config_path: Path | str) -> flat.MatchConfiguration:
existing_match_behavior=__enum(
match_table, "existing_match_behavior", flat.ExistingMatchBehavior
),
enable_rendering=__enum(
match_table, "enable_rendering", flat.DebugRendering.OffByDefault
),
enable_rendering=enable_rendering,
enable_state_setting=__bool(match_table, "enable_state_setting"),
freeplay=__bool(match_table, "freeplay"),
)
Expand Down
2 changes: 1 addition & 1 deletion rlbot/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0-beta.44"
__version__ = "2.0.0-beta.46"
4 changes: 2 additions & 2 deletions tests/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ wait_for_agents = true

[match]
# What game mode the game should load.
# Accepted values are "Soccer", "Hoops", "Dropshot", "Hockey", "Rumble", "Heatseeker", "Gridiron", "Knockout"
game_mode = "Soccer"
# Accepted values are "Soccar", "Hoops", "Dropshot", "Snowday", "Rumble", "Heatseeker", "Gridiron", "Knockout"
game_mode = "Soccar"
# Which map the game should load into. Ensure the map doesn't end in '.upk'.
game_map_upk = "Stadium_P"
# Automatically skip replays after a goal. Also stops match replays from being saved.
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/beach_ball.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"
# Map set currently unknown
game_map_upk = "Stadium_P"

Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/boomer_ball.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"

[mutators]
boost_amount = "UnlimitedBoost"
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/gforce_frenzy.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"

[mutators]
boost_amount = "UnlimitedBoost"
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/ghost_hunt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
launcher = "Steam"

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Haunted_TrainStation_P"

[mutators]
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/gotham_city_rumble.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
launcher = "Steam"

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Park_Bman_P"

[mutators]
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/nike_fc_showdown.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "swoosh_p"

[mutators]
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/speed_demon.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"

[mutators]
boost_amount = "UnlimitedBoost"
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/spike_rush.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "ThrowbackStadium_P"

[mutators]
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/spooky_cube.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Farm_HW_P"

[mutators]
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/super_cube.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[match]
game_mode = "Soccer"
game_mode = "Soccar"

[mutators]
ball_max_speed = "SuperFast"
Expand Down
2 changes: 1 addition & 1 deletion tests/gamemodes/winter_breakaway.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[match]
game_mode = "Hockey"
game_mode = "Snowday"
game_map_upk = "ThrowbackHockey_p"
2 changes: 1 addition & 1 deletion tests/hivemind.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
launcher = "Steam"

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"

[mutators]
Expand Down
2 changes: 1 addition & 1 deletion tests/human_vs_atba.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ launcher = "Steam"
auto_start_agents = true

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"
enable_rendering = true

Expand Down
2 changes: 1 addition & 1 deletion tests/human_vs_necto.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ launcher = "Steam"
auto_start_agents = true

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"

[mutators]
Expand Down
2 changes: 1 addition & 1 deletion tests/minimal.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
launcher = "Steam"

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"
17 changes: 7 additions & 10 deletions tests/nexto/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import torch
from agent import Agent
from nexto_obs import BOOST_LOCATIONS, NextoObsBuilder
from rlbot_flatbuffers import GameMode
from rlgym_compat.v1_game_state import V1GameState as GameState

from rlbot.flat import ControllerState, GamePacket, MatchPhase, Vector3
Expand Down Expand Up @@ -37,10 +38,10 @@
)

GAME_MODES = [
"soccer",
"soccar",
"hoops",
"dropshot",
"hockey",
"snowday",
"rumble",
"heatseeker",
]
Expand All @@ -63,7 +64,7 @@ class Nexto(Bot):
ticks = tick_skip # So we take an action the first tick
prev_tick = 0
kickoff_index = -1
gamemode = ""
gamemode = GameMode.Soccar

# toxic handling
orange_goals = 0
Expand Down Expand Up @@ -95,10 +96,7 @@ def initialize(self):
"Also check out the RLGym Twitch stream to watch live bot training and occasional showmatches!"
)

game_mode_idx = int(self.match_config.game_mode)
self.gamemode = (
GAME_MODES[game_mode_idx] if game_mode_idx < len(GAME_MODES) else 0
)
self.gamemode = self.match_config.game_mode

def render_attention_weights(self, weights, positions, n=3):
if weights is None:
Expand Down Expand Up @@ -171,8 +169,7 @@ def get_output(self, packet: GamePacket) -> ControllerState:

self.game_state.players = [player] + teammates + opponents

# todo add heatseeker later
if self.gamemode == "heatseeker":
if self.gamemode == GameMode.Heatseeker:
self._modify_ball_info_for_heatseeker(packet, self.game_state)

obs = self.obs_builder.build_obs(player, self.game_state, self.action)
Expand Down Expand Up @@ -263,7 +260,7 @@ def update_controls(self, action):
self.controls.jump = action[5] > 0
self.controls.boost = action[6] > 0
self.controls.handbrake = action[7] > 0
if self.gamemode == "rumble":
if self.gamemode == GameMode.Rumble:
self.controls.use_item = np.random.random() > (
self.tick_skip / 1200
) # On average once every 10 seconds
Expand Down
2 changes: 1 addition & 1 deletion tests/psy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ launcher = "Steam"
auto_start_agents = true

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"

[[cars]]
Expand Down
2 changes: 1 addition & 1 deletion tests/render_test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
launcher = "Steam"

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"
enable_rendering = true

Expand Down
2 changes: 1 addition & 1 deletion tests/rlbot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ launcher = "Steam"
auto_start_agents = true

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"
skip_replays = false
start_without_countdown = false
Expand Down
6 changes: 3 additions & 3 deletions tests/run_forever.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

current_map = -1

blue_bot = load_player_config(BOT_PATH, flat.CustomBot(), 0)
orange_bot = load_player_config(BOT_PATH, flat.CustomBot(), 1)
blue_bot = load_player_config(BOT_PATH, 0)
orange_bot = load_player_config(BOT_PATH, 1)

match_settings = flat.MatchConfiguration(
launcher=flat.Launcher.Steam,
auto_start_agents=True,
game_mode=flat.GameMode.Soccer,
game_mode=flat.GameMode.Soccar,
enable_state_setting=True,
existing_match_behavior=flat.ExistingMatchBehavior.Restart,
skip_replays=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/series.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ launcher = "Steam"
auto_start_agents = true

[match]
game_mode = "Soccer"
game_mode = "Soccar"
game_map_upk = "Stadium_P"
enable_state_setting = true
existing_match_behavior = "ContinueAndSpawn"
Expand Down