feat(*): add staged curriculum training with an automated stage-by-stage orchestrator

This commit is contained in:
Josh Creek
2026-07-21 12:38:51 +01:00
parent 1d539cc8c7
commit 8e3fafcc8b
7 changed files with 581 additions and 18 deletions
+15 -2
View File
@@ -71,6 +71,16 @@ extends AIController3D
# chance appears, instead of a free way to keep collecting dense reward.
@export var time_penalty := 0.001
# Locomotion curriculum: when false, the corresponding action axes are
# discarded in set_action before reaching the ship, so the ship stays
# grounded and only yaws — basic scoring/defending doesn't need 3D flight.
# This masks the *effect* of thrust.y/rotation.x/rotation.z, not the action
# space's shape: the policy still outputs values for these axes (still
# contributing to PPO's entropy/log-prob), they're just discarded here, so
# checkpoints stay resumable once a later curriculum stage re-enables them.
@export var allow_vertical := true
@export var allow_pitch_roll := true
# Contact normals with y above this are floor contact (exempt from the wall
# penalty); below it they read as wall (sideways) or ceiling (downward).
const FLOOR_NORMAL_MIN_Y := 0.7
@@ -128,8 +138,11 @@ func get_action_space() -> Dictionary:
func set_action(action) -> void:
var thrust: Array = action["thrust"]
var rot: Array = action["rotation"]
rl_controller.action.thrust = Vector3(thrust[0], thrust[1], thrust[2])
rl_controller.action.rotation = Vector3(rot[0], rot[1], rot[2])
var thrust_y: float = thrust[1] if allow_vertical else 0.0
var pitch: float = rot[0] if allow_pitch_roll else 0.0
var roll: float = rot[2] if allow_pitch_roll else 0.0
rl_controller.action.thrust = Vector3(thrust[0], thrust_y, thrust[2])
rl_controller.action.rotation = Vector3(pitch, rot[1], roll)
rl_controller.action.turbo = int(action["turbo"]) == 1