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
AttackRuns
totrue
- Set
AttackAngle
to 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
ClosingAngle
since you probably want it to attack ASAP, even while distant. - Adjust
ForceAttackTime
andMinAttackTime
to taste. Read the comments. Be aware thatMinAttackTime
allows the AI to override theMinDistance
setting, which might lead to collisions. So keep it short or keep yourAttackAngle
wide.
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
MaxWanderDistance
andMaxFormationDistance
to larger distances, something like 500-1000 depending on the speed of your plane. This ensures it drops down to minimum speed sooner. - Set
MinimumSpeed
to 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
StopOnStationaryWaypoint
tofalse
.
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
AbsoluteAltitude
to 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
MatchTargetAboveAltitude
andMatchTargetOffset
. If you use this feature, you'll generally want to setMatchTargetAboveAltitude
to something like 100 or 200. You don't want it attempting to match the altitude of submarine targets. :P - Very important. Set
HardMinAltitude
to 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
MaxPitch
if you want. But generally, if yourAltitudePID
is tuned well, you won't have to limitMaxPitch
much. - 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_UpdateRate
to something like 20 (= .5 seconds at normal 1X time). - Look for
BalloonManagerConfig
and change the settings within to the desired deploy/sever altitudes.