feat(*): Fix exported-policy action order to gymnasium's sorted-key layout, add wall-contact penalty and stronger ball-touch reward, and wire Spectate to run01 vs run02

This commit is contained in:
Josh Creek
2026-07-19 13:21:14 +01:00
parent 6f1a840249
commit 772f98b7fe
6 changed files with 34 additions and 8 deletions
+5 -4
View File
@@ -49,14 +49,15 @@ func get_action() -> ShipAction:
func _decide() -> void:
var obs := ShipObservations.build(_ship, _opponent, _ball, _attack_goal_position)
var out := _policy.forward(obs)
# Output layout matches the flattened training action space (Box(7)):
# thrust xyz, rotation xyz, turbo (> 0 means on).
_action.thrust = Vector3(
# Output layout is the trainer's flattened action space (Box(7)), which
# gymnasium orders by SORTED key name — rotation xyz, thrust xyz, turbo
# (> 0 means on) — NOT ShipAction's thrust-first declaration order.
_action.rotation = Vector3(
_axis(out[0]),
_axis(out[1]),
_axis(out[2])
)
_action.rotation = Vector3(
_action.thrust = Vector3(
_axis(out[3]),
_axis(out[4]),
_axis(out[5])