feat(arena): Add AI-controlled arena mode race selection and adjust world map arena scene behavior

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-04-10 21:11:47 -07:00
parent 9b9ea5d3cc
commit 662057c69d
2 changed files with 30 additions and 5 deletions

View file

@ -44,12 +44,18 @@ func _run_generation() -> void:
await _animate_progress(40.0, 60.0)
var num_players: int = GameState.game_settings.get("num_players", 2)
var race_list: Array = DataLoader.get_all_races()
var default_race: String = "dwarf"
if not race_list.is_empty():
default_race = race_list[0].get("id", "dwarf")
var arena_mode: bool = EnvConfig.get_bool("AI_ARENA")
# Arena mode is Age of Dwarves content only — force the dwarf race
# regardless of what else `DataLoader.get_all_races()` has loaded from
# the shared `public/resources/races/` directory (which contains 17+
# races for future episodes). Outside of arena mode, fall back to the
# first race in the list.
var default_race: String = "dwarf"
if not arena_mode:
var race_list: Array = DataLoader.get_all_races()
if not race_list.is_empty():
default_race = race_list[0].get("id", "dwarf")
for i: int in range(num_players):
var player: PlayerScript = PlayerScript.new()
player.index = i

View file

@ -58,6 +58,25 @@ func setup(world_map: Node) -> void:
]
)
)
# Empirically report the actual window state so the orchestrator log
# can prove --windowed and --position took effect. Without this we can
# only infer window mode indirectly.
var mode: int = DisplayServer.window_get_mode()
var size: Vector2i = DisplayServer.window_get_size()
var pos: Vector2i = DisplayServer.window_get_position()
var mode_name: String = {
DisplayServer.WINDOW_MODE_WINDOWED: "windowed",
DisplayServer.WINDOW_MODE_MINIMIZED: "minimized",
DisplayServer.WINDOW_MODE_MAXIMIZED: "maximized",
DisplayServer.WINDOW_MODE_FULLSCREEN: "fullscreen",
DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN: "excl_fullscreen",
}.get(mode, "unknown(%d)" % mode)
print(
(
"[AI ARENA] window: mode=%s size=%dx%d pos=(%d,%d)"
% [mode_name, size.x, size.y, pos.x, pos.y]
)
)
# ── Overlay setup ────────────────────────────────────────────────────