mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 17:02:05 +00:00
fix(*): apply the locomotion mask during in-game/eval inference, not just training
AIShipController (eval + real gameplay) ran the raw policy output unmasked regardless of allow_vertical/allow_pitch_roll, while ShipAIController (training) correctly discarded those axes for grounded curriculum stages. A grounded-trained model's untrained vertical/pitch-roll output reached the ship as noise during eval, understating it against models that were never handicapped this way.
This commit is contained in:
@@ -91,6 +91,12 @@ var _agents: Array[ShipAIController] = []
|
||||
# Eval mode state (see header comment)
|
||||
var _eval := false
|
||||
var _eval_models: Array[String] = ["", ""]
|
||||
# Per-model locomotion mask — must match how each model was actually trained
|
||||
# (see AIShipController's identical exports), so a stage 1/2 (grounded)
|
||||
# candidate isn't unfairly penalized by untrained aerial noise during eval
|
||||
# that its training environment never had.
|
||||
var _eval_allow_vertical: Array[bool] = [true, true]
|
||||
var _eval_allow_pitch_roll: Array[bool] = [true, true]
|
||||
var _eval_episodes := 20
|
||||
var _eval_goals := {0: 0, 1: 0}
|
||||
var _eval_draws := 0
|
||||
@@ -123,6 +129,8 @@ func _start() -> void:
|
||||
for team in [0, 1]:
|
||||
var bot := AIShipController.new()
|
||||
bot.model_path = _eval_models[team]
|
||||
bot.allow_vertical = _eval_allow_vertical[team]
|
||||
bot.allow_pitch_roll = _eval_allow_pitch_roll[team]
|
||||
spawn_ship(team, 0, bot)
|
||||
return
|
||||
|
||||
@@ -161,6 +169,10 @@ func _parse_eval_args() -> void:
|
||||
_eval_models[0] = args["eval_model_a"]
|
||||
_eval_models[1] = args["eval_model_b"]
|
||||
_eval_episodes = int(args.get("eval_episodes", str(_eval_episodes)))
|
||||
_eval_allow_vertical[0] = _typed_like(args.get("eval_allow_vertical_a", "true"), true)
|
||||
_eval_allow_vertical[1] = _typed_like(args.get("eval_allow_vertical_b", "true"), true)
|
||||
_eval_allow_pitch_roll[0] = _typed_like(args.get("eval_allow_pitch_roll_a", "true"), true)
|
||||
_eval_allow_pitch_roll[1] = _typed_like(args.get("eval_allow_pitch_roll_b", "true"), true)
|
||||
|
||||
|
||||
# TrainingMode @export names a curriculum run may override from the cmdline.
|
||||
|
||||
Reference in New Issue
Block a user