feat(arena): add elevated-goal arena variants

Each of the three arenas gains an ELEVATED sibling scene that inherits the
base arena and overrides the boundary's goal_mode, the two goal transforms
and the ship spawns, so the goal sits at mid-wall height instead of flush
with the deck. Registered in ArenaRegistry alongside the floor-level arenas,
plus a training_elevated scene for self-play on them.

TrainingMode reads the arena's goal_mode once in _start() and widens the
ball-placement height range to match the goal's real position; on FLOOR
arenas the bound is a no-op, so floor-level training is unchanged. It is read
in _start() rather than _ready() because TrainingMode has no _ready()
override and GameMode._ready() is what discovers the arena first.

Policies trained against floor-level goals are not expected to score on an
elevated one, so the two are kept as separate arenas rather than a variant of
the same entry.
This commit is contained in:
Josh Creek
2026-08-04 13:36:19 +01:00
parent 66b6215fdd
commit df3e168b31
6 changed files with 105 additions and 7 deletions
+18 -6
View File
@@ -1,14 +1,26 @@
class_name ArenaRegistry
# Single source of truth for available arenas: the Free Play menu dropdown
# lists these, and Match/Spectate pick one at random each session. Training
# is exempt — training.tscn keeps its own fixed arena_01 child.
# lists all of these, and Match/Spectate pick at random each session from
# those with "random" true. Training is exempt — training.tscn/
# training_elevated.tscn each keep their own fixed Arena child.
#
# Elevated-goal variants are Free-Play-only ("random": false) until a
# checkpoint trained on training_elevated.tscn is promoted — the current
# promoted bots (see main_menu.gd's DIFFICULTIES) were trained exclusively
# on floor-level goals and can't be expected to score on an elevated one.
# Flip a variant's "random" flag to true once that training/promotion has
# happened.
const ARENAS := [
{"name": "Starfield", "path": "res://scenes/arena_01.tscn"},
{"name": "Nebula", "path": "res://scenes/arena_02.tscn"},
{"name": "Asteroid Field", "path": "res://scenes/arena_03.tscn"},
{"name": "Starfield (Floor Goals)", "path": "res://scenes/arena_01.tscn", "random": true},
{"name": "Starfield (Elevated Goals)", "path": "res://scenes/arena_01_elevated.tscn", "random": false},
{"name": "Nebula (Floor Goals)", "path": "res://scenes/arena_02.tscn", "random": true},
{"name": "Nebula (Elevated Goals)", "path": "res://scenes/arena_02_elevated.tscn", "random": false},
{"name": "Asteroid Field (Floor Goals)", "path": "res://scenes/arena_03.tscn", "random": true},
{"name": "Asteroid Field (Elevated Goals)", "path": "res://scenes/arena_03_elevated.tscn", "random": false},
]
static func random_path() -> String:
return ARENAS[randi() % ARENAS.size()]["path"]
var candidates := ARENAS.filter(func(arena): return arena["random"])
return candidates[randi() % candidates.size()]["path"]