mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(ai): map team-relative rotation actions
This commit is contained in:
@@ -75,11 +75,13 @@ func _decide() -> void:
|
||||
_action.thrust.y = 0.0
|
||||
else:
|
||||
_action = ShipActionCodec.from_logits(out, action_noise)
|
||||
_action = ShipActionCodec.apply_team_frame(_action, _ship.team)
|
||||
|
||||
|
||||
# Find ship/ball/teammates/opponents/goal once everything is spawned.
|
||||
# ShipAction axes are body-frame so only observations need team context
|
||||
# (ShipObservations). Rosters never change mid-match (no despawn path exists
|
||||
# ShipAction thrust axes are body-frame, while its rotation axes are mapped
|
||||
# from the canonical team frame by ShipActionCodec. Rosters never change
|
||||
# mid-match (no despawn path exists
|
||||
# anywhere in this codebase), so this only needs to run once — sorted by
|
||||
# spawn_index so a given ship keeps the same observation slot for the whole
|
||||
# match, matching TrainingMode's identically-sorted lists.
|
||||
|
||||
Reference in New Issue
Block a user