# ai.cfg {{< image-center src="images/2_DevMode/simobject_editor/cfg/cfg_tab_5_ai.png" alt="The AI.cfg File Tab In The SimObject Editor" >}} The `ai.cfg` is an *optional* file for SimObjects, unless you are creating an **aircraft** in which case it is *mandatory*. This file is considered critical when it comes to defining an aircraft as it contains the information required to tweak copilot, autopilot, and Air Traffic AI behavior. Below you can find information on the different sections used in the `ai.cfg` file as well as what parameters and values are expected within them. It is worth noting that if the aircraft is to be used for AI Traffic, then only the following sections/parameters will be used: - `[Version]` - all - `[TAKEOFF]` - all - `[WAYPOINT]` - all - `[LANDING]` - `flareAngle` - `[TAXI]` - all You can find further information on setting up an aircraft for AI Traffic from the following section: - ### [Version] The `[Version]` section provides version information for the configuration file. In Microsoft Flight Simulator 2024, major versions should *always* be at least equal to 1. Note that this section information is **mandatory** and should always be included. {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="major" />}}`major` | Major CFG file version number, values must be greater than 0. | Integer | Yes | | {{< anchor id="minor" />}}`minor` | Minor CFG file version number, values must be greater than 0. | Integer | Yes | {{< /table-wrapper >}} ### [TAKEOFF] This section controls the different takeoff options for the AI. Available parameters are: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="takeoffFlapsPosition" />}}`takeoffFlapsPosition` | Desired flaps position during initial takeoff rollout for AI. This is a value between 0.0 and 1.0, where 0.0 is 0% and 1.0 is 100%.Default is 1.0 {{< glossterm >}}percent_over_100{{< /glossterm >}}. | Float | No | | {{< anchor id="takeoffVerticalSpeedGround" />}}`takeoffVerticalSpeedGround` | Not currently used by the simulation. | Float | No | | {{< anchor id="takeoffVerticalSpeedAir" />}}`takeoffVerticalSpeedAir` | Not currently used by the simulation. | Float | No | | {{< anchor id="takeoffAirspeedAirMultiplier" />}}`takeoffAirspeedAirMultiplier` | Not currently used by the simulation. | Float | No | {{< /table-wrapper >}} ### [WAYPOINT] This section controls how the AI will deal with taxiway points, specifically the way it will move between them. Available parameters are: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="SlowDownDistance" />}}`SlowDownDistance` | The distance, in meters, at which the vehicle will start slowing down before reaching a sharp turn or its destination.Default value is 50.0. | Float | No | | {{< anchor id="SlowDownSpeed" />}}`SlowDownSpeed` | The speed, in {{< glossterm >}}knots{{< /glossterm >}}, to which the vehicle will slow down to before reaching a sharp turn or its destination.Default value is 0.4. | Float | No | | {{< anchor id="StopDistance" />}}`StopDistance` | The distance, in meters, from the destination at which the vehicle considers that it has reached its destination, and will start actually braking to reach a full stop.Default is 2.0m. | Float | No | | {{< anchor id="SlowDownOnLastWayPoint" />}}`SlowDownOnLastWayPoint` | This determines if the vehicle should start really slowing down (but not trying to fully stop either), on the last 5 meters before its destination (TRUE, 1) or not (FALSE, 0).Default is TRUE. | Bool | No | | {{< anchor id="CanReverse" />}}`CanReverse` | Sets whether the vehicle can reverse (TRUE, 1) or not (FALSE, 0).Default is TRUE. | Bool | No | | {{< anchor id="FrontRadiusMeters" />}}`FrontRadiusMeters` | The length, in meters, from the center of the vehicle to the front of it. It is used by the AI to better manage turns.The default is -1.0m, which means an approximate exaggerated value is computed by using a bounding box on the model. | Float | No | {{< /table-wrapper >}} ### [LANDING] This section controls how the AI will deal with landing and will be used by both air traffic and the co-pilot. Available parameters are: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="flareAngle" />}}`flareAngle` | This setting defines the "ideal" flare angle, in degrees, for the aircraft when coming in to land, just after final approach and before actual touchdown.Default is -1.0°. | Float | No | | {{< anchor id="maxPitchRate" />}}`maxPitchRate` | This sets the maximum rotational speed - in degrees per second - to change the aircraft pitch during landing.Default is 0.33333 degrees per second. | Float | No | {{< /table-wrapper >}} ### [SIMPLIFIEDSIM] This section defines some characteristics of simplified versions of the Sim Object parameters and flight model that are *only* for AI aircraft air traffic. AI traffic doesn't care at all about the wind, about remaining fuel, or most of the other world and physical parameters that are important to the user aircraft. The AI aircraft are done this way for performances reasons, but can still *visually* look correct to the user as long as the following parameters are correctly defined: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="dampingVelocity" />}}`dampingVelocity` | This value is used to dampen the aircraft rotational velocity when it is "sliding" on the ground - for example after a sharp turn.Default is 0.4. | Float | No | | {{< anchor id="brakesRotationDamping" />}}`brakesRotationDamping` | This value is used to dampen the aircraft rotational velocity when it is "sliding" on the ground when brakes are applied.Default is 0.5. | Float | No | | {{< anchor id="headingAccelerationFromBankFactor" />}}`headingAccelerationFromBankFactor` | Sets the heading acceleration that will be added when the aircraft is banking. This is used - in conjunction with the `headingInertia` value - as part of the formula used to calculate the change in heading when the aircraft is banking.Default is 0.004 radians / second². | Float | No | | {{< anchor id="headingInertia" />}}`headingInertia` | Sets the inertia applied to the aircraft heading when aircraft is banking. This is used - in conjunction with the `headingAccelerationFromBankFactor` value - as part of the formula used to calculate the change in heading when the aircraft is banking.Default is 0.001 radians / second². | Float | No | | {{< anchor id="airspeedAccelerationAugmentationPerFrame" />}}`airspeedAccelerationAugmentationPerFrame` | Sets the airspeed acceleration - in {{< glossterm >}}ft{{< /glossterm >}} per second squared - which is added every frame in order to reach the desired vertical airspeed.Default is 1.0 {{< glossterm >}}ft{{< /glossterm >}} / second². | Float | No | | {{< anchor id="altitudeAccelerationPerFrame" />}}`altitudeAccelerationPerFrame` | This value - in {{< glossterm >}}ft{{< /glossterm >}} per second squared per frame - is added on to the current aircraft altitude, every frame, in order to reach the desired altitude.Default is 5.0 {{< glossterm >}}ft{{< /glossterm >}} / second². | Float | No | | {{< anchor id="verticalSpeedAccelerationAugmentationPerFrame" />}}`verticalSpeedAccelerationAugmentationPerFrame` | Sets the vertical speed acceleration - in {{< glossterm >}}ft{{< /glossterm >}} per second squared - which is added every frame in order to reach the desired vertical airspeed.Default is 1.0 {{< glossterm >}}ft{{< /glossterm >}} / second². | Float | No | | {{< anchor id="pitchAccelerationPerFrame" />}}`pitchAccelerationPerFrame` | This value - in radians per second squared - sets the pitch acceleration, every frame.Default is 0.01 radians / second². | Float | No | | {{< anchor id="bankAccelerationPerFrame" />}}`bankAccelerationPerFrame` | This value - in radians per second squared - sets the bank acceleration, every frame.Default is 0.017 radians / second². | Float | No | | {{< anchor id="headingAccelerationPerFrame" />}}`headingAccelerationPerFrame` | This value - in radians per second squared - sets the heading acceleration, every frame.Default is 0.006 radians / second². | Float | No | | {{< anchor id="minRPMPct" />}}`minRPMPct` | Percentage over 100 of maximum {{< glossterm >}}rpm{{< /glossterm >}} when the piston/turboprop plane is in "Idle" in Simplified Sim mode, for correct sounds and behavior. Usually between 0.25 and 0.75.Default value is 0.25 {{< glossterm >}}percent_over_100{{< /glossterm >}}. | Float | No | | {{< anchor id="landingGearAnimPct" />}}`landingGearAnimPct` | Gear Animation Percentage for correct positioning of landing gear when the plane is passive or in Simplified Sim mode on the ground. Usually between 50.0 and 100.0.Default value is 65.0 percent | Float | No | {{< /table-wrapper >}} ### [STICKANDRUDDER] This section controls the copilot and autopilot behavior for the AI of the aircraft. Manual editing of these values is strongly suggested instead of letting the sim use the default values so that the AI behavior is more in-line with the aircraft being used. Note that the The `headingPID` value is also used by non-user AI to control planes. Note that in the following table, all {{< glossterm >}}pid{{< /glossterm >}}s should be listed in the following order: - Proportional Control - Integrator Control - Derivative Control - Integrator Boundary - Derivative Boundary Each value in the list should be a float, for example: ``` codeblock rudderGroundPID = 0.045, 0.001, 0.1, 1.0, 1.0 throttleGroundPID = 0.1, 0.10, 10.0, 10.0, 20.0 brakeDifferentialPID = 2.7, 0.001, 10.0, 1.0, 5.0 ``` These parameters are also explored in more detail here: - [PID Primer](../../samples-tutorials/primers/pid-primer/) Available parameters are: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="rudderGroundPID" />}}`rudderGroundPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the rudder controls on the ground to stay on the centerline when taking off or taxiing using copilot and/or autopilot controls.Input is the heading error, output is the rudder control input.Default is: `0.015, 0.001, 0.001, 1.0, 1.0` | [List](cfg-files/#list) of 5 Floats (see [Data Types](cfg-files/#DataTypes) for more information). The table requires the following 5 inputs: `Proportional factor, Integral factor, Derivative factor, I boundary, D boundary`. For more information on these PID controller parameters, please see the section on [PID's](../../samples-tutorials/primers/pid-primer/). | No | | {{< anchor id="throttleGroundPID" />}}`throttleGroundPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the throttle controls on ground to stay at the target speed when taking off or taxiing using copilot and/or autopilot controls.Input is the ground speed error, output is the throttle lever position.Default is: `1.0, 0.1, 10.0, 10.0, 20.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="throttlePID" />}}`throttlePID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the throttle controls to stay at the target speed when in the air using copilot and/or autopilot controls.Input is the airspeed error, output is the throttle lever position.Default is: `20.0, 0.3, 20.0, 20.0, 500.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="pitchPID" />}}`pitchPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the pitch controls to stay at the target pitch using copilot and/or autopilot controls.NOTE: this parameter is not used by FlyByWire aircraft.Input is the desired pitch, output is the pitch control input.Default is: `1.0, 0.01, 2.0, 0.6, 5.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="rollPID" />}}`rollPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the roll controls to stay at the target bank angle using copilot and/or autopilot controls.Input is the desired bank, output is the bank control input.Default is: `1.0, 0.001, 1.0, 0.5, 8.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="headingPID" />}}`headingPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the bank angle to stay at the target heading using copilot and/or autopilot controls.Input is the heading error, output is the target bank.Default is: `1.0, 0.01, 1.0, 1.0, 20.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="verticalSpeedPID" />}}`verticalSpeedPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the pitch to stay at the target vertical speed using copilot and/or autopilot controls.Input is the vertical speed error, output is the pitch control input adjustment.Default is: `0.5, 0.1, 0.5, 200.0, 5000.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="nav_ex1PID" />}}`nav_ex1PID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the heading to stay on the target navigation track using copilot and/or autopilot controls.Input is the angular deviation, output is the bank control input adjustment.Default is: `3.0, 0.01, 2.0, 0.035, 50.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="nav_yawPID" />}}`nav_yawPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the yaw (usually via rudder input) to stay on the target navigation track using copilot and/or autopilot controls.Input is lateral speed, output is the rudder control input.Default is: `0.02, 0.00006, 0.006, 0.3, 3.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="glideSlopePID" />}}`glideSlopePID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the vertical speed to stay on the target glide slope using copilot and/or autopilot controls.Input is the angular deviation from the slope, output is the pitch control input adjustment.Default is: `5.52, 1.0, 3.0, 2.0, 60.0` | [List](cfg-files/#list) of 5 Floats | No | | {{< anchor id="flightLevelPID" />}}`flightLevelPID` | {{< glossterm >}}pid{{< /glossterm >}} to adjust the pitch to stay at the target airspeed during flight level change mode using copilot and/or autopilot controls.Input is the airspeed error, output is the pitch control input adjustment.Default is: `10.0, 1.0, 10.0, 100.0, 1000.0` | [List](cfg-files/#list) of 5 Floats | No | {{< /table-wrapper >}} ### [TAXI] This section is used to define how the AI aircraft navigates the different taxiways. It has the following parameter: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="DistanceToLaneLine" />}}`DistanceToLaneLine` | Sets the distance, in meters, for the aircraft from the center line of the taxiway, allowing you to position it better within its own lane. Note that setting this to 0 (or less than 0) will *not* position the aircraft along the center line, but instead will force the simulation to use the bounding sphere radius for the offset distance, clamped to a minimum value of 1.5m.Default value is 0. | Integer | No | {{< /table-wrapper >}} ### [AI_INPUT] This section is used to define how the AI aircraft navigates the different taxiways. It has the following parameter: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="throttlefactordelta" />}}`throttlefactordelta` | This value is used by the AI to control the speed at which changes will be applied to the throttle. The value is a multiplier, where a value of 1 means that the AI can go from 0% to 100% throttle in 1 second, a value of 2 is double that speed, so 0 to 100% in 0.5 seconds, etc...Default value is 2 and cannot be less than 0. | Float | No | {{< /table-wrapper >}} ### [TOWPLANE] If this section has been added to the CFG file, it means the aircraft can be used as a tow plane. In these cases then you will need to include the `reference_points.cfg` to position where the tow cable should be, and include the following parameters: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="minTurnAltitude" />}}`minTurnAltitude` | Defines the minimum {{< glossterm >}}AGL{{< /glossterm >}} altitude - in {{< glossterm >}}ft{{< /glossterm >}} - for the towplane to start turning after takeoff.Default value is 300. | Float | No | | {{< anchor id="spawnDistance" />}}`spawnDistance` | The spawn distance of the towplane relative to the position of the glider, in {{< glossterm >}}ft{{< /glossterm >}}.Default value is 200. | Float | No | {{< /table-wrapper >}} ### [Glider] This section is only required if the aircraft being defined is a **glider**. {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="defaultTowPlaneTitle" />}}`defaultTowPlaneTitle` | The container title of the winch SimObject that should be used for winched launches.Default is "". | String | No | | {{< anchor id="winchSpawnDistance" />}}`winchSpawnDistance` | The initial distance of the winch on the runway relative to the position of the glider in {{< glossterm >}}ft{{< /glossterm >}}.Default value is 2000. | Float | No | | {{< anchor id="allowWinchLaunch" />}}`allowWinchLaunch` | Whether this glider can be launched using a winch (1, TRUE) or not (0, FALSE).Default value is 1. | Bool | No | | {{< anchor id="allowTowPlaneLaunch" />}}`allowTowPlaneLaunch` | Whether this glider can be launched using a towplane (1, TRUE) or not (0, FALSE).Default value is 1. | Bool | No | | {{< anchor id="allowAutonomousLaunch" />}}`allowAutonomousLaunch` | Whether this glider can launch itself without help (1, TRUE) or not (0, FALSE).Default value is 0. | Bool | No | {{< /table-wrapper >}} ### [WINCH] This section is only required when creating a [Winch ground vehicle](../modular-simobjects/simobjects/ground-vehicles/winch-parachute-definition/). It has the following parameters: {{< table-wrapper >}} | Parameter | Description | Type | Required | |---|---|---|:---:| | {{< anchor id="launchHeading" />}}`launchHeading` | The angle of the winch relative to the heading of the runway in degrees.Default value is 0. | Real | No | | {{< anchor id="parachuteTitle" />}}`parachuteTitle` | The title of the SimObject to use as a parachute.Default is "Parachute". | String | No | {{< /table-wrapper >}}