perf(ship): reuse member ShipAction instead of allocating per tick

ship.gd's controllerless path and player_ship_controller.gd each
allocated a fresh ShipAction every physics tick; ai_ship_controller.gd
and rl_ship_controller.gd already avoid this via a persistent member.
Convert both to reuse a member instance, matching the existing
full-field-overwrite convention (rather than +=/-= off a fresh zero).

Also drop the completed items from TODO.md.
This commit is contained in:
Josh Creek
2026-08-04 22:23:02 +01:00
parent 6198dc67fc
commit 8551d9e835
3 changed files with 20 additions and 34 deletions
+2 -1
View File
@@ -79,6 +79,7 @@ static func _get_team_material(team: int) -> StandardMaterial3D:
var controller: ShipController
var _current_action: ShipAction = ShipAction.new()
var _inert_action: ShipAction = ShipAction.new()
var _boundary: ArenaBoundary
# Instrument signals for efficient data distribution
@@ -194,7 +195,7 @@ func _has_telemetry_listeners() -> bool:
func _integrate_forces(state):
# One action per physics tick, pulled from the controller (deterministic)
_current_action = controller.get_action() if controller else ShipAction.new()
_current_action = controller.get_action() if controller else _inert_action
# === TRANSLATION (Movement) ===
apply_thruster_forces(state, _current_action)