Skip to content

AICOM Aircraft And Airfield System Reference

rayswaynl edited this page Jul 3, 2026 · 1 revision

AICOM Aircraft And Airfield System Reference

This page is the wiki route for AI commander aircraft on the current target. It covers how AICOM decides that air teams are eligible, where they spawn, what a captured airfield contributes, and which air research gates are real today.

Source snapshot: origin/claude/build84-cmdcon36@33cab11c165fc82dfc9082a02cb7e2c672242c53.

Scope boundaries:

Current Truth

Topic Current behavior Primary anchors
Held-airfield detection AICOM considers a side to hold an airfield when an owned town has wfbe_is_airfield, a known airfield name/capture unlock, or wfbe_airfield_hangar_obj. AI_Commander_Teams.sqf:278-301, AI_Commander_AssignTypes.sqf:37-49
Captured airfield free buy With WFBE_C_AICOM_AIRFIELD_FREE_AIR = 1, a held airfield waives AIR-tier eligibility for planes and helicopters and also bypasses the minimum-town air strip. Init_CommonConstants.sqf:431, AI_Commander_Teams.sqf:296-301, :434-438
Aircraft Factory heli waive With WFBE_C_AICOM_AIR_FACTORY_ENABLES_HELI = 1, a held Aircraft Factory structure waives AIR-tier eligibility for helicopter templates only. Planes still need a held airfield. Init_CommonConstants.sqf:423, AI_Commander_Teams.sqf:303-324, :337-354
Plane gate Fixed-wing templates are admitted only when an airfield is held, then further gated by the jet time ramp. Without the field, the old helicopters-only behavior remains. AI_Commander_Teams.sqf:595-602, AI_Commander_AssignTypes.sqf:139-145
Air cap The live cap is total AICOM air per side, not the older attack-heli-only cap. Early cap defaults to 3; late cap defaults to 7 after 45 minutes. Init_CommonConstants.sqf:422, :875-876, AI_Commander_Teams.sqf:441-463
Air research The old Build 86 claim that AICOM never queues AIR is stale on this base. WFBE_C_AICOM_RESEARCH_AIR exists and, when enabled, appends [WFBE_UP_AIR,1] and [WFBE_UP_AIR,2] after an Aircraft Factory is present. The flag still defaults to 0. AI_Commander.sqf:91-109, Init_CommonConstants.sqf:909
Founding location Any air template can relocate from the rear factory pad to the owned airfield. Planes air-start; helicopters spawn grounded, preferring a nearby HeliH. AI_Commander_Teams.sqf:1144-1201, Common_RunCommanderTeam.sqf:34-61, Common_CreateTeam.sqf:12-18, :149-158

Airfield Ownership Signal

Chernarus marks three town logics as baked airfields: NWAF, NEAF and Balota. Each town mission.sqm init runs Init_Town.sqf, sets wfbe_is_airfield = true, and syncs to a nearby camp. The matching LocationLogicAirport objects are also present in mission.sqm and set wfbe_skip_auto_hangar = true, so Init_Airports.sqf does not create the generic airport hangar for those capture-managed airfields.

At capture time, server_town.sqf rebuilds the airfield stack when WFBE_C_AIRFIELDS > 0 and the town has wfbe_is_airfield:

Object or variable What it does Anchor
wfbe_airfield_logic_ref Cached nearest LocationLogicAirport within 1500m for recapture reuse. server_town.sqf:549-556
wfbe_airfield_sp Side-owned service point registered into the owning side's wfbe_structures. server_town.sqf:559-598
wfbe_is_airfield_hangar Marker on the newly spawned hangar object so airport buy-menu code can identify a captured-airfield hangar. server_town.sqf:607-614
wfbe_hangar Stored on the airport logic and read by client airport helpers and AICOM spawn routing. Init_Airports.sqf:20-21, server_town.sqf:600-614
wfbe_airfield_side Stored on the airport logic for the GUER ownership gate and client-side airport lookup. server_town.sqf:613
wfbe_airfield_hangar_obj Stored on the town logic as a map-independent fallback for held-airfield checks. server_town.sqf:614

Carrier HVTs use the same hangar ownership vocabulary. Their recapture path respawns an invisible-but-alive HeliHEmpty, sets wfbe_is_airfield_hangar, updates wfbe_hangar and wfbe_airfield_side, then stores wfbe_airfield_hangar_obj on the carrier location (server_town.sqf:339-363).

Eligibility Flow

AICOM filters air before it ever founds a team.

  1. AI_Commander_Teams.sqf builds _hasAirfield from owned airfield towns and the runtime hangar fallback (:278-301). AI_Commander_AssignTypes.sqf runs a sibling scan for server-local assignment paths (:37-49).
  2. _freeAirWaive becomes true when _hasAirfield and WFBE_C_AICOM_AIRFIELD_FREE_AIR > 0 (AI_Commander_Teams.sqf:296-301). This is the strong waive: both planes and helicopters can pass AIR-tier gates at a held airfield.
  3. _airHeliWaive becomes true when a live Aircraft Factory structure exists and WFBE_C_AICOM_AIR_FACTORY_ENABLES_HELI > 0 (AI_Commander_Teams.sqf:303-324). This is heli-only unless the side also holds an airfield.
  4. Template and unit-data upgrade checks skip the WFBE_UP_AIR gate only when the relevant waive applies (AI_Commander_Teams.sqf:337-354). Non-air factory tiers still apply.
  5. If the side owns fewer than WFBE_C_AICOM_AIR_MIN_TOWNS and neither waive applies, air templates are stripped (AI_Commander_Teams.sqf:430-438). The current default is 3 (Init_CommonConstants.sqf:345).
  6. Fixed-wing templates are still filtered out unless the side holds an airfield and the jet time ramp permits them (AI_Commander_Teams.sqf:595-602, AI_Commander_AssignTypes.sqf:139-145). Current defaults are no jets before 7200 seconds and full availability by 18000 seconds (Init_CommonConstants.sqf:496-497).

The practical matrix is:

Held airfield Held Aircraft Factory Default result
No No No fixed-wing; helicopters must satisfy normal air/town gates.
No Yes Helicopters can pass AIR-tier gating through WFBE_C_AICOM_AIR_FACTORY_ENABLES_HELI; planes remain blocked.
Yes No Planes and helicopters can pass AIR-tier gating through WFBE_C_AICOM_AIRFIELD_FREE_AIR; planes still obey the jet time ramp.
Yes Yes Both waivers exist; airfield path covers planes and helicopters, factory path remains useful for helis if the field rule is changed later.

Founding And Spawn Routing

The earlier bug where AICOM helicopters spawned at the rear base even after an airfield was captured is fixed on this target.

AI_Commander_Teams.sqf:1144-1201 now distinguishes _isJetTeam from _isAirTeam:

  • _isAirTeam is true for any Air classname in the template, including helicopters and planes.
  • Air teams with _hasAirfield relocate _spawnPos to the owned airfield town's hangar, hangar fallback, or town position.
  • Helicopters prefer a nearby HeliH within 80m of the hangar and stay grounded.
  • Planes keep the raw airfield/hangar position, resolve the nearest LocationLogicAirport heading, and send _isJetTeam plus _runwayDir to the HC delegate.

The HC-side creation path then keeps the split:

  • Common_RunCommanderTeam.sqf:34-61 reads the trailing plane args, resolves a fallback runway heading if needed, and skips the usual ground/heli scatter only for planes.
  • Common_CreateTeam.sqf:12-18 documents the plane-only air-start argument.
  • Common_CreateTeam.sqf:149-158 creates plane hulls with the FLY special and fans multi-plane templates by WFBE_C_AICOM_PLANE_STACK_DEG; helicopters and ground vehicles keep the grounded FORM path.

This means a held airfield is both an eligibility signal and a spawn-location signal: it lets the commander consider fixed-wing air, then gives founded air teams an airport-origin position instead of the rear factory pad.

Research State

The stale Build 86 source-doc diagnosis said AICOM could not deliberately research AIR. That is no longer the full current-target truth.

Current target has a default-off research extension:

  • WFBE_C_AICOM_RESEARCH_AIR = 0 in all three maintained roots (Init_CommonConstants.sqf:909).
  • When the flag is enabled, AI_Commander.sqf:91-109 checks for a present Aircraft Factory using the same factory lookup idiom as the rest of the AI commander path.
  • If a factory exists, it appends [WFBE_UP_AIR,1] and [WFBE_UP_AIR,2] to the doctrine program, writes an AICOM log line, and emits AICOMSTAT|v2|EVENT|...|RESEARCH_AIR|appended.

So the current open policy question is narrower than the old bug report:

Question Current answer
Can AICOM research AIR by code path? Yes, behind WFBE_C_AICOM_RESEARCH_AIR.
Does default runtime force strict AIR research before helis? No. The research flag defaults to 0, while the Aircraft Factory heli waive defaults to 1.
Does default runtime force strict AIR research before captured-airfield aircraft? No. The captured-airfield free-air waive defaults to 1.
Is it safe to flip only WFBE_C_AICOM_AIR_FACTORY_ENABLES_HELI to 0? Not as a drive-by change. Pair it with a deliberate research policy and soak proof so AICOM does not stop flying.

Operator Checklist

Use this quick route before changing or debugging AICOM aircraft behavior:

  1. Confirm the town is really airfield-tagged: wfbe_is_airfield, wfbe_airfield_hangar_obj, and an owned sideID are the key signals.
  2. Confirm the capture rebuild spawned or refreshed wfbe_hangar and wfbe_airfield_side on the airport logic.
  3. For helicopters at base, inspect _isAirTeam, _hasAirfield, _haObj, and the nearby HeliH pad branch in AI_Commander_Teams.sqf:1147-1179.
  4. For planes not appearing, check _hasAirfield, WFBE_C_AICOM_JET_START_SECS, WFBE_C_AICOM_JET_FULL_SECS, and the total-air cap before blaming the roster.
  5. For strict research behavior, treat WFBE_C_AICOM_RESEARCH_AIR, WFBE_C_AICOM_AIR_FACTORY_ENABLES_HELI, and WFBE_C_AICOM_AIRFIELD_FREE_AIR as one policy set. Do not flip one in isolation and assume the rest of the air loop still proves itself.
  6. For landing or RTB problems, start from AI Mods And Pathfinding Reference: A2 OA fixed-wing landing is mostly map airfield/ILS and engine behavior, not something a generic AI mod solves.

Related Pages

Sidebar

Clone this wiki locally