ai_aircraft
Shared bank-driven flight for Skyward's enemy fighters, wingman, bombers and reconnaissance aircraft. Combat and mission director modules supply guidance; this module integrates attitude, speed and position.
AI aircraft motion
Shared bank-driven flight for Skyward's enemy fighters, wingman, bombers and reconnaissance aircraft. Combat and mission director modules supply guidance; this module integrates attitude, speed and position.
Require game.flight.ai_aircraft. Call step(aircraft, desiredUnitDirection, targetSpeed, dt, profile, terrainHeight), then pose(aircraft) to update its entity. Aircraft tables provide position, unit forward and speed in metres/second; optional id selects the initial reversal side. Profiles are fighter, wingman, bomber and recon. terrainHeight(x,z) returns metres above sea level. Call reset after deliberately changing an existing aircraft's pose.
Roll has bounded rate and acceleration. Heading follows bank and airspeed; pitch respects a combined load limit. Speed responds gradually to throttle demand, climb and turn drag. Predictive terrain clearance steers upward without snapping altitude. The rendered up vector follows the same bank used to turn. Numerical integration substeps at at most 1/120 second.
This is a tuned kinematic flight model, not a full aerodynamic simulation. Missile steering is separate. Run /zero/source/design/verify-ai-flight.luau for motion limits, frame-rate consistency and terrain clearance; verify-sorties.luau and verify-tactics.luau cover the mission consumers.
Scoped to this part · feeds back into the world's score.