FtD Airplane
airplane Configuration
Overview
Since my airplane combo script is basically just my naval-ai with special controls, setting it up requires slightly more effort (since naval-ai was meant for water craft and airships, i.e. things that can actually come to a halt).
- Decide on attack behavior (naval-ai configuration)
- Modify waypoint behavior (so it never comes to a dead stop)
- Choose your altitude(s) and vertical behaviors
- Configure the airplane PIDs and other parameters
- Configure balloon manager (optional)
Attack Behavior
Decide: Do you want broadsiding behavior or attack runs, like the stock aerial AI?
Either way, set MinDistance and MaxDistance. Also, for both behaviors, you might want to set AirRaidEvasion to nil.
If broadsiding, try out the defaults and then adjust the angles/evasion settings.
For attack runs:
- Set
AttackRunstotrue - Set
AttackAngleto 0 or some small angle. This is the relative bearing of the target when the plane makes an attack run. 0 is dead ahead, good for strafing runs but prone to collisions if you match altitude (more on that later). - Similarly, reduce
ClosingAnglesince you probably want it to attack ASAP, even while distant. - Adjust
ForceAttackTimeandMinAttackTimeto taste. Read the comments. Be aware thatMinAttackTimeallows the AI to override theMinDistancesetting, which might lead to collisions. So keep it short or keep yourAttackAnglewide.
Waypoint Behavior
This governs how the plane behaves when heading toward the 'M' map waypoint or when following the fleet flagship when in "fleetmove" mode.
Inside WaypointMoveConfig:
- Set both
MaxWanderDistanceandMaxFormationDistanceto larger distances, something like 500-1000 depending on the speed of your plane. This ensures it drops down to minimum speed sooner. - Set
MinimumSpeedto some number. This is in meters per second. It's the speed of the plane while it loiters out-of-combat or in fleet formation. - Set
StopOnStationaryWaypointtofalse.
Altitudes
Basic setup for the "ALTITUDE CONTROL" section:
- Set
DesiredAltitudeCombat. This is the default combat altitude. - Set
DesiredAltitudeIdle. This is the out-of-combat loitering altitude. - I generally set
AbsoluteAltitudeto true so it doesn't follow terrain. (The naval AI will still attempt to avoid terrain.) This is up to you. - If you want it to match the target's altitude, set
MatchTargetAboveAltitudeandMatchTargetOffset. If you use this feature, you'll generally want to setMatchTargetAboveAltitudeto something like 100 or 200. You don't want it attempting to match the altitude of submarine targets. :P - Very important. Set
HardMinAltitudeto the absolute minimum altitude.
Airplane Configuration
Under the "AIRPLANE CONFIGURATION" section:
- Tune the PIDs. The defaults are OK, they work fine on the few test craft I used. Look elsewhere for tips on how to tune a PID.
- Modify
MaxPitchif you want. But generally, if yourAltitudePIDis tuned well, you won't have to limitMaxPitchmuch. - Decide if you want to bank to turn and if so, how many degrees difference before banking. Typically, your plane will need very strong yaw authority to counteract the climb caused by the roll + pitch up maneuver.
Balloon Manager
If your plane has balloons and requires them to deploy when starting in water, then:
- Near the top, set
BalloonManager_UpdateRateto something like 20 (= .5 seconds at normal 1X time). - Look for
BalloonManagerConfigand change the settings within to the desired deploy/sever altitudes.