Skip to content

08 — AI configuration (the AI/ folder)

Index

What the computer players build, where they put it, what they research and what they shoot at is described in text files in the game's AI/ folder. This chapter documents every keyword those files accept and explains how the AI uses the values during the game.

Contents

  1. The files and how they fit together
  2. Syntax, mods and error behaviour
  3. SupportTypes.txt — roles for the conventional war
  4. NuclearTypes.txt — roles for the nuclear war
  5. MissileCategoryMapping.txt
  6. DefenceDef.txt — what to protect
  7. GroupsConquest.txt — group compositions
  8. StrategyConquest.txt — strategies
  9. Support blocks: InvasionSupport, EndangeredRegion, NuclearDynamicGroups
  10. Conditional.txt — research reactions
  11. limits.txt — when the AI goes to all-out war
  12. DiplomacyTime.txt (optional)
  13. Recipes
  14. Pitfalls
  15. Covert operations (AI/CovertOps.txt)
  16. Personalities.txt (optional)
  17. StrategicValues.txt (optional)
  18. The Space line (SpaceTypes.txt, Space.txt)
  19. Mood.txt (optional)
  20. Game modes and mods with their own units
  21. The AI cache
  22. Infamy.txt (optional)

1. The files and how they fit together

File Defines
AI/SupportTypes.txt Support types: the roles units play in an invasion or region defence (MainForce, AirSupport, AntiAir, …)
AI/NuclearTypes.txt Nuclear types: the roles in the nuclear war (TriadGround, NuclearDefence, …)
AI/SpaceTypes.txt (optional) Space types: the roles of the Space line (SpaceGround, SpaceRecon, SpaceAttack, …), in the same table as the nuclear types (§18)
AI/MissileCategoryMapping.txt Which [AI_CATEGORY] weapon categories count as "strategic" etc.
AI/DefenceDef.txt Defence groups: which of our objects a defender should stand next to, and how much each is worth
AI/GroupsConquest.txt Group compositions: every unit group the AI can build — units, placement, targets
AI/StrategyConquest.txt (+ the files it USEs, AI/Default/*, AI/Airforce/*, AI/Submarines/*) Strategies: research lists and the build rules for defence, invasion, nuclear war and the Space line (Space.txt)
AI/Conditional.txt Research the AI adds when an enemy attacks it with, or is known to have, some technology or unit, or when it loses a unit
AI/limits.txt Global pollution thresholds per difficulty that escalate the AI to all-out war
AI/DiplomacyTime.txt (not shipped, optional) how long the AI remembers accepted/declined diplomatic offers (§12)
AI/Personalities.txt (optional) Personalities: named trait profiles, one drawn per AI faction at game start (§16)
AI/Mood.txt (optional) Mood rules: what changes a faction's mood toward another, and by how much (§19)
AI/Infamy.txt (optional) Isolation rules (Conquest): infamy, its stages, sanctions and the demands to spare civilians (§22)
AI/CovertOps.txt (optional) Covert operations: what covert units (spec-ops teams, bomb trucks) go for, what guards against them, the counter-spy unit (§15)
AI/StrategicValues.txt (optional) Strategic values: what a unit type is worth beyond its cost, for the Auto values (§17)

Files are read in this order; a file can only refer to names defined in files above it (and, inside GroupsConquest.txt, to groups defined earlier in the same file):

SupportTypes.txt ──► NuclearTypes.txt ──► SpaceTypes.txt ──► MissileCategoryMapping.txt
  ──► DefenceDef.txt ──► CovertOps.txt ──► StrategicValues.txt ──► Personalities.txt ──► Mood.txt ──► Infamy.txt
  ──► GroupsConquest.txt ──► StrategyConquest.txt (and the files it USEs) ──► Conditional.txt ──► limits.txt

DefenceDef.txt names support and nuclear types; GroupsConquest.txt names defence groups and support types (Follow), and a group's roles come from the units it leads; strategies name groups, support and nuclear types, technologies and AI weapon categories. SpaceTypes.txt is read into the same table as NuclearTypes.txt, so what can refer to a nuclear type can refer to a space type. DiplomacyTime.txt is read apart, for each AI faction as a game starts.

A file that is not there reads as empty. SupportTypes.txt and NuclearTypes.txt must exist, because loading stops without their mandatory types (§3, §4).

The model in one page

  • Every unit type that matters to the AI is assigned one or more support types and/or nuclear types — roles. A role measures power: the AI compares its own power per role against the enemy's power per role, region by region (support types) or globally (nuclear types).
  • The AI never builds single units. It builds groups (compositions) from GroupsConquest.txt: a leader unit plus escorts, a placement rule, and a target list. A group belongs to a role through its leader's unit type.
  • A strategy says which groups to build and when:
  • DefenseGroups — a static garrison, built before any invasion;
  • EndangeredRegion — extra forces for our regions at risk, sized against the enemy per role;
  • InvasionSupport — the force gathered against one enemy region, sized against the defenders per role;
  • NuclearGroups / NuclearDynamicGroups — the nuclear arsenal and its defences;
  • SpaceDynamicGroups — the satellites and their ground segment (§18);
  • DomesticGroups — research centres and other economy buildings;
  • and three research lists (DomesticTechList, InvasionTechList, NuclearTechList).
  • One strategy is picked per AI faction at game start, at random weighted by Probability. Its name is stored in save games (renaming it makes old saves pick a new random one).

2. Syntax, mods and error behaviour

The tokenizer is the same as for the unit files (00 — Basics): free-form, // and /* */ comments, "strings", keywords case-insensitive.

Name Matching
Unit type IDs ("Army_Division") case-sensitive; an unknown ID stops the game with Unit Type not found. A missile ID is also accepted (it resolves to the missile's virtual unit).
Technology IDs case-insensitive; unknown → Technology not found
Group names (Group Airport, "Airport" in a strategy) case-sensitive (exact)
Strategy names case-sensitive (exact)
Support/nuclear/space type names, DefenceGroup names, DEF names, personality names case-insensitive
AI weapon categories case-insensitive; unknown → Weapon category not found

A Yes/No value may also be written True/False or 1/0 (the shipped GroupsConquest.txt uses true).

Mods

All AI files are looked up through the mod system, so a mod can ship its own AI/… file to replace the original. To extend instead, start the file with USE PREVIOUS "AI/<file>" (see 00 — Basics §3):

// MyMod/AI/Conditional.txt
USE PREVIOUS "AI/Conditional.txt"

LostUnit "Army_Division"
  Research "Weapon_Modernization" Target

Support differs per file:

File USE IF / ELSE / ENDIF Defining an existing name again Removing
SupportTypes.txt, NuclearTypes.txt, SpaceTypes.txt yes yes replaces the whole type, which keeps its place in the table delete "Unit" from TypeName
MissileCategoryMapping.txt yes yes lines add to the class clear Class, "AI cat" delete
DefenceDef.txt no no a second group with the same name is ignored (the first wins) —
GroupsConquest.txt yes yes Group Name again re-reads that group in place —
StrategyConquest.txt yes (top level and inside a strategy) top level only Strategy "Name" again re-reads that strategy in place —
Conditional.txt yes yes same trigger + same kind (AttackedWith/EnemyHas/EnemyHasUnit/LostUnit) replaces —
limits.txt, DiplomacyTime.txt, CovertOps.txt, StrategicValues.txt, Mood.txt, Infamy.txt no no a later line or section overrides earlier values —
Personalities.txt no no the first profile of a name is the one found —

Since DefenceDef.txt, limits.txt, CovertOps.txt and Personalities.txt cannot USE PREVIOUS, a mod that changes them must ship a full copy. StrategicValues.txt, Mood.txt and Infamy.txt have the same limit, but a value left out of them keeps its default, so the copy needs only the values wanted (the standard strategic values are gone unless repeated).

⚠ An unknown word stops the file

Like the unit files, each AI list is read until a word comes that is not expected there. The game then shows a warning such as Error parsing file: (AI/Default/Invasion.txt, 127) unexpected "LaserDefenceSatellite" - the rest of this AI file was not loaded (also written to Fatal.txt) and carries on with what it has read. Unlike the unit files this is a warning, not a stop: fix the word and reload.

File An unknown or misplaced word…
SupportTypes.txt, NuclearTypes.txt, SpaceTypes.txt …at the start of an entry is taken as the name of a new type. A type without units is reported (AI support type "critical" lists no units), which catches misspelled flags and flags written after the unit list.
DefenceDef.txt …ends the file (every entry must start with DefenceGroup).
GroupsConquest.txt …ends the file. Groups below it do not exist, so loading then stops with AI group composition not found: X from the strategy file.
StrategyConquest.txt …ends the current strategy and the whole file. Inside a USEd part (e.g. AI/Default/Invasion.txt) it ends only that part; the strategy continues with the next line of the including file.
Conditional.txt, limits.txt, DiplomacyTime.txt, StrategicValues.txt, Mood.txt, Infamy.txt …ends the file.
MissileCategoryMapping.txt …shows a parse error (category names are checked).
CovertOps.txt …is reported and skipped; the file goes on with the next word.
Personalities.txt …is reported and skipped; every word up to the next Personality is reported the same way.

END and the end of the file are the normal ends and are never reported.

End these files with END: SupportTypes.txt, NuclearTypes.txt, SpaceTypes.txt, MissileCategoryMapping.txt, CovertOps.txt, Personalities.txt, Mood.txt, Infamy.txt. They are read until END, and without it the blank lines or comments after the last entry are taken for one more entry, which is reported (and in the type files makes a nameless type without units).

What stops the game at loading

These are errors the game cannot go on from. It shows the message and exits.

Message Cause
Unit Type not found X A unit ID that does not exist in SupportTypes.txt, NuclearTypes.txt, SpaceTypes.txt, DefenceDef.txt, GroupsConquest.txt (unit lists, DEF, DistanceFrom, Target, Avoid, AvoidContact, Return) or a strategy's Coverage By. This is the common one for a mod or a game mode with its own unit set (§20).
Technology not found A technology in a research list, NoNukeCitiesBefore, ObsoleteIfTech or Conditional.txt.
Weapon category not found: X An AI category in MissileCategoryMapping.txt or AllowWeaponType that the weapon files do not declare with [AI_CATEGORY].
AI group composition not found: X A group in a strategy, a TerrorGroup, LinkTo, SupportedBy, a …Transport or Copy that is not defined (or, inside GroupsConquest.txt, not defined earlier). Often the sign that an unknown word ended GroupsConquest.txt early.
AI group X - no Positioning type set, Error loading AI Group composition X A group without PlacementType, or without units.
Unknown Follow type, Unknown DefenceGroup, Unknown nuclear type, Unknown support type A Follow or DefenceGroup option, or a NuclearType / SupportType line of DefenceDef.txt, naming what does not exist.
Invalid points option, Invalid compare option, Invalid Complement Type, Unknown copy parameter A misspelled word after points, compare, ComplementPer N or Copy.
No AuxForce defined, No default main force unit type, Not all standard triad types defined, Exceeded maximum supported AI … types Fewer than two support types, none with units first, fewer than three nuclear types, more than 32 in a table.

These are reported (on screen and in Fatal.txt) and the game goes on: an unknown word, a type without units, misplaced Optional, and an unknown unit in CovertOps.txt, StrategicValues.txt, EnemyCheck Intercept … Defender or Threat, and EnemyHasUnit or LostUnit.

Check your files in the Cheats build (ICBM_CHEATS.exe): start a game, read the message and Fatal.txt. Start a game in each game mode too: each reads its own AI files and units (§20). A duplicated entry and a defence group whose defenders are missing (§6) give no message; look for them yourself.


3. SupportTypes.txt — roles for the conventional war

MainForce // MANDATORY SUPPORT TYPE! Occupies cities
  default "Army_Division"

AntiAir
  AntiAir
  compare "Bomber"
  "Destroyer" "Cruiser" "AA_Site_Old" "SAM_site" "MOBILE_SAM" "Laser_Defence_Complex"
END

Each entry is TypeName, then any number of flags (in any order), then the unit list (quoted unit IDs). Flags must come before the units. Up to 32 types in the table.

The first type is always the main occupying force and the second the auxiliary force — the game uses their positions (index 0 and 1), not their names. Loading stops with an error if fewer than two types exist. The names of all other types are free; they are referenced by name from strategies and DefenceDef.txt.

Flag Meaning
default "Unit" (first type only, inside the unit list) Marks the next listed unit as the default main-force unit: the yardstick for power comparisons. Without it the first unit is used (with a warning in the log).
compare "Unit" The enemy unit type this role's effectiveness is measured against (e.g. AntiAir vs "Bomber"). Default: the default main-force unit.
points Count / points RadarRange / points PreciseRadarRange How a unit's contribution is scored. Default (no points): its damage per second against the compare type (aircraft it hosts included), reduced for expensive weapon configurations; a damaged unit counts in proportion to its remaining power. Count = 1 per unit. The radar options score sensor coverage.
AntiAir Range checks use the unit's anti-aircraft reach.
AntiMissile Range checks use its anti-missile reach, counting only interceptors without a MinElevation (they can hit warheads near their target). A unit whose interceptors all have a MinElevation — the mid-course ABM_Site, which engages only missiles above 200 km and so protects nothing near it against short-range missiles — does not count for any region, not even its own; its place is the NuclearDefence nuclear type (§4).
CheckRadar (or RadarCheck) Range checks use detection range (sensors).
NumberByHosted When counting units, count the aircraft hosted by a base, not just the base.
NavalSupport Water-based support: evaluated with the naval reach rules.
CityInOccupationRange The unit can block occupation by having cities within its occupation radius (AuxForce).
SimpleOnTerritory Presence on the region's territory is enough (recon, spec-ops, terrorists): no range evaluation.

Each flag may be followed by Yes/No (AntiAir No). The shipped file also has critical, optional and recon commented out — they are not supported; uncommenting them would create empty types (reported as lists no units).

A unit listed in a type also gives that role to its high/low readiness states, and — if the unit is a Slave (aircraft) — to every unit type that can host it (so "Bomber" in AirSupport makes airports count as air support).

delete "Unit" from TypeName removes a unit from a type (use it in a mod with USE PREVIOUS).

The shipped types: MainForce, AuxForce, AirSupport, LongRangeSupport, StrategicSupport, NavalSupport, NavalSuperiority, AirSuperiority, AntiAir, AntiMissile, CoastalDefence, Reconnaissance, SpecOps, Terrorist.


4. NuclearTypes.txt — roles for the nuclear war

Same format as support types, with a smaller set of flags:

TriadAir // MANDATORY NUCLEAR TYPE!
  NumberByHosted
  "Bomber" "High_Speed_Bomber"

NuclearDefence
  points Count
  AntiMissile
  "ABM_Site"
Flag Meaning
points Count / RadarRange / PreciseRadarRange As for support types. Default: destructive value against cities.
AntiMissile Scored by anti-missile reach.
CheckRadar / RadarCheck Scored by detection.
NumberByHosted Count hosted aircraft.
NuclearBudget A strike leg. Every unit the AI builds sets aside part of its cost for nuclear builds (at least 10%, more as the nuclear war becomes likely). Whenever that nuclear share alone pays for the next unit of a nuclear plan led by a unit of this type, the AI builds it before the conventional unit it would build next. Plans of types without the flag (anti-missile, recon) and conventional plans compete by priority only. A type with NumberByHosted counts through its hosts: an airbase leading a TriadAir plan qualifies. The standard file sets it on the three triad types. With the flag on no type, nothing is built ahead this way.
Priority n Added to the build priority of the type's plans.
Space [Yes/No] Marks a space type. Every type in SpaceTypes.txt has it without the word (§18).
Essential n Space types only: the type's first n plans are built before the other legs (§18.1).

The first three types are the nuclear triad — ground, sea, air, in that order (loading stops with an error if there are fewer than three). The shipped types: TriadGround, TriadSea, TriadAir (the three with NuclearBudget), NuclearRecon (the over-the-horizon radar), NuclearDefenceTerminal (terminal ABMs and the laser defences), NuclearDefence (the mid-course ABM_Site), NuclearDefenceNaval (cruisers and destroyers). The triad's total power is what AI diplomacy compares between factions. Other names are free; they are used in NuclearDynamicGroups and in DefenceDef.txt. A strategy block can name only as many nuclear and space types as there are support types (§9).

Support-type and nuclear-type names live in one keyword namespace inside strategy files. Writing a nuclear type in an InvasionSupport block (or a support type in NuclearDynamicGroups) is accepted but silently maps to the same index of the other list (TriadGround there means MainForce). Keep the names distinct and use each in its own block.


5. MissileCategoryMapping.txt

Maps the [AI_CATEGORY] weapon categories of the weapon files (Units/Missile_types.txt, 02 — Missiles) onto the game's fixed classes:

Strategic "Strategic Nuclear" "SLBM" "Salted Weapons" "Orbital Strike"
  • Line form: Class "AI category" "AI category" …. A category followed by delete is removed instead. clear Class empties a class.
  • Classes: Conventional, Tactical, Strategic, Chemical, Biological, EMP, ASAT, AA, AM, Orbital.
  • Strategic: weapons in it are what the AI withholds until it decides on all-out nuclear war (and what it unlocks when someone uses strategic weapons against it).
  • Tactical, Strategic, Chemical, Biological, ASAT, Orbital: the levels of the restraint in Conquest scoring (§16, §18.4).
  • Conventional, EMP, AA, AM are accepted and have no effect.
  • A category in no class is never held back by these rules. The shipped Defensive Nuclear (the nuclear AAMs) is meant to be in none.
  • Every category named must exist: an unknown one stops the game (§2). A game mode or mod with its own weapon files declares its own categories and brings its own mapping (§20). With an empty mapping nothing counts as strategic, so nothing is held back before a first strike.

6. DefenceDef.txt — what to protect

A defence group tells defensive units (SAMs, terminal ABMs) where to stand: next to the most valuable of our objects that is not yet defended.

DefenceGroup Fixed_AAM
  "AA_Site_Old" Value 0.5               // defenders and their strength (default 1.0)
  Distance 200                          // km: a candidate within this distance of a defender is "covered"
  NuclearType "NuclearRecon" Value 6.0 Decrement 3.0
  SupportType "AuxForce"
  Unit "Research_Center" Value 2.0 Decrement 2.0
  City Value PopulationPercent 0.5 Max 5.0
Keyword Meaning
DefenceGroup Name Starts a group. The name is used in DefenceGroup Name placement options (§7).
"Unit" [Value v] (first, before other keywords) A defender type and its defence value (default 1.0).
Distance km Protection radius. Default 100 km.
Unit "Unit" [Value v] [Decrement d] A candidate to protect with its value (default 1.0). Each defender in range lowers the candidate's value by d (default 1.0). Value Auto [x k]: the value follows the type's strategic value for us (§17): k × √(strategic value ÷ the production cost of the group's cheapest defender), default k 1, so the last few of a valuable type get more defenders. Also for SupportType, NuclearType and CovertTargets.
SupportType "Type" [Value v] [Decrement d] All (non-Slave) units of that support type, as of load time.
NuclearType "Type" [Value v] [Decrement d] All (non-Slave) units of that nuclear type.
CovertTargets [Value v] [Decrement d] Every unit type enemy covert teams go for (on the ground, fragile, not an occupier; see §15) as candidates, each worth v × its TargetValue multiplier from AI/CovertOps.txt. Used by the shipped CounterSpy group that places Security_Checkpoint.
City Value Mode v [Min m] [Max M] [Decrement d] Our cities as candidates. Mode is required: Default (v), Population (v × population in millions) or PopulationPercent (v × city's share of the faction population, in %). Then clamped to Min…Max. Unit "VirtualCity" is the same line. No Value Auto here.

Later lines override earlier ones for the same unit: a Unit listed twice keeps only the later values, and a SupportType or NuclearType line overrides what is above it for every unit of the type. A Unit listed twice gives no message.

Defenders are also added automatically: every group composition whose PlacementType (not a strategy's DynamicPlacement) uses DefenceGroup X adds its leader units to X's defenders with value 1.0 (unless the defender was given a value explicitly). DynamicPlacement … DefenceGroup X does not register anything — a group placed only that way must have its leader units listed as defenders explicitly (the shipped Mobile_AAM and TerminalABM_Mobile do this). Otherwise its units do not spread out: they all go for the top candidate.

At run time, a defender placed with DefenceGroup X goes to the candidate with the highest remaining value in the region (ties broken at random). With NO_NEGATIVE a candidate at or below zero is never chosen: a new defender then uses the normal placement of its point type, and an existing defender that already protects something is not moved.

A defence group also decides how many defenders an endangered region needs, for the EndangeredRegion roles placed by it (§9).

The file has no USE/IF support and stops at the first line that is not DefenceGroup.


7. GroupsConquest.txt — group compositions

DEF "SAM_SITE_FIX" "SAM_site" then "MOBILE_SAM" then "AA_Site_Old"

Group Airport
  PlacementType Airbase
  DistanceFrom "Bomber"
  DistanceType flight
  "Airport" Leader
  "SAM_SITE_FIX" optional
  extra missile 10
  Target "Missile_Silo" Priority 8000 Nuclear
  Target City Priority 100 Nuclear
  Avoid "Security_Checkpoint"
  MaxTargets 3

A group is read in three parts, in this order: header keywords → unit list → target keywords. Anything out of order ends the group, and an unknown word then ends the file (§2).

7.1 Header keywords

Keyword Meaning Default
PlacementType Point [options] Required. Where the group is deployed (point types below). — (error no Positioning type set)
AlternativePlacement Point Fallback point types, tried in order when the main one has no free point. Repeatable. none
AttackType Point [options] Where the group goes to attack from. none
WaitType Point [options] Where it waits for the global attack order. none
PatrolType Point [options] [Area Point] [AreaLegs Min Max] [Wander Percent] Points it patrols between. Up to 5 lines (a further one replaces the last). Without Area, each new patrol point is near the previous one. With Area (see Patrol areas below), it patrols in an area around a point of the Area type. none
DistanceFrom "Unit" Unit type whose range sets the placement distance from the enemy (e.g. "Bomber" for an airport). the leader
DistanceType radar \| flight \| weapon Which range of DistanceFrom to use. weapon
LinkTo Group (or AttachTo) Ties the group to another group (army divisions to their army base). —
SupportedBy Group The AI also wants this group built when this one is (radar for ABMs, space centre for satellites). Repeatable. —
AirTransport Group / SeaTransport Group / SubwaterTransport Group Groups that can carry this one; also marks them as transports. Repeatable. —
CanOccupy Yes/No Can capture cities. Needs the value. No
CanAquireOptionalsFromExisting [Yes/No] May take existing units from other plans to fill its optional slots. (spelled this way) No
CanJoinAnotherPlanWithSameDestination [Yes/No] May merge with another plan going to the same place. No
CanDetachOptionals [Yes/No] Optional members may be detached for other tasks. Yes
ChangePositionAfterAttack [Yes/No] Hide and relocate when idle (mobile launchers, SSBNs): a unit with a "retreat" state (an SSBN diving) switches to it; a movable leader without one drives to a random point 1-2.5 × the map's BOARD_TOLERANCE (09 — Maps) away in its region, and so does a leader that moves while it changes state (AttackOnMove: an SSBN dives on its way there). Its attack orders also switch it to the retreat state once it cannot attack its target. A ground launcher (a TEL) or a submarine surfaced to fire (an SSBN) ends its attack order at the launch, switches to its retreat state (an SSBN dives) and gets no new order while its reload is longer than it needs to stop and set up again (for a surfaced submarine, to dive and surface again), so it moves on while it reloads. A shorter reload (several launchers, a quick reload) keeps the attack order: it stays where it is and fires again. Not used with LocalPatrol. No
LocalPatrol MinLegKm RadiusKm [Points Point Point ...] Keeps the movable leader always on the move around its anchor: the point the region tactics or a plan sent it to, otherwise where it first stood idle. Each time it stands idle, after a launch too, it drives a leg to a point at least MinLegKm from where it is and within RadiusKm of the anchor. A launcher keeps driving while it reloads: its attack order ends at the launch, the next attack comes once the reload is nearly done, and after it stops to fire it drives on to the same leg point. In a region too small for such a leg it takes the longest one found, at least a quarter of MinLegKm. The region tactics judge a patrolling leader by its anchor, not by where it is, so the patrol keeps the assignment. Against a TEL (Power 2) a 100 kt warhead kills out to about 55 km, 500 kt to about 95 km and 1 Mt to about 140 km. With Points, the leg goes to a random AI site of the listed land point types; without them, or when no listed site qualifies, it goes to a random point. The point is in the anchor's region and territory (ours or an ally's), and off the enemy border unless the anchor is at it. The patrol doesn't run during a patrol of the PatrolType points, a recharge, a transport or at the Easy AI skill. Example: LocalPatrol 100 200 Points MobileMissile CityDefence Radar for the support launchers. none
ObsoleteIfTech "tech" Read but has no effect. —

Groups referenced by LinkTo, SupportedBy, …Transport and Copy must be defined earlier in the file.

Point types

These are point classes the AI precomputes on the map:

Point Chosen for
MissileSilo Inland, away from our cities and borders, with good reach to enemy cities.
CityDefence Close to our populated cities (minimum of distance² weighted by population).
Radar Near the border with the enemy.
OverHorizonRadar Maximum coverage of enemy territory.
Airbase Reach to the enemy, not on the border.
SubmarineAttack Sea points within reach of enemy cities.
SubmarineHide Sea points just inside our reach to the enemy (hiding spots).
CarrierAttack Sea points with coverage of enemy territory, closer to land.
MobileMissile Moderately close to the enemy, good reach to enemy territory.
ObjectDefence Next to an object to protect — use with DefenceGroup Name.
NavalBase Our shore / nearby sea.
Orbit Satellites.
Shore Our land within 100 km of the open ocean (coastal batteries), the places with more sea within 500 km first (AIConfig SHORE_SITE_DIST, SHORE_GUN_RANGE, both in km).
CityControl A ground point next to each city, used to hold or capture it.
BorderDefence Along our land border with the enemy: at the crossings of the map's landing file (where a land path leads across), the ones leading to more of our cities first; spread along the border where it has no crossing. Make the AI cache again after the landing file changes (§21).
MarinesLanding, AirborneTroopsLanding, TroopsTraining, Industry Computed but not used by the shipped files.

Nearby and Any are additional point words that make sense only in a strategy's DynamicPlacement (§9): Nearby = any point in this region or the neighbouring regions.

Point options

Written after the point type, in any order:

Option Effect
self Use our own points (independent of the chosen enemy). Without it, points are chosen against the current enemy.
distant Keep away from our other units of the same kind.
closest Closest point to where the unit is produced.
free Skip points already taken.
FarFromBorder Keep the group away from hostile land: points closer than 500 km to the land of a region owned by anyone but us or our permanent allies are chosen only when no point far enough is in range. With Nearby placement: avoid points near an enemy border.
MinDistanceToBorder km (PlacementType only) FarFromBorder with this distance instead of 500 km.
FullCover (dynamic placement) every city of the region must be within range.
Safe Not under immediate threat. With Nearby: prefer another region if this one is invaded; on invasion: move to a safe border point.
Follow SupportType Dynamic placement following units of that support type.
DefenceGroup [NO_NEGATIVE] Name [NO_NEGATIVE] Place by the defence group's candidate values (§6).

Patrol areas

A PatrolType line can patrol an area instead of hopping from point to point:

Group HiddenPatrol
  PlacementType NavalBase self
  PatrolType SubmarineHide self distant Area SubmarineAttack AreaLegs 2 5 Wander 25
Word Effect Default
Area Point The area: a point of this type, chosen with the line's options. It is the first destination. The group deploys from a base linked to it (for sea points, the naval bases the AI cache links by water path). Later destinations are the patrol points linked to the area point (for SubmarineAttack, its hiding spots), or the nearest ones for point types without links. no area
AreaLegs Min Max After a random number of legs between Min and Max, a new area is chosen. 2 5
Wander Percent The chance, on each leg, of going to a free patrol point near the last destination instead of one of the area's own points. 25

With self, Area SubmarineAttack picks the sea points from which enemy submarines could hit our cities: a good place to hunt them.

7.2 Unit list

One line per slot: a quoted unit ID (or a DEF name) with an optional tag.

Form Meaning
"Unit" Required member.
"Unit" optional Nice to have; the group counts as complete without it.
"Unit" leader The leader; other members follow it. Without a leader line the first line is the leader.
"Unit" optional leader Both (note the order — leader optional ends the list, see §2).
"A" then "B" then "C" Alternatives in preference order: the first type the faction can build is used. The last one is the "minimum" used for automatic research (§8.3), so put the earliest-available unit last.
DEF "Name" "A" then "B" … (top level, outside groups) Defines a reusable alternative list; use it in groups as "Name".

A group's leader unit types decide its support/nuclear roles (§3, §4).

7.3 Target keywords

After the unit list:

Keyword Meaning Default
extra missile N / extra missile N to M Reserve loads to keep stocked, per launcher, scaled by the nuclear efficiency. With to M: N at nuclear war probability 0, rising linearly to M at probability 1. 0
DefaultAttackStrategy Lazy \| Immediate \| Defence Engagement rule for targets without their own tag (Immediate: for the listed targets only, see below). Lazy
DefaultAttackType Conventional Nuclear Special Weapon types for targets without their own (any combination). Conventional
DefaultPriority p Priority of targets not given one. 1
DefaultMaxDist km Max attack distance; -1 = the unit's weapon range. 1000
DefaultMax n Max groups engaging one target of a type. unlimited
DefaultFade f Priority multiplier per attack already made on a target. 0.02
DefaultCutOff c Targets with priority ≤ c are ignored. 0
Target "Unit" \| City [tags…] A target and its tags (below). Also applies to the unit's readiness states.
Avoid "Unit" \| City Never target it (priority 0).
AvoidContact "Unit" \| City [Dist km] Keep away from it while moving. 1000 km
Copy Targets Group Copy all target settings of an earlier group (overwrites what was set before).
Copy AvoidContact Group Copy its avoid-contact list.
MaxTargets n Targets to engage at once. 1
PriorityDivider d Switch target only for one with ≥ d × the current priority. 50
Return when type "Unit" n [type "Unit" n …] Return to rearm when fewer than n hosted units of that type remain.

Default… lines reset all targets' values, so put them before the Target lines (except DefaultPriority, which only changes targets still at the old default).

Target tags, any order:

Tag Meaning
Lazy The ordinary rule: a target only of a faction at war with us (or a forced target), and only once it is in the weapon range of the group (its aircraft included).
Immediate Hunted, not only fired at: valued up to MaxDist (not just in range), so a mobile group moves to it, a base or carrier launches at it, a ground leader may follow it into a neighbouring region. Also taken from a faction not at war with us when our units would engage it anyway: on our territory with a hostile order, an approved attack on units on our territory, or a type that does not trigger war when attacked (aircraft, spec-ops teams, bomb trucks). One immediate target at a time, when the group has no ordinary one and is free (not occupying, not on a covert mission).
Defence (Defense) Like Immediate while the target is on our or allied territory; elsewhere an ordinary target.
Priority p Importance (default 1, or DefaultPriority). Priority Auto [x k]: k × the strategic value of the target for its owner (§17), default k 50, so an enemy's last over-the-horizon radar becomes a top target. A relay has a condition of its own (§18.3).
Fade f Priority multiplier applied each time the target has been attacked.
CutOff c Ignore while priority ≤ c.
MaxDist km Max distance (-1 = weapon range).
Max n Max groups attacking one such target at once.
Conventional, Nuclear, Special Allowed weapon types (combine): non-nuclear weapons, nuclear weapons, and configs with the Special flag (01 — Units §3.1). Without any: DefaultAttackType.

Without an engagement tag a target gets DefaultAttackStrategy — except a nuclear-only target, which is always Lazy. A default Immediate covers only the types the group lists with Target (or gets by Copy Targets): every other type stays Lazy. A default Defence covers every type (the army groups defend against whatever enters our territory).

Units fire on their own at what is in range (weapons with AutoEngage), and hosts scramble their aircraft at air intruders, whatever the AI's targets: the tags above decide what the AI sends its groups at.

Special defaults, applied before the Default… lines and the targets of the group:

  • Cities — nuclear attack only, Fade 0.4. As a nuclear-only target a city is Lazy. A Target City line without a weapon tag switches it to DefaultAttackType.
  • Units with AttackIfDestroyed (silos, launchpads, over-the-horizon radars, special airports, satellites, …) — Lazy, because destroying them can trigger the owner's retaliation. Whatever their tag, the AI targets them only once it attacks that owner's strategic assets or cities (the nuclear war, a global attack). Such a unit counts only while it stands on its owner's or an ally's territory (satellites always): one left in a region an enemy took is an ordinary target.

8. StrategyConquest.txt — strategies

Strategy "Default"
  PreferNuclear 50
  Probability 100
  USE "AI/Default/Tech.txt"
  USE "AI/Default/Invasion.txt"
  …

A strategy is Strategy "Name" followed by settings, in any order and any number of times; USE "file" inside a strategy reads that file's settings as part of it (this is how the shipped strategies share the AI/Default/* parts). A USEd file that itself starts with Strategy is read as a list of strategies.

8.1 Settings

Setting Meaning Default
Probability n Selection weight (0–10000). A strategy whose critical techs are disabled in the game gets weight max(n/10, 1). 100
Backup Excludes the strategy from the normal random pick; it is used only when that pick has nothing to choose from (all other strategies at Probability 0). A later Probability n sets its weight among backups.
PreferNuclear n 0 = invasion only, 100 = nuclear only; in between it splits research between the invasion and nuclear lists. 50
WantShareNuclear, BlockShareNuclear Diplomacy preference on sharing nuclear technology. off
ForceOptionalTechnologies Also auto-research the techs of optional groups (§8.3). off
CannotKeepRegionThreshold f Region defence gives up when our completeness falls below this. In diplomacy such a region is valued at completeness / threshold of its normal value (at least 5 %). 0.75
CannotKeepRegionThresholdForSupport f Same, for support roles (multiplies CriticalThreshold). 0.5
CannotKeepHysteresis f A region judged lost (by CannotKeepEndangeredShare or CannotKeepRegionThreshold) counts as holdable again only when it is clear of the limit by this share: the missing army power below the limit times (1 - this), or the force ratio above the threshold times (1 + this). Without it a region right at the limit could flip on every AI cycle, its armies leaving and coming back. 0 = no hysteresis. 0.2
CannotKeepEndangeredShare f An endangered region (not invaded yet) cannot be kept when the army power it still misses is more than this share of the faction's whole army power: it is no longer a safe region to deploy to or retreat into, and it does not draw armies from regions that can be held. (Invaded regions use CannotKeepRegionThreshold.) 0.5
ShouldAttackProactivelyThreshold f Strength advantage needed to strike pre-emptively. 1.5
OverwhelmedInCityThreshold f, OverwhelmedCityAttackersThreshold f When defenders in a city count as overwhelmed. 1.5, 0.75
SuppressionAvoidance Yes/No Normal difficulty and up only. Ground groups shot at by units they cannot answer (ships, submarines, long-range missile sites) react instead of standing still: finish an occupation that is about to complete (or keep blocking an enemy capture), close in on a reachable attacker, move out of its range, or hold and make it a priority target. Independently of this switch, region defenders leave a city shelled by ships when no enemy ground unit is at it, retreat points are chosen outside naval range, and such ships become priority targets. Yes
SuppressionSurvivalFraction f A move (closing in or moving out) is taken only if it ends within this fraction of the time the attackers need to destroy the group. 0.75
SupportFireFocus f An invasion is not started, or is called off, when the enemy's support units we cannot answer (aircraft, missile launchers) would destroy the occupiers of one of the region's cities before all its cities are occupied at the same time (a city freed starts its occupation anew). This is the share of their fire counted on one city's occupiers; never less than an even share over the cities. 1 = all their fire on one city. 0.5
SuppressionNuisanceTime f Ticks: attackers that need longer than this to destroy a group (after the repair it gets where it stands) are ignored, unless the group is about to complete the capture of its region. A single attacker this weak does not decide where the group goes while stronger ones are there. 24000
SuppressionRangeMargin f The exit point is chosen outside the attacker's range times this. 1.25
SuppressionReevaluateTime f Ticks a taken decision is kept unless the set of attackers changes. 600
SuppressionMoveOutLimit f Ticks after the last shot at which a group that moved out stops waiting on its exit point for the attackers to go away. It leaves sooner for a city the attackers do not reach. 12000
RedeployCooldown f Ticks: an existing unit the region tactics redeployed is not redeployed again before this time has passed (stops units being sent back and forth between two regions). Newly built units are not affected. 0 = off. 0
RedeployCooldownMargin f When the cooldown is skipped: always for a region of a higher type than the unit's current one (invaded or being invaded by us > endangered > potential invasion target), never for a lower type; for the same type when the region tactics rank the new region higher and its value is this many times the current one's. Never within the same region; a unit whose region no longer needs it is free. 0 = the cooldown always holds. 2
AttackSyncMaxWait f Normal difficulty and up: the armies going for the same fight (attacking ground units, or moving to points in an enemy region, within 250 km of one target, whoever owns it) wait for the slowest of them so they arrive together. An army more than this many ticks behind the fastest one is not waited for; it joins the armies of its own arrival time instead. 4000
InvasionTargetSwitchMargin f A unit already assigned to one potential invasion target is moved to another only when the new target's chances, with the unit counted there, stay ahead of the old one's by this many times the unit's strength. The chances follow the enemy armies near the targets, so without a margin one enemy army crossing a border could send a whole stack of armies from one target to another and back. The same margin applies when a unit leaves an endangered region for an invasion: the region must keep a surplus of this many times the unit's full strength (more for a cautious personality, less for an aggressive one), so an army lent to an attack is not pulled back home at once. 0 = any lead. 1.5
NuclearThreatWeight f Conquest: the enemy nukes in reach of a region but not in it (launchers, bombers, submarines far away), permitted against us by the enemy's restraint, count as enemy strength there × this: each unit's nuclear damage per second against our armies, spread over the regions it reaches. A region under nuclear threat needs a wider margin to invade, is given up sooner when it cannot be held, and lowers the local balance the diplomacy reads. 0 = only the enemy units in and near the region count. 0.5
SuppressionMaxAttackerRange f Km: an attacker whose range against the group is longer than this (strategic missile carriers) is no reason to move out or close in; the group stays. 2000
NuclearThreatConcern f f f How much a rival's nuclear forces concern the faction: a rival at war with it, one bordering it, one further away (allies 0). Each rival's weight is this × its willingness (below); it scales the rival's launchers in the nuclear requirements against all (the anti-missile defence) and its readiness for a nuclear war in the faction's NuclearWarProbability. 1 0.6 0.3
NuclearThreatWillingness f f A rival's willingness to use nukes before it has nuked any city (0..1), and the number of cities it must have nuked (× its nuclear efficiency) for the willingness to reach 1. 0.35 15
NuclearThreatUsedOnUs f f f A rival's shown willingness is the larger of the cities it has nuked (NuclearThreatWillingness) and its recent nuclear hits on the faction: each strategic nuclear hit (each unit a nuke damaged, each nuke shot down) adds 1 / the first value to a level that never passes 1, a tactical hit the second value of that; the level halves every third value in ticks from the last hit (a passing threat, kept through a peace treaty or a ceasefire: the rival may strike again when it ends; a big exchange is the full threat when it ends, half of it 108000 ticks later with the default). 6 0.25 108000
BuildShareBySupportType b The build order: the support types with plans waiting (MainForce, AntiAir, LongRangeSupport, CoastalDefence, …, by the plan's leader unit type, of them only the types its group is listed under in the strategy's defence and invasion sets) take turns, each in proportion to how incomplete it is (1 − the lower of its mean completeness over the regions defended and over those invaded or that may be invaded; a little for a type with only optional sets waiting); inside a type's turn its plans go by their priority levels. A plan whose leader has no support type takes part too: the counter-spy unit (CovertOps.txt CounterSpyUnit, the Security Checkpoint) in the SpecOps turn, the rest (bases, airports, radars, research and space centres, sea transport) in a turn of their own weighted by the support types' mean. A nuclear plan stays outside the turns and goes first when its priority level is at least as high as every support plan's. No = strictly the highest priority level first: every lower level waits while any higher one has something. Yes
BuildShareArmyWeight f MainForce's turn in the build order: this many times its incompleteness. 2
BuildShareArmyFloor f Below this mean completeness in the regions it defends, MainForce takes a share 1 − completeness / f of the turns in the build order: every turn with no army, fading to the usual weights at f (0: off). Nuclear plans are not affected. 0.35
BuildShareTypeWeight type f Another support type's turn in the build order x f (one line per type; e.g. BuildShareTypeWeight LongRangeSupport 1.5). An item chosen outside the turns (under a nuclear plan on top, a turn that found nothing, a quicker item slipped in) is charged to the turn of its unit's waiting support type the most behind. 1
NuclearInferiorityWeight f Conquest, the nuclear restraint: the faction's conventional inferiority against an enemy (0 at half of the two sides' forces or more, 1 with none) shrinks the losses thresholds of its escalation (tactical, strategic, cities) by this × it. A faction far weaker than its enemy falls back on its nukes before it has lost much. 0 = only the losses count. 0.5
NuclearThreatRestraintScale f The faction's own NuclearWarProbability × (1 + this × (0.5 − its nuclear restraint)): a faction ready to use nukes arms for a nuclear war sooner. 0 = the restraint does not matter. 0.6
NavalHoldTimeout f Ticks a loaded transporter (or an empty sea transport) holds off out of reach when its destination or landing is within reach of enemy ships or coastal guns and no safe landing exists; its escorts attack the blockers meanwhile. Then it proceeds. 48000
CovertBlockerWeight f, CovertInvasionWeight f, CovertCounterWeight f, CovertSearchWeight f Weights of the spec-ops mission kinds (section 15), 0 = never. 1
CovertTransportPenalty f Time units (400 ticks each, the unit of Speed) added to the travel time of a spec-ops mission on another land mass. 30
TerrorStrikeInterval f Ticks between two planned bomb-truck strikes at Terrorism 1; divided by the trait. 86400
TerrorMaxTrucks f Most bomb trucks a faction keeps at Terrorism 1 (the trait scales it). 4
TerrorGroup "group" The group built for a bomb-truck strike, on demand (section 15). TerroristSmall
TerrorBuildAhead f Ticks before a strike is due (the TerrorStrikeInterval cadence) that its truck may be asked for, when no truck is free. 43200
TerrorBuildPriority n The build priority of that request (the region requests use -3..2: 2 an endangered region or the invasion under way, 0 the normal). 1
TerrorMaxMissions n Bomb trucks on terror missions at the same time at most; a truck takes one only when TerrorStrikeInterval / Terrorism has passed since the last strike or the last mission taken (a mission dropped without a strike does not count). 2
AllowWeaponType "AI category" Yes/No No = this strategy does not use that weapon category by default. all allowed
DomesticTechList, InvasionTechList, NuclearTechList Research lists, §8.2.
NoNukeCitiesBefore "tech" … No full-scale nuclear attack on cities before these are researched (only with ResearchHoldsAttacks).
ResearchHoldsAttacks The invasions wait for the invasion list's MinRequired techs (and the active conditional ones), the full-scale nuclear war for the nuclear list's and NoNukeCitiesBefore. Without it the research goes on, but the attacks do not wait for it. Blitz sets it. off
DecapitationBlindWindow n The Space line: when a decapitating strike starts, its tactical and strategic nukes wait up to n ticks after the war's start while the anti-satellite weapons go for the target's early warning satellites first. They launch at once when the target's nukes hit, when one of its nuclear launches is seen, or when no early warning satellite is left with an anti-satellite pass ahead. Blinding is an option, not a requirement: with no early warning satellite known, or none within reach of its anti-satellite launchers, the nukes do not wait. 6000
DefenseGroups, DomesticGroups, NuclearGroups Static build lists, §8.4.
InvasionSupport, EndangeredRegion (or DefenseSupport), NuclearDynamicGroups, SpaceDynamicGroups Dynamic build rules, §9 (SpaceDynamicGroups: §18.2).
SpaceLine On/Off Whether the strategy uses SpaceDynamicGroups (§18.2). Yes/No also work. Off
InvasionGroups [Minimal list] [complements…] Sets required before an invasion starts, on top of the defence's. The Blitz strategies use it, the standard ones do not.

IF is not recognised inside a strategy: it ends the strategy, so wrap whole strategies at top level.

8.2 Research lists

InvasionTechList
  "Weapon_Modernization" Target
  "AWACS"
  "Tactical_nukes" MinRequired Critical

Each entry is a tech with optional tags (Critical may come before or after the other tag):

Tag Goes to Effect
(none) the optional queue Researched when nothing better is pending.
Target the target queue Preferred research.
MinRequired the minimum queue Researched first. With ResearchHoldsAttacks the invasion (or nuclear war) waits until all minimum techs of that list are known.
Critical — If this tech is disabled in the game or for the faction, the strategy becomes unavailable (low selection weight).

In DomesticTechList, MinRequired is treated like Target. There is no Optional tag in tech lists. Parents are researched automatically, so you only list the techs you want. The same tech may appear in several lists.

How the next research is chosen (when the queue is empty):

  1. Collect the first unknown step towards every tech in: active MinRequired conditional techs, the domestic target list, the invasion minimum list and the nuclear minimum list.
  2. If the domestic candidates have the lowest tech level, research a domestic one. Otherwise pick between invasion and nuclear: the list with the lower tech level wins; on a tie, nuclear with probability PreferNuclear %.
  3. Among the chosen list, a random candidate at or below the current tech level (else at the lowest level).
  4. If that candidate is above the current tech level, or step 1 found nothing, do the same with the conditional Target techs and the domestic/invasion/nuclear target lists, then with the conditional Optional techs and the optional lists.
  5. If still nothing, any researchable tech at random.

Techs a research-sharing ally is already researching are skipped.

8.3 Automatic techs

After a strategy is read, the techs of the leader units of these sets are added to the lists (to all units' techs with ForceOptionalTechnologies), with Critical:

From Added to When
DefenseGroups minimal set, InvasionGroups Minimal, NuclearGroups Minimal invasion minimum list PreferNuclear < 100
NuclearGroups Minimal / Target nuclear minimum / nuclear target list PreferNuclear > 0
NuclearGroups Optional nuclear target list with ForceOptionalTechnologies
DomesticGroups Target (Optional) domestic target (optional) list (optional: with ForceOptionalTechnologies)
NuclearDynamicGroups main sets and complements nuclear target list PreferNuclear > 0
InvasionSupport, EndangeredRegion main sets and complements invasion target list PreferNuclear < 100
SpaceDynamicGroups main sets and complements of the space types a space target list, researched while the line is on PreferNuclear > 0

For "A" then "B" alternatives the last alternative's tech is used. backup groups are fallbacks and add nothing.

8.4 Static build lists

DefenseGroups
  Minimal
    "ArmyBaseDef" x 1
    "Patrol" 2
  ComplementPer 15 RegionGDP Once
    "ArmyBaseDef" x 1
  Optional ComplementPer 1 WaterBorderRegion
    "BestCoastalDefence"
  Coverage Dist 2000 By "Air_Transport"
    "ArmyBaseDef" x 1

Group list items (used here and in §9): "Group" [backup "Group2" …] [x N | N] [DynamicPlacement Point options] [OnInvasion|OnBuildUp reaction]. backup (or alternative) names fallback groups, used when the main one is not available yet or is less cost-effective. x N repeats the item.

A block written again in the same strategy adds to the lists before it (a mod's part file can USE PREVIOUS the shipped part and add a DefenseGroups block). In a dynamic block a role written again adds its groups and EnemyCheck lines; its min, max and CriticalThreshold are replaced where given.

Block Contents
DefenseGroups [Minimal] list [complements…] [Coverage…] The garrison. The minimal list and every non-optional complement must exist before the AI starts an invasion.
DomesticGroups [Target \| Minimal] list [Optional list] Economy buildings.
NuclearGroups [Minimal list] [Target list] [Optional list] Minimal: needed before invading (so the AI can answer a nuclear attack). Target: when complete (with the techs of NuclearTechList minimum and NoNukeCitiesBefore), the AI may start the global nuclear attack. Optional: nice to have.

Complements — [Optional] ComplementPer N Type [Over M] [Once | Max K] followed by a group list. After and Past are other words for Over, OneTime for Once.

Type Adds
Region(s) one set per N of our regions (rounded down: fewer than N regions → none). Over M: only regions beyond M count.
WaterBorderRegion(s) the same, counting our regions with a coastline
EndangeredRegion(s) the same, counting regions at risk
RegionGDP per region: one set when its share of the faction's GDP is ≥ N % (more for bigger shares: ⌊share / N⌋). Over M: counts the share above M %.
RegionCity / RegionCities per region: per N/100 cities — so ComplementPer 1 RegionCity means one set per city
LandSegment(s) per region: per N/100 separate land masses (Over 1 → only for the 2nd one onwards)
GDP / GeneralGDP once for the whole faction: our total GDP share is always ≈ 100 %, so this gives ⌊100/N⌋ sets
CovertTargetValue per region: one set per N points of the summed covert target value of our units there (cost / power × TargetValue, §15), so the regions with the most to lose to enemy spec-ops get the most checkpoints
NuclearWarProbability one set per N % of the nuclear-war probability as this faction sees it (0–100 %: the highest of its own population losses against its desperate level, its nuclear concern after nuclear strikes seen, and each rival's readiness for nuclear war × the willingness that rival has shown — by nuking cities, or by its nukes used on the faction (NuclearThreatUsedOnUs) — weighted by how close the rival is — at war, bordering, further away; scaled by the faction's own nuclear restraint, a low restraint arming sooner; outside Conquest also the global pollution, 100 % at 0.2). The same value sets the share of production the faction keeps for nuclear builds.
EnemyCounterSpace, SpaceAmbition the Space line's sources, §18.2
Effort accepted, has no effect

Once = at most one set; Max K = at most K sets (per region for the per-region types). Optional before ComplementPer makes that complement optional (not required before invading; still built). It applies to the next complement only; Optional not followed by ComplementPer is reported.

Coverage — Coverage [Dist km] [By "Unit"] list: makes sure every region is within Dist (or the safe flight range of By, whichever is smaller) of a unit of the listed groups, adding groups to the farthest uncovered regions.


9. Support blocks: InvasionSupport, EndangeredRegion, NuclearDynamicGroups

These three blocks size forces against the enemy, per role:

  • InvasionSupport — per enemy region we plan to invade: how much of each support type to gather.
  • EndangeredRegion (alias DefenseSupport) — per own region at risk: extra forces.
  • NuclearDynamicGroups — globally against each potential enemy, per nuclear type.
  • SpaceDynamicGroups — the same grammar, for the space types while the strategy's SpaceLine is on (§18.2).
EndangeredRegion
  AntiAir
    min 0
    max 10
    EnemyCheck Number AirSupport 0.1
    CriticalThreshold 0.3
    "BestSAMSiteDef"
      DynamicPlacement ObjectDefence self DefenceGroup Fixed_AAM NO_NEGATIVE
      OnInvasion add Safe
    ComplementPer 5 RegionGDP Max 10
      "BestSAMSiteDef"
    WaterOnly
      min 1 max 4
      "HiddenPatrol"

The block is a sequence of role sections. Each section is: role name → parameters → main set (group list) → complements → optionally WaterOnly + parameters + its own main set and complements (used when the region has no land connection to us). If the block starts directly with a group name, it is a MainForce main set with min 1. Roles not mentioned get no forces; the block ends at the first word that is not a role name.

A group listed under a role its leader unit does not have gets that role added to the unit, with a line in Fatal.txt (InvasionSupport and the main sets of NuclearDynamicGroups).

Parameter Meaning Default
min n [OnInvasion\|OnBuildUp n2] Minimum number of main sets; the second value applies while the region is invaded / the invasion is being built up. 0
max n [OnInvasion\|OnBuildUp n2] Maximum number of main sets generated from enemy strength (complements are not capped by it). 200
EnemyCheck [Number] [Deficit] [Role] v [OnInvasion\|OnBuildUp v2] Size against the enemy: by power (default) or by Number of units, of Role (default: this role), times v. Deficit uses only the enemy's surplus over ours. Repeatable: power checks add up, number checks add up, and the larger of the two results is used. EnemyCheck 1.0 against this role
EnemyCheck Intercept Role L [OnInvasion\|OnBuildUp L2] [Salvo f] [MaxPer m] [Defender "Unit" f2]... [Threat "Unit" f3]... Size a missile or air defence by interception: the main sets it takes so that each missile (warheads and decoys of a MIRV counted) or aircraft of the fraction f (default 1) of the salvo of the enemy's Role units in range gets through with a chance of at most L. It uses the role's main-set leader the faction can build, its default weapon config, both sides' techs: the kill chance per shot, the shots one defender fires while the threat crosses its range, and the shots needed. Weapons that cannot be intercepted (guns, beams) ask for nothing. MaxPer m: at most m sets per enemy unit (a defender the formula judges badly cannot ask for the region's max at once). Defender "Unit" f2 (repeatable): the sets counted with that defender type times f2 (e.g. Defender "MOBILE_SAM" 0.5: a type the formula over- or underrates). Threat "Unit" f3 (repeatable): the sets an enemy unit of that type asks for times f3, 0 leaving it out. An aircraft counts only when it has a weapon against ground units or against the defender (not fighters, interceptors, AWACS). An enemy unit reaching n of the faction's regions under evaluation counts 1/√n in each (it cannot strike them all at once, but may concentrate on one). A faction we are not at war with counts half. The sets are counted per enemy faction: the region takes the strongest faction's sets plus a quarter of the others' (not every neighbour's units as if they all struck at once). The units an enemy unit hosts count too (an airbase's aircraft), and its airway places (CanHostAircraft) as full with each type as its owner's are on the whole, when it has fewer aboard. A ballistic missile is engaged only while its arc is within the weapon's range of its impact point and between the weapon's MinElevation and MaxElevation; every threat only beyond the weapon's MinRange. Adds to the Number checks; for a role that protects objects, at least these sets minus our defenders in the region are missing. —
CriticalThreshold f Completeness (our ÷ required) below which the role blocks the invasion / counts the region as not defendable. 0 = never critical. Forced to 0 for roles without groups. 0

WaterOnly does not inherit the main section's parameters: give them again. Without WaterOnly the water case copies the main section.

Group list items are as in §8.4, with placement overrides:

After a group Effect
DynamicPlacement Point [options] Overrides the group's PlacementType for this use (Nearby, FullCover, FarFromBorder, DefenceGroup X are the common ones).
OnInvasion / OnBuildUp + reaction What to do when the region is invaded (EndangeredRegion) or while building up the invasion (InvasionSupport):
…none stay
…Border move to a border point in the same region
…SafeBorder move to a border point in another region
…DynamicPlacement Point [options] switch to that placement
…add options keep the placement, add options (e.g. add Safe)
…Block do not deploy until the invasion is over

Complements use the per-region types (RegionGDP, RegionCity, LandSegment) — and in NuclearDynamicGroups, NuclearWarProbability (in SpaceDynamicGroups also the sources of §18.2). An Optional complement is built only when optional groups are forced (for an invaded region, optionals are forced).

How the numbers combine for one role: required power = max(enemy power checks, enemy number checks × one main set's value). The AI generates min main sets, then the non-optional complements (their value is subtracted), then as many more main sets as needed for the remaining power, up to max. Groups that already exist nearby are counted against this before anything new is built. Each main-set group is replaced by its first backup that is available when the main group is not, or that covers the region better.

Roles that protect objects. In EndangeredRegion, a role whose first main-set group is placed by a defence group (DefenceGroup X in its DynamicPlacement, or in the group's PlacementType; in the shipped data AntiAir → Fixed_AAM and AntiMissile → TerminalABM) is sized by what it protects instead:

  • EnemyCheck lines only tell whether a threat exists — any enemy unit of a checked role in range of the region, before the factor and rounding;
  • except EnemyCheck Intercept: at least its sets minus our defenders of the role in the region are missing (the larger of the two counts is used);
  • with a threat, the region needs as many main sets as it takes to bring every candidate of X in the region to zero (§6): a candidate with remaining value r and decrement d needs ⌈r ÷ (d × the defender's value)⌉ defenders, using the main set's leader as the defender. min and the non-optional complements still apply, the larger number is used, up to max;
  • our defenders count where they stand next to a candidate (within Distance), not by the cities they can reach, and they are already subtracted from the candidate values, so the result is what is missing. Completeness is the strength of those defenders against the strength still missing.

The other roles, and these roles while the region is invaded with an OnInvasion Block reaction, keep the enemy-based sizing above.

There is no Optional "Group" form inside these blocks. Optional is only valid immediately before ComplementPer; Optional "Group" ends the block (and is reported).


10. Conditional.txt — research reactions

AttackedWith "Chemical_Weapons"
  Research "Chemical_Weapons"
  Research "CBRN_Defence_1"

EnemyHas "Satellite"
  Research "U_Space_radar"
  Research "M_ASAT" Target
Trigger Fires when
AttackedWith "tech" a unit of this AI is hit by another faction's weapon (or by the unit launching it) whose tech is tech or descends from it
EnemyHas "tech" the same, or espionage finds that a rival has such a tech
EnemyHasUnit "unit" one of this AI's sensors sees a rival's unit of this type, or espionage reveals one (its units or its reserve)
LostUnit "unit" one of this AI's units of this type is destroyed by a unit or a weapon (anyone's)

A rival is a faction at war with the AI or one it has a bad attitude towards; allies never count.

Then Research "tech" [MinRequired | Target | Optional] lines (default MinRequired). Once triggered, a reaction stays active for the rest of the game and its techs join the research lists of §8.2 at the matching priority. Applies to every strategy. A MinRequired reaction holds the invasions until its techs are known, but only in a strategy with ResearchHoldsAttacks.


11. limits.txt — when the AI goes to all-out war

[Normal]
  StartWar 0.10
  KillAllButAllies 0.3
  KillAllButAlliesWithLessScore 0.65
  KillAll 0.85

Sections [VeryEasy], [Easy], [Normal], [Hard], [VeryHard], [Insane] (the AI difficulty), each with the four thresholds compared with the global pollution level (0 = clean; the nuclear-war probability is treated as 100 % from 0.2):

Key Above the threshold the AI…
StartWar …may target any enemy city, and (above StartWar × √(1 + eliminated factions)) stops weighing production efficiency in its attacks. At or below it (outside Conquest mode) the AI nukes enemy cities mainly in a scripted/forced global attack or in retaliation (the enemy bombed more of its cities than it did theirs).
KillAllButAllies …attacks every non-ally.
KillAllButAlliesWithLessScore …also attacks allies with a higher score than its own.
KillAll …attacks everyone.

A value above 1 effectively disables a stage. The three Kill… stages do not apply in Conquest mode. Defaults if the file or a key is missing: VeryEasy 0.15/0.4/1.5/1.5, Easy 0.125/0.35/0.75/1.5, Normal 0.09/0.3/0.65/0.85, Hard and above 0.06/0.25/0.55/0.75.


12. DiplomacyTime.txt (optional)

Not shipped. If present, read once per AI faction at game start:

TimeToSustainAccept
  CeaseFire 300
  Alliance 1200
TimeToSustainDecline
  War 600
END

How long the AI keeps to its decision on an accepted or declined offer before reconsidering it. Unlike the other AI files this one counts in game seconds of 60 ticks each. Request names: CeaseFire, PeaceTreaty, Partnership, Alliance, CooperationAgreement, Territory, Technology, Intelligence, Hardware, War, Contributions, WithdrawForces, StopContributions, Aid, StopSupport, StopWar, KeepFighting, StopCovert, SpareCivilians, Sanction, LiftSanctions. Default 600 for all. A misspelled name is reported and the rest of the file is skipped.


13. Recipes

13.1 A mod that adds a unit

A new unit is invisible to the AI until the AI files name it: nothing fails, but the AI never builds it and does not count an enemy's. Touch these files, in this order, for a unit "New_SAM":

File What to do Needed
SupportTypes.txt, NuclearTypes.txt, SpaceTypes.txt Put it in the roles it plays. There is no "add" word: define the type again whole, its flags and all its units, under USE PREVIOUS (it keeps its place). The unit's readiness states come with it, and for a hosted aircraft its hosts. For the AI to count it, its own and an enemy's.
GroupsConquest.txt Add it as an alternative to a group ("New_SAM" then "SAM_site" leader), or extend a DEF, and the group's plans use it once it can be built. Otherwise a new Group, with PlacementType, leader and targets. List the earliest-available alternative last (§7.2). For it to be built.
AI/Default/*.txt (the strategies' parts) Only for a new group: list it in a block (§8.4, §9). A group no strategy lists is never built. A mod's part file can start with USE PREVIOUS and add a block. For a new group.
Research lists The techs of leaders in required and dynamic sets are added by themselves (§8.3). Add the tech to a list only for optional groups or to set its priority. Sometimes.
DefenceDef.txt A defender placed through DynamicPlacement … DefenceGroup X must be listed after DefenceGroup X; with PlacementType … DefenceGroup X it registers itself (§6). A valuable unit gets a Unit "New_SAM" Value … line, unless a SupportType or NuclearType line already covers it. The file has no USE: ship the whole file. For defenders, and what is worth defending.
Targets in GroupsConquest.txt An unlisted type is a target of priority 1 for every group. Add Target "New_SAM" Priority … to the groups that should go for it, Avoid where they should not. Readiness states come with the line. Priority Auto follows StrategicValues.txt. For enemies to rate it.
StrategicValues.txt A line if it is a strategic asset. Sometimes.
CovertOps.txt TargetValue, or HardTarget for what teams must leave alone. A ground unit that fits is a covert target without any line (§15). Sometimes.
Conditional.txt An answer to seeing or losing it (EnemyHasUnit, LostUnit). Sometimes.
MAPS/… Nothing: the AI cache does not depend on units (§21).

Removing or renaming a unit is the reverse and is not optional: every AI file that names the old ID stops the game or warns at loading (§2). Start a game with the mod in the Cheats build to check.

A role example, a USE PREVIOUS file with the whole type:

// MyMod/AI/SupportTypes.txt
USE PREVIOUS "AI/SupportTypes.txt"

AntiAir
  AntiAir
  compare "Bomber"
  "Destroyer" "Cruiser" "AA_Site_Old" "SAM_site" "MOBILE_SAM" "Laser_Defence_Complex" "New_SAM"
END

13.2 A mod that adds a weapon

Where What to do
The weapon's AICategory (02 — Missiles) Decides the restraint. A nuclear, chemical or biological weapon with no category of a class is not held back (§5, §16). A new [AI_CATEGORY] (at most 32) goes into MissileCategoryMapping.txt under USE PREVIOUS.
The weapon's AIHint (02 — Missiles §7) Decides whether the AI picks a config with it over another.
The unit's configs A new weapon on a unit the AI already builds needs no AI file: the configs are compared by themselves, so the weapon is used once its technology is known and the targets' tags allow it.
Target lines Conventional, Nuclear, Special must allow the weapon's type (§7.3). Configs flagged Special are used only where the tag says so. A launcher that must keep missiles in reserve needs extra missile N.
AllowWeaponType "AI category" No Keeps a strategy from using a category by default.
Anti-satellite weapons A config whose missiles are all in Anti-Satellite, and satellite targets on the group (§18.3).
Research A weapon's technology is not added by its unit's: list it in a research list, or in Conditional.txt.
A missile or air defence The sizing by EnemyCheck Intercept reads the weapon by itself (§9). An interceptor with MinElevation does not count for the AntiMissile support type (§3).

13.3 Other recipes

A mod that adds a strategy without replacing the shipped ones:

// MyMod/AI/StrategyConquest.txt
USE PREVIOUS "AI/StrategyConquest.txt"

Strategy "Rush"
  PreferNuclear 10
  Probability 50
  USE "AI/Default/Tech.txt"
  USE "MyMod_AI/RushInvasion.txt"
  USE "AI/Default/StaticDefence.txt"
  USE "AI/Default/DynamicDefence.txt"
  USE "AI/Default/Nuclear.txt"
  USE "AI/Default/Space.txt"
  USE "AI/Default/Domestic.txt"

USE PREVIOUS must be the first line; strategies follow. Keep new file names distinct from the shipped ones (or use USE PREVIOUS inside them too).

A mod that adds groups: USE PREVIOUS "AI/GroupsConquest.txt" then your Group entries. To change a shipped group, define it again under the same name: it is re-read completely (write the whole group).

Make the AI more peaceful on Normal: raise StartWar and KillAllButAllies in [Normal] of limits.txt (ship the whole file).

Test: start a skirmish with AI factions in the Cheats build, check for messages and Fatal.txt, and watch what they build.


14. Pitfalls

The most common one, the order of the tags on a leader line:

  "Mobile_ICBM" optional leader   // right
  "Mobile_ICBM" leader optional   // ends the unit list here: the rest of the group, and of the file, is lost
  • Order inside a group — header keywords, then units, then targets. "Unit" leader optional ends the unit list (write optional leader).
  • Optional works only right before ComplementPer.
  • Defence groups used only through DynamicPlacement need their defenders listed explicitly (§6).
  • Same role name in both namespaces — keep support-type and nuclear-type names distinct (§4).
  • DefenceDef.txt and limits.txt cannot USE PREVIOUS; a mod ships the whole file.
  • ObsoleteIfTech, the Effort complement type and the Conventional/EMP/AA/AM mapping classes are accepted and have no effect.
  • END must close eight of the files (§2).
  • A unit or AI category the game mode does not have stops the game at loading, even in a file the mode does not use otherwise (§20).
  • DistanceType flight sets the deployment distance only. The distance used when choosing a backup group and for FullCover checks uses the leader's weapon range.
  • Renaming a strategy or group: old save games then pick a new random strategy, and drop the AI's plans for groups that no longer exist.

15. Covert operations (AI/CovertOps.txt)

Optional file, read after DefenceDef.txt. It tunes what the AI's covert units (hidden ownership on the ground: spec-ops teams, bomb trucks) go for and what the AI defends against them. Everything in it works from Normal difficulty up. Without the file the values computed from the unit data apply. It has no USE or IF; end it with END.

Every unit named in it should exist: an unknown one is reported on screen and the line is ignored. A game mode or mod with its own unit set brings its own AI/CovertOps.txt (Blitz has one with no entries: it has no covert units); one that only adds to the standard units can use the standard file.

TargetValue "Research_Center" 3.0
TargetValue "ICBM_Launchpad" 4.0   // long-range and nuclear launchers first
HardTarget "Missile_Silo"          // a team cannot destroy it
GuardRangeCap 100
IncidentMemory 72000
END

A unit type is a covert target when it is on the ground, is not an occupier and is not covert itself. A unit that can fire at a team next to it (a weapon against ground units with a minimum range under 20 km; a ballistic missile launcher cannot) is a target only when the attacker's team destroys it in less than 0.75 of the time it needs to kill the team (both at full strength); on the way such a target also counts as a guard of itself: a team or a bomb truck strikes when the way in (and a team's time to destroy it; a truck needs only to arrive) stays within the same share of its time to kill them; its value for a team is ProductionCost / Power (costly and fragile first) times its multiplier. A guard is any unit that can see or shoot a covert unit; the ranges come from the unit's sensors and weapons.

Keyword Meaning Default
TargetValue "Unit" v Multiplier on the computed value (0 = never a target). TargetValue "Unit" Auto: the target's strategic weight and scarcity for its owner (§17: strategic value ÷ cost). 1
SoftTarget "Unit" / HardTarget "Unit" Force a type to be / never be a covert target. by the data
Guard "Unit" / NotGuard "Unit" Force a type to count / not count as a guard. by the data
CityValue v Value of a city per million inhabitants (bomb trucks). 1
GuardRangeCap km Sensor ranges above this do not widen a guard's circle. 100
GuardAttackCap km Weapon ranges above this do not widen a guard's circle (long-range weapons need a spotter to hit a hidden unit). 150
UnarmedGuardRange km A unit with no weapon against the covert unit and nothing hosted, whose sensors cannot identify covert units (no IdentifiesCovert), is no guard to walk round unless it sees the covert unit farther than this (a radar site's own sight sees covert units at 37.5 km). 50
MaxMissionDistance km A spec-ops team or bomb truck takes no mission on its own land mass farther away than this (straight line); enemy covert units are chased within 2000 km. 2500
MaxRemoteMissionDistance km Nor one on another land mass (by transport) farther away than this. 6000
ResponseMaxAttackers n Attackers sent at most on an enemy covert unit seen on our territory (an incident of its region, never a priority target; never with nukes). Only groups whose Target lines name its type respond, on our territory as a Defence target (in GroupsConquest.txt: the army groups, AirportTactical). 2
CounterSpyUnit "Unit" The unit built where enemy covert units were seen or struck (one per incident, placed by its own group). Security_Checkpoint
IncidentMemory ticks How long a covert incident keeps its region on alert (the counter-spy builds there). 216000 ticks are a game hour. 72000
SearchMemory ticks A region searched is not searched again, a target given up is not taken again, a team that found no transport does not ask again, before this. 108000
RetaliationMemory ticks How long an identified covert strike on us justifies a covert reply (TerrorRetaliation, §16). 216000
CaughtMemory ticks How long after destroying a covert unit of a faction we may ask it to stop its covert operations against us (the deal item "Stop covert operations"). 108000
PromiseLength ticks How long that promise holds. 216000
PromiseGrace ticks Covert units of the faction destroyed this soon after its promise do not break it (they may still be on their way home). 36000
DeceitPriority f A faction that promised without meaning to keep it (CovertDeceit, §16) goes on with its operations against the one it promised, its targets at this times their priority. 0.5
ProgressWait ticks A mission ends when the team gets no 20 km closer to its destination in this time (4× while it walks round a guard). 2000
TransportWait ticks A mission transport not served by then is given up; a team stays aboard at most this long idle, 3× on a mission. 108000
WarheadWait ticks A bomb truck on a nuclear mission waits at home this long for its warhead. 216000
RetargetInterval ticks How often a team on a mission looks for a better one within RetargetDistance. 400
RetargetFactor f / RetargetDistance km A mission there takes over only when it scores this many times the current one (score = priority / travel time). 2 / 500
OpportunityDistance km / OpportunityMinLeft km A target this close to a team is struck on its way, whatever its priority, while the mission's own target is farther than the second distance (the guards are checked as for any mission). 100 / 350
OpportunityInterval ticks How often a team looks for such a target (a team walks its Speed, 60-110 km, every 400 ticks). 100
AbandonNearTarget km A mission given up under fire marks its target given up (SearchMemory) only when the team was this near it. 200
StrikeSurvivalFraction f A guarded target is struck when the team's exposure stays below this share of the guards' time to kill it. 0.75

A covert unit is not identified by its attacks: its owner becomes known only to the faction that destroys it (a sensor with IdentifiesCovert, 04 — Radars, would identify it too - none is shipped). Without identification a covert unit, its attacks and its wreck stay anonymous for that faction. A covert unit that triggers no war when attacked (DoesNotTriggerWarWhenAttacked) and whose owner is not identified is always attacked, whatever the diplomatic state.

Spec-ops missions. From Normal difficulty up the teams of a SpecOps-type group do not walk to a random spot: every think cycle the AI lists missions and each team takes the best one it can reach on its land mass (priority over travel time): the defender of a zone where our aircraft or missiles were lost (blocker), anti-air, radars and missile sites in a region we invade or are likely to invade (invasion), an enemy covert unit seen on our territory (counter), or a region worth a look that no team searched within SearchMemory (search). The team approaches round the circles of the guards it knows of, switches its charge on when in reach, strikes, and flees out of every guard's circle when shot at. Strategy settings CovertBlockerWeight, CovertInvasionWeight, CovertCounterWeight, CovertSearchWeight (default 1, 0 = never) scale the kinds. The group's own Target and Avoid lines still apply when no mission is available. A mission on another land mass is reached through the normal transport request of the plan; CovertTransportPenalty (default 30 time units of 400 ticks) is added to its travel time when choosing.

Bomb trucks. The strategy's TerrorGroup (default TerroristSmall, the Bomb_Truck) is built only by a faction whose personality has Terrorism above 0, and on demand: no region set builds trucks. One is asked for when a strike is due within TerrorBuildAhead ticks (the cadence below), a faction the warhead may be used on exists and no truck is free (built and not on a terror mission), at the build priority TerrorBuildPriority; the faction keeps at most the trait times TerrorMaxTrucks trucks (default 4: 0.2 is one truck, 0.6 two, 1 four). A truck waits where it was built until a terror mission takes it: it is not deployed to a region and takes no targets of its group outside a mission. Such a faction researches what its lightest truck needs (the espionage branch is in no research list) as its first choice whenever its research slot is free, but never ahead of its tech level. Every TerrorStrikeInterval ticks divided by the trait (default 86400), counted from the last strike or the last mission taken, a truck may take a mission, up to TerrorMaxMissions trucks out at once (in the strategic stage - strategic nukes allowed on a victim by the nuclear restraint, outside Conquest the global attack - every free truck takes one when it can, with no interval and no such cap): on the cities of a victim (anonymous, so not held back by the NoNukeCitiesBefore techs; a low priority in Conquest) and/or on its ground units (by cost and the TargetValue multiplier of CovertOps.txt), as TerrorTargets says. The trucks are nuclear by definition: a strike is planned only on a victim the warhead may be used on, outside the no-nukes time and, unless UsesNukesFirst, only on a faction that nuked our cities; otherwise the trucks wait. Victims are the factions at war with us; with TerrorPreWar also those who attacked us or whose regions we consider invading; with TerrorRetaliation any faction whose own covert strike on us was identified, for RetaliationMemory ticks. The truck approaches like a team (round the guards it knows of), arms the warhead on the last 60 km and drives in with the attack order.

For every faction that never identified the truck (its attack identifies nothing) the explosion is anonymous: no war, no cities-bombed count, no first use of nuclear weapons, only a covert incident that calls for checkpoints. A faction that did identify it treats the strike as an attack by its owner and remembers it for a covert reply.

The promise to stop covert operations. A faction that destroys a covert operative of another (CovertOperative in Units.txt: the spec-ops teams and bomb trucks, not their transports) on its own land (allies' operatives excepted) learns its owner, and for CaughtMemory ticks may ask it in a deal to stop its covert operations against it for PromiseLength ticks. At peace, the catch also lowers its mood towards the owner by the unit's CovertOperative value, times CovertCaughtNuclearFactor with a nuclear weapon on board (§19); catches do not add up, and the mood fades. An AI that catches one asks for the promise once per catch, at peace, with no threat. An AI asked for it values it by its covert effort (SpecOps, Terrorism), twice as much at war, and accepts more readily when it was just caught. A faction that keeps the promise sends no teams or trucks against the other: their missions there are dropped, a team left there without a mission walks home, its defence against the other's covert units stays. A faction that promised without meaning it (its CovertDeceit, drawn when the promise is made) goes on, its targets there at DeceitPriority. Either way, a covert unit of its destroyed by the other after PromiseGrace ticks breaks the promise (between two AI factions only one on a mission against the catcher - not one crossing its land to another target or going home): the one it promised thinks worse of it (CovertPromiseVictim), the others a little (CovertPromiseOthers), and its threats are believed less. A war started between the two ends the promise; renewing it is possible in its second half.

16. Personalities.txt (optional)

The keyword reference; what the diplomacy traits mean in play is in chapter 20.

Named trait profiles. At game start every AI faction draws one by Probability (the same random as its strategy), a saved game keeps it by name. Without the file every AI uses the defaults. Traits not listed in a profile keep their defaults. Read after StrategicValues.txt; ends with END; no USE or IF. Probability and AggressiveProbability must come right after the name, in this order (default 100 and 0): later in a profile they are reported as unexpected. With the Aggressive AI game setting the draw is by AggressiveProbability n instead: a separate set of personalities, the profiles without it are not drawn then; when no profile has one, Probability decides as usual.

Personality "Rogue"
  Probability 20
  Aggressiveness 0.7
  Terrorism 0.6
  TerrorTargets Both
  TerrorPreWar Yes
Trait Meaning Default
Aggressiveness f A scale (0.5 neutral): attack a neighbour when the win probability is above 1 − f; the enemy power seen at our endangered regions and at the invasion targets × (1 + 0.5 − f) (Cautious 0.35: ×1.15, more defence wanted and invasions only with a wider margin; Rogue 0.7: ×0.8); how badly an inland region must need defence to come before the border targets; peace treaties valued at a local balance + 0.5 × (f − 0.35). 0.5
NuclearRestraint f Conquest scoring: 0..1, how long nukes stay the last argument (0 = an ordinary weapon). The strategic nukes against an enemy's forces and assets. 0.5
TacticalNuclearRestraint f The same for the battlefield nukes. half the NuclearRestraint
CityNuclearRestraint f The same for any nuke on cities. halfway from the NuclearRestraint to 1
ChemicalRestraint f The chemical weapons (MissileCategoryMapping class Chemical), the same way but a step no higher than the tactical nukes (allowed whenever they are) and with no peace offer before it; once used on a faction, either way, free against it for good. the tactical restraint
BiologicalRestraint f The biological weapons, and chemical ones on cities: the desperate step - the regions or population lost (not the forces) past 0.15 + 0.6 × it while losing, or the enemy's use in this war; decided anew in every war. the city restraint
BetrayalPossibility f The faction may attack a partner (never a permanent ally) when its win probability against it is above 1 − f. 0 = never. 0.5
DesperateLevelLosses f The share of its population lost at which the faction's own losses count in full in the nuclear-war probability (§8.4). 0.75
UsesNukesFirst Yes/No No: bomb trucks strike only a faction that has nuked this faction's cities. Yes
HesitantToNukeCities f, InvadesFirst, UsesChemsFirst, UsesBioFirst, NukesCitiesFirst Accepted, have no effect (for chemical and biological weapons see the restraints above).
Terrorism f 0..1: bomb-truck effort (the trucks are nuclear), 0 = the faction never uses them. 0
TerrorTargets Cities/Assets/Both What the trucks go for. Both
TerrorPreWar Yes/No Strikes on potential enemies before a war (the hidden ownership gives deniability). No
TerrorRetaliation Yes/No A covert reply after being hit by a covert strike. Yes
SurpriseStrike f 0..1: the chance that a war the faction would threaten with an ultimatum starts instead at once, without any warning, by a decapitating nuclear strike on the target's strategic forces - only when that is appropriate (the target's conventional forces strong, the faction's nuclear forces in good shape). Other factions remember it: alliances with the attacker are worth less. 0 (Balanced 0.15, Rogue 0.7)
SpecOps f 0..1: the share of the planned spec-ops teams the faction rebuilds with priority after losses (at least one). 0.5 (Cautious 1)
Greed f 0..1: how much better than even a deal must be for the faction to take it, and what its counter-offers aim at - a margin of 0.5 × f in deal value. None for a gift, nor for a deal it needs (a ceasefire it wants). 1.2 × (Aggressiveness − 0.35), at least 0 (Cautious 0, Balanced 0.2, Rogue 0.45)
Bluff f 0..1: how readily the faction threatens what it will not carry out - a war ultimatum without the strength for the war, a nuclear threat while losing. Refused, it backs down and the threat counts as broken for everyone, so a known bluffer's threats stop working. 1.2 × (Aggressiveness − 0.3), at least 0 (Cautious 0.05, Balanced 0.25, Rogue 0.6, Classic 0.2)
Courtship f 0..1: how readily the faction courts a faction it wants as a friend (one sharing its threat or target, or a partner): cooperation agreements and technology trades both sides gain from, now and then a technology as a gift, and a partnership once both are well disposed. Sets how often it tries (every 24000 / f ticks) and what a courtship may cost it (1 + 4 × f in deal value). 0.9 − Aggressiveness (Cautious 0.7, Balanced 0.5, Classic 0.4, Rogue 0.2)
CovertDeceit f 0..1: the chance the faction promises to stop its covert operations against a faction (§15) and goes on with them, less often. Caught again, the promise is broken. 1.2 × (BetrayalPossibility − 0.3) + 0.5 × Terrorism, at least 0 (Cautious 0, Balanced 0.25, Rogue 0.8)
SpaceAmbition f 0..1: how far the Space line goes past observing: the source of the ComplementPer n SpaceAmbition lines of Space.txt (§18.2). 0.3 + 0.6 × (Aggressiveness − 0.35) (Cautious 0.4, Balanced and Classic 0.39, Rogue 0.7)
SpaceRestraint f 0..1: the Space step of the restraint, attacks on satellites and the attrition from orbit (§18.4). T + 0.6 × (NuclearRestraint − T), T the tactical restraint
FirstNukeWait n Ticks: a nuclear level open at once by a restraint of 0.2 or less waits until the war is this old or the enemy has used nukes or chemical or biological weapons on the faction, whichever comes first. 0: at once. Conquest only. 18000 (Classic 0)
Humanity f 0..1: what the faction tolerates of others' killing (Conquest). Every faction has an infamy, the record of its deeds: civilians killed, cities struck on purpose, inhumane weapons, nuclear use. The faction's mood toward the doer falls by the deed's points × Humanity × its relation to the victim (the victim and its allies 1, a bystander 0.4, the doer's ally or an enemy that had it coming 0.1). From 0.5 it may also demand that the killing stop, and back an ultimatum with a war. (CityNuclearRestraint − 0.2) / 0.8 (Cautious 0.88, Balanced 0.69); Rogue 0.2
SanctionAt f The infamy from which the faction sanctions another it is not allied to and dislikes (mood below 0): it ends its cooperation agreements, contributions and aid to it and trades it no technology, hardware or intelligence; with the match setting EconomicSanctions on (09 — Maps), the target's production and science fall by its share of the world's production. Lifted below half of it. 3 × (1 + Greed) / Humanity, at most 20 (Cautious 3.4, Balanced 5.2, Classic 3); Rogue 12
MassacreMood f / MassacreMood Never The massacre during an invasion: the faction's armies occupying a city of a faction it is at war with fire their massacre weapon at it - a conventional weapon that can be used against cities, Massacre Civilians on the Army Division - while its mood toward the city's owner (−10..+10, hostile from −2) is at or below f. The city's population falls, and its occupation time with it; each shot is a deed of the faction's infamy (civilians killed on purpose). An army fires one shot whenever the weapon is ready and has no other target; it stops when the city is occupied, the war ends, a ceasefire starts, or the faction has promised to spare civilians. An AI army's attack on a city fires only its conventional weapons, never its nuclear or chemical artillery. The victim's own mood falls by each shot's points x DeedVictim (AI/Mood.txt). Never (Cautious, Classic); Balanced −5; Rogue −2

Nuclear restraint (Conquest scoring). An AI uses a level of nukes against an enemy only once it is permitted, for the rest of that war:

  • the level's restraint is 0.2 or less (a reckless personality); or
  • that enemy used the level against us first (any nuke on our units grants the tactical level, a strategic one the strategic level, a nuked city the cities level); or
  • our losses in the war (the largest share of our regions, our forces against the enemy's, or our population lost since the war started) exceed 0.15 + 0.6 × the restraint. With the defaults: tactical at 30 %, strategic at 45 %, cities at 60 %.

Chemical and biological weapons (classes Chemical, Biological) are restrained the same way, without the steps and peace offers below: chemical with the tactical nukes, by a low ChemicalRestraint, by the losses, by the enemy's use, and against a faction for good once used either way; biological - and gas on cities - by a low BiologicalRestraint, by the regions or population lost, or by the enemy's use in this war (a peace ends it).

A higher level grants the lower ones. A strategic permission from a low restraint alone (0.2 or less) does not lift the faction's classic strategic block (ready for a first strike, or the war so far); one earned by losses or by the enemy striking first does. The shipped Classic profile (Probability 0, AggressiveProbability 100: the Aggressive AI setting's personality, never drawn otherwise) has next to no restraint: NuclearRestraint 0, TacticalNuclearRestraint 0, CityNuclearRestraint 1 (cities at 75 % losses). Defensive nukes (AI category Defensive Nuclear: the nuclear AAMs) are always allowed. The levels are the Tactical and Strategic classes of MissileCategoryMapping.txt. Other scoring modes keep the pollution-based escalation. In Conquest the cities level, not DesperateLevelLosses, decides nukes on cities.

Escalation by losses, with peace offers. A level granted by losses (not by a low restraint, not by the enemy using it first) goes in steps, per level and per enemy:

  1. a peace offer first: the diplomacy's own ceasefire offer (the AI wants a ceasefire, as when it is losing: it asks nothing for it and gives technology and hardware when asked), waited for 2 × the diplomatic reaction time × (0.5 + the level's restraint);
  2. no peace: the escalation, with a budget: cities - 5 more city hits (or as many as the enemy hit, if more); tactical and strategic - 10 × (1.5 − the restraint) warheads more at its units;
  3. the budget used, our nukes not getting through (below), or nothing fired in 12000 ticks: another peace offer;
  4. no peace again: no limit.

A level whose nukes are all banned (or not available) does not escalate and starts again from the peace offer after an unban; the cities level counts lost regions and population only; a peace stage waits until its offer was sent. Back to none when we are no longer losing or the losses fall below half of the threshold (an escalation holds 6000 ticks at least). A restraint of 0.2 or less skips all of this. So does a level held anyway (the enemy used it first). A city permission makes the faction's groups attack, but it is no total war: its diplomacy goes on and no other faction becomes an enemy for it. The cities level also escalates when the proportional retaliation below is used up while the enemy keeps hitting ours.

Cities: retaliation. After an enemy nuked our cities, an AI may hit up to as many of its cities + 2 (while losing: twice as many + 2). The hits count, not the launches: the enemy's defences shoot many down, so the launches go on while the hits are below the limit.

Nuclear delivery. The game records, per pair of factions, our warheads that the defences could stop (tactical and strategic missiles, a MIRV's warheads; not the decoys, not nuclear shells) that reached the other faction and those its defences shot down (a MIRV carrier shot down: its warheads). The share that arrives (2 arrivals assumed before any is seen; each new warhead fades the older record by 0.97, about the last 30 count; kept across wars with the same faction) scales the faction's nuclear power against it: the faction power and the nuclear balance, so the war outcome, the win probability, the deals and the votes all see nukes that do not get through as weak. Below 40 % after 5 warheads, an escalation turns to another peace offer.

Our nukes in flight at what we may not hit any more self-destruct: those at its cities beyond the hits left to the limit (the ones in flight count), those at a level revoked (a peace offer step included), and all at a faction we are no longer at war with (a ceasefire, a peace).

17. StrategicValues.txt (optional)

What a unit type is worth to the AI beyond its production cost: the strategic assets (over-the-horizon radars, satellite relays, silos), more when their owner has only a few left. Without the file every type is worth its cost. The file needs no END and has no USE or IF. An unknown unit is reported and its line ignored, an unknown keyword ends the file. A game mode or mod with its own unit set brings its own list (§20).

StrategicValue "Over_Horizon_radar" Weight 20 Scarcity 2
StrategicValue "Missile_Silo"       Weight 8  Scarcity 10
City PerMillion 1
Keyword Meaning Default
StrategicValue "Unit" [Weight w] [Scarcity n] The value of one unit of the type for its owner = production cost × w × max(1, n ÷ the units of the type the owner has, all its states counted). Scarcity 2: the last one is worth twice as much; Scarcity 10: the last of ten silos ten times one of many. Weight 1, no scarcity
City PerMillion v A city's value per million inhabitants. 1

The counts are taken on every AI cycle for every faction. The values are read by Value Auto in DefenceDef.txt (§6, our own values), Priority Auto in GroupsConquest.txt (§7.3, the enemy's values) and TargetValue ... Auto in CovertOps.txt (§15).

18. The Space line (SpaceTypes.txt, Space.txt)

The AI's satellites, their ground segment and its attacks on other factions' satellites form a line of their own next to the nuclear and covert ones. It is decided per faction, not per region: an orbit passes over every region, and one relay serves the whole globe. The handles are the roles (§18.1), the requirements per strategy (§18.2), the groups and their targets (§18.3), the weapons' AI categories and the traits (§18.4), and the relay as an asset (§18.5).

18.1 AI/SpaceTypes.txt: the roles

Read right after NuclearTypes.txt into the same table, with the same grammar (§4: points, CheckRadar, AntiMissile, NumberByHosted, NuclearBudget, the unit list, USE, delete "Unit" from Type); ends with END. Each type is marked as a space type. A name must not repeat a support or nuclear type's. Without the file there are no space types, and a word naming one in a strategy block is an unknown word, which ends the block and the part file (§2; the shipped Nuclear.txt names SpaceRecon). Every unit in the file must exist: a game mode without these satellites needs its own file, empty if it has no Space line (§20).

SpaceGround // the space center and the relay that gives every satellite its range
  points Count
  Priority 1
  Essential 1
  "Space_Operations_Center" "Satellite_Relay_Station"
Flag Meaning
Priority n Added to the build priority of the type's plans.
Essential n The Observation minimum, while the line is on: the type's first n plans get +5 while a unit is missing, come before the other legs and are paid from the nuclear budget in either build stage (§4, NuclearBudget).

The shipped types:

Type Units Flags besides points Count
SpaceRecon Satellite CheckRadar, Essential 1
SpaceAttack Kinetic_Strike_Satellite, Countervalue_Laser_Satellite Priority 1
SpaceDefence Laser_Defence_Satellite AntiMissile
SpaceGround Space_Operations_Center, Satellite_Relay_Station Priority 1, Essential 1
SpaceWarning Early_Warning_Satellite
CounterSpace Hunter-Killer_Satellite
SpaceSensor Space_radar Essential 1
  • points Count matters: the default value counts nukes, so a satellite with conventional weapons is worth 0 and its plan is dropped.
  • The ASAT launchers are not a space type: they are the nuclear launchers' groups with satellite targets (§18.3).
  • Keep the names CounterSpace and SpaceAttack: the EnemyCounterSpace source below finds them by name.
  • Add a new type at the end, so that the others keep their places in the table.

18.2 AI/<strategy>/Space.txt: the requirements

StrategyConquest.txt USEs one per strategy (Default, Submarines, Airforce). Two strategy settings:

Setting Meaning Default
SpaceLine On / Off On: the space types take their sets from SpaceDynamicGroups, and the rivals' counts in their EnemyCheck lines are the units the faction's sensors have tracked (seen once, counted until destroyed). Off: SpaceDynamicGroups is not used; the space types keep what NuclearDynamicGroups gives them. Off
SpaceDynamicGroups The sets, with the grammar of NuclearDynamicGroups (§9). An EnemyCheck may name any type of the table, nuclear ones too (EnemyCheck Number TriadGround 0.5). Each check is rounded, so a factor too small asks for nothing.

While the line is on, the techs of these groups' units are researched as a target list of their own.

Besides NuclearWarProbability a complement can read two sources. ComplementPer n adds one set per n % of the source, so ComplementPer 50 SpaceAmbition Max 1 is one set from SpaceAmbition 0.5 up, and ComplementPer 25 SpaceAmbition Max 2 is one from 0.25 and two from 0.5.

Source Value
SpaceAmbition The personality's trait (§16).
EnemyCounterSpace 1 when a faction not allied with us has tracked units of the types CounterSpace or SpaceAttack; 0.5 when we are at war (missiles and covert teams can reach a relay); else 0.

backup in a space type replaces a group only when the group cannot be built. The comparison of reach and value in §9 does not apply: an orbit has no reach to compare, and by value per build time the cheaper satellite would always win.

The sets of the Default strategy:

Type Main set Sized by Complements
SpaceGround SpaceCenterLine, SatelliteRelay min 1, max 1 50 EnemyCounterSpace Max 1: SatelliteRelay (a second relay)
SpaceRecon Satellite min 1, max 10, EnemyCheck 0.5, CriticalThreshold 0.5 (a condition of the first strike) 30 NuclearWarProbability Max 2, 25 SpaceAmbition Max 2
SpaceWarning EWSSatellite max 4, Number TriadGround 0.5, Number TriadSea 0.5
SpaceSensor SpaceRadar min 1, max 2 50 EnemyCounterSpace Max 1
SpaceDefence LaserDefenceSatellite max 4, Number CounterSpace 0.5, Number SpaceAttack 1.0 50 EnemyCounterSpace Max 1
CounterSpace HunterKillerSatellite max 6, Number SpaceAttack 1.5, Number CounterSpace 1.0 50 SpaceAmbition Max 1
SpaceAttack DoomSatellite max 1, Number SpaceAttack 1.0 35 SpaceAmbition Max 1: DoomSatellite; 50 SpaceAmbition Max 1: AttackSatellite

Orbital weapons. Fusion satellites come first. A faction builds its first one by SpaceAmbition 0.35 or up, which every shipped profile has, and one more as the answer to a rival's that it has tracked: at most 2. The kinetic satellite is optional: one from SpaceAmbition 0.5 up, of the shipped profiles only Rogue. It carries 8 rods and is not refilled, and no requirement asks to replace a spent one.

Orbit heights. Most satellites go to their lowest MinElevation. Two kinds choose: - Hunter-killer. A satellite whose anti-satellite weapons have a MaxHeightDifference goes to the low orbits while the rivals' satellites it has seen there are worth the most to it. Otherwise it goes beside one higher satellite in that satellite's own orbit, if no own hunter-killer already shadows it. Armed satellites count x3, strategic assets x2, at war x2. - Early warning. An early warning satellite whose MaxElevation reaches the geostationary height (35786 km, with Geostationary_satellites) goes there. It sits over the rival region with the most strategic launchers seen that no own geostationary early warning satellite watches yet. On realistic orbits its figure eight swings up to that region's latitude. With no such launcher seen, it goes to its lowest orbit.

The other strategies differ: Submarines more early warning (min 1, max 6, TriadSea 1.0); Airforce fewer spy satellites (max 3, no first-strike condition). Their SpaceAttack is the same.

The research reactions to seen satellites (EnemyHasUnit, LostUnit) are in Conditional.txt (§10).

18.3 The groups in GroupsConquest.txt

Group Leader Use
SpaceCenterLine, SatelliteRelay, SpaceRadar center, relay, space radar Ground segment, each PlacementType MissileSilo FarFromBorder; the relay and the radar with DistanceFrom their own type, so that a second stands away from the first.
Satellite, EWSSatellite, LaserDefenceSatellite their satellites PlacementType Orbit distant, no planned targets.
HunterKillerSatellite hunter-killer DefaultAttackStrategy Immediate; fusion first (20000), then hunter-killers, the others.
AttackSatellite, DoomSatellite kinetic, fusion DefaultAttackStrategy Immediate; counterforce lists, the relay first.
LaunchpadICBM (copied by the silo and mobile ICBM groups with Copy Targets) launchers The ASAT shooters: satellite Target lines, extra missile 3.

SupportedBy SpaceCenter on the satellite groups asks for no center while the line is on: SpaceGround builds it.

A satellite strikes what lies under it. A satellite's plan values a target only while the target is within its weapon's reach. The Target lines say what it takes as its track passes; no tag makes it go anywhere, Immediate included. MaxDist can still limit it: DefaultMaxDist is 1000 km, which is why the fusion satellite's relay line (range 1250) says so:

Group DoomSatellite
  PlacementType Orbit distant
  SupportedBy SpaceCenter
  "Countervalue_Laser_Satellite" Leader
  DefaultAttackStrategy Immediate
  Target "Satellite_Relay_Station" Priority 30000 MaxDist 1250
  Target "Over_Horizon_radar" Priority Auto
  Target "Missile_Silo" Priority Auto
  Target "ICBM_Launchpad" Priority 10000

The enemy's relay is the first target of the kinetic and fusion groups: Priority 30000, whatever else the enemy owns. The asset rule of §18.5 still holds for it. The missile sites list it as Lazy Priority Auto: its strategic value (§17), but only against an owner with weapon satellites the faction knows of; otherwise a target of a type whose ID contains Relay listed with Priority Auto is worth 1 like any unlisted one. A fixed Priority has no such condition.

The space radars come next: Priority Auto on the kinetic and fusion groups, Lazy Priority Auto Fade 0.01 on the missile sites, aircraft and carriers, with no such condition. The radar is the only ground sensor that sees satellites, and every ASAT shot needs a track, so losing it blinds the ground ASATs until a cruiser, a satellite's mini radar or an ally has one.

ASAT launchers. Give the group satellite targets and the unit a weapon config whose missiles are all in the Anti-Satellite category:

  DefaultAttackStrategy Lazy
  Target "Countervalue_Laser_Satellite" Priority 10000 Conventional Nuclear Max 2
  Target "Early_Warning_Satellite" Priority 5000 Conventional Nuclear Max 2
  Target "Satellite" Priority 3000 Conventional Nuclear Max 2

Conventional Nuclear lets both the ASAT and the Nuclear ASAT take it. While the line is on and a rival's satellite has been tracked, such a launcher stocks a load of its anti-satellite config, a conventional one before a nuclear one. A satellite once set as a target is remembered: its orbit gives the next pass within the launcher's reach that a sensor of the faction or an ally sees, and the launcher keeps its other config until shortly before that pass. So every shot needs a track: build space radars (SpaceSensor). The priority is scaled by what the satellite does to the faction: one that watches or strikes the ground ×(0.25 + 1.5 × the share of the faction's regions under its track in its next three orbits), a watching one ×2 more while the faction is invaded; early warning, laser defence and hunter-killer satellites ×1.

18.4 AI categories and the Space step

In Conquest scoring (§16) the weapons' AICategory places them in the restraint through MissileCategoryMapping.txt:

Strategic "Strategic Nuclear" "SLBM" "Salted Weapons" "Orbital Strike"
ASAT "Anti-Satellite"
Orbital "Orbital Attrition"
AICategory Class Shipped weapons Needs
"Anti-Satellite" ASAT Nuclear ASAT, ASAT, Aircraft ASAT, Co-Orbital ASAT, Satellite ASAT, ASAT Laser, Ground ASAT Laser The Space step, with the exceptions below.
"Orbital Attrition" Orbital Fusion Laser The Space step.
"Orbital Strike" Strategic Orbital Kinetic Bomb The strategic level, as a strategic nuke: a hit counts as the strategic use for the victim.

By target, for Anti-Satellite weapons:

  • an armed satellite of an enemy at war needs nothing more: it has a weapon its owner can use against ground, naval or space units (kinetic, fusion, hunter-killer, and a laser defence satellite once its ASAT Laser is researched);
  • an early warning satellite is a strategic asset (AttackIfDestroyed): the strategic level;
  • the others (spy satellites, a laser defence satellite without the ASAT Laser): the Space step.

The Nuclear ASAT has only the Anti-Satellite category, so it is a Space step weapon and no tactical nuke for the restraint. Add "Tactical Nuclear" to a weapon and it needs both.

The Space step is granted against an enemy at war, for as long as a reason lasts, when:

  • the strategic level is held against that enemy;
  • our own threat of tactical nukes or higher was carried out;
  • SpaceRestraint is 0.2 or less;
  • that enemy shot down a satellite of ours or used nukes on us in this war;
  • our losses in the war pass (0.15 + 0.6 × SpaceRestraint) while we are losing, kept down to half of that.

There is no peace offer before it. Attacking a satellite outside a war starts a war, as with any unit.

Blinding before a decapitating strike is an option, never a requirement: DecapitationBlindWindow (§8.1). When the target's early warning satellites are in reach of the faction's anti-satellite launchers, the nukes wait for them; when not, they do not wait. Readiness lowers the nuclear balance the strike needs by at most 0.05.

Geneva. GenevaCategory "Anti-Satellite" and "Orbital Weapons" are ordinary ban categories. In a vote on an anti-satellite ban the AI also leans by the satellites the ban protects: its own and its allies' (at half) against the others' (at war fully, the rest at 0.3).

18.5 The relay and the balances

Satellite_Relay_Station carries the Satellite Relay aura. Cameras, launch warning, the kinetic bomb and the Fusion Laser have range 0 until ImprovedBy InRange "Satellite Relay" sets it, so without a live relay of the owner or an ally all of them are dark.

It is an AttackIfDestroyed asset, and StrategicValues.txt lists it:

StrategicValue "Satellite_Relay_Station" Weight 15 Scarcity 2
  • any attack on it, with any weapon, is the strategic step: an AI targets it only with the strategic level against its owner, the fusion and kinetic satellites included; covert units are exempt;
  • destroying it, or leaving it at half strength or less, by an attack aimed at it grants the owner the strategic level against the attacker;
  • it counts only on its owner's or an ally's territory (§7.3).

The same flag on Early_Warning_Satellite makes it an asset everywhere (satellites always count). Remove the flag and either becomes an ordinary target at its step. In a mod, a relay type needs the UC_Space category to count as a relay for the blinding readiness, and Relay in its ID for the Priority Auto condition and the balance terms below.

What the orbital weapons count for, each only while a relay of the owner or an ally stands:

  • Fusion (the Orbital class) adds to the conventional balance what it can destroy in a pass × the share of the enemy's regions under its track. It helps the armies without replacing them: in the balance each side's fusion counts at most as much as the smaller of the two forces. In the region planner a faction's own counts at most as the smaller force there, and an enemy's track over a region counts as that enemy's strength there, like its air superiority.
  • Kinetic (non-nuclear weapons of the Strategic class on a satellite) adds to the nuclear balance by the rods left, in full loads × the power of an average launcher of the owner.

AntiMissile space types lower the expected delivery of nukes against their owner: 5 % per tracked satellite, at most 50 %, fading as the real delivery record grows (§16).

A faction counts another's orbital weapons and anti-missile satellites only once it has tracked them.

19. Mood.txt (optional)

The keyword reference; how mood works in the diplomacy is in chapter 20.

HalfLifeAI 216000
PastRelations -1
WarDeclaredOnUs -2
Gift 1
END

What changes a faction's mood toward another, and by how much. One Name value per line, ending with END; // starts a comment. A rule left out keeps its default. The shipped file lists every rule with its default. An unknown name is reported and the rest of the file is skipped. No USE, IF or ELSE: a mod that changes it ships the rules it wants to change.

Mood runs from -10 to +10, fades toward 0 and biases the deals and the votes. Negative values lower it. The file is read once, with the other AI files. "A war" and "at a time" in the table are limits on one rule, not on the mood.

Rule Default Meaning
HalfLifeAI, HalfLifeHuman 216000, 648000 Ticks in which the mood halves; the second is the mood toward a human player.
OfferBiasPerPoint 0.5 A deal's value per point of mood (a region is worth about 5).
PastRelations -1 At the start, toward a faction named by the map's DefaultEnemy lines (09 — Maps); not between two human players.
PastAlliance 0.5 The same toward a faction named by the map's DefaultAlly lines.
WarDeclaredOnUs, WentToWar, WarDeclaredOnPartner -2, -1, -0.5 A war started: on us; the aggressor toward its target; on a partner.
WarLossesMax, WarLossesFullAt -2, 0.5 Forces lost in a war: the most it takes off (a war), reached at this share lost.
PartnerLossesShare 0.25 The partners' share of a fighting partner's drop, for its losses since they became partners.
RegionConquered, RegionConqueredMax -0.5, -3 Each region taken, and the most for a war.
LostWarMin, LostWarMax -0.25, -0.5 The war cost the loser 0.08 more than the winner; 0.3 more or above.
SparedUs 1 The winner stopped and took no land.
SparedPopulationFall 0.25 SparedUs shrinks as the war cost the loser more of its population (people killed, or with the land lost in the war); from this share of its population at the war's start, none.
FriendMood, FriendMoodPerAggression 1, 5 At this mood an AI does not threaten a faction, demand land from it, plan against it or take a deal to attack it; the bar is this much higher for each point of Aggressiveness above 0.5. So too for one that helped it in its wars, unless it is very aggressive.
FriendStrengthPerMood 0.2 Below that bar, the local strength a land demand needs rises this much per point of mood.
StrayHitMood, StrayHitPenalty, StrayHitWindowTicks 0, -0.5, 10800 Above this mood a conventional hit at peace is first a complaint costing the penalty; another within the window is the war.
AgreementReviewTicks, AgreementReviewMargin 12000, 0.3 An AI looks at its lasting agreements with factions not allied this often and ends one worth less than minus the margin and the price of ending it, past its minimum duration, one at a time.
AgreementCooldownMalus, AgreementCooldownTicks 3, 108000 Entering an agreement it ended again with that faction costs the AI this much at first, fading to nothing in this time.
PartnerCooldownMalus, PartnerCooldownTicks 4, 108000 A partnership that ended without a war, either side leaving: making it again costs the AI this much at first, fading to nothing in this time.
RegionReturned 2 The original owner of a region given back by a faction that had it from a third party (taken from the owner by another, or given to another in a deal), for an average region of the owner's (x0.5 to x2 by its size), half with a ceasefire or peace in the deal, once a region in a match.
CooperationRivalry, CooperationRivalryPerMood 0.75, 0.375 A cooperation agreement with a faction not allied is worth what it brings us less this share of what it brings them: this much at mood 0, less per point of mood (none from +2), more below 0.
CooperationRivalryThreat, CooperationRivalryPerAgreement 0.5, 0.1 ... more if it is our threat or target, and for each such agreement it has with others.
AllianceOpeningTicks 36000 The opening of a match: an AI neither at war nor attacked seeks no alliance with another AI, and a stronger neighbour is no threat yet. A player can still offer one.
Deal 0.25 Both sides, a deal without a threat. A commitment (ceasefire, treaty, agreement, partnership) earns all of it, a deal of goods alone by their value.
DealFullValue 1.5 Goods alone earn all of Deal from this value, about a useful technology's, and no more; smaller gifts in proportion (a fighter is worth about 0.004, intelligence the receiver already has nothing).
DealGoodwillGap 36000 The whole of Deal once in these ticks between two factions, filling up again with time.
Gift, GiftFullValue 1, 5 The receiver of a one-sided gift, an AI's or a human player's, by its value, all of it from this value.
GiftTechFullPoints 150 A technology given, by anyone: half its tier among the levels, half its research points to the receiver against this.
FairTrade 0.5 The receiver of a trade or cooperation offered as a gesture.
BecamePartners 1 Both sides, every pair a partnership makes partners.
DestroyedAlly -3 The allies of a faction out of the game, toward the enemy at war with it that did most (regions taken, recent nuclear use); the others by their part.
PowerUneaseWarned, PowerUneaseLeaving -0.5, -1 AI partners toward a faction holding too much of the world (1.5 and 1.75 times the average faction's share of the world's economy: its regions' production, science and espionage together): when they warn it, when they announce that they leave.
PermanentAllianceMood, PermanentAllianceTicks 2, 216000 With the match's timed permanent alliances off: partners can form a permanent alliance after holding the mood at this or above this long, the time running back at the same pace while below. Both moods count between two AIs or two human players (estimated), the AI's toward a human player.
LeftAlliance, VotedOut -1, -2 The members left behind toward a faction leaving of its own will; the member voted out toward each who voted yes.
VotedBan, VotedBanPassed, VotedBanMax -0.5, -1, -1 A faction holding a weapon or technology toward each faction that voted to ban it, the vote failed or passed; at most VotedBanMax between the two at a time - a new vote only tops it up, and it fades as any mood.
Protest, ProtestMax -0.3, -0.6 Conquest: a protest at a faction's killing of civilians lowers the mood both ways, the protester's and the protested faction's; at most ProtestMax at a time, topped up, fading.
LongPeaceAfter, LongPeaceGrow, LongPeaceMax 216000, 432000, 0.5 Ticks without a war before the bonus starts, ticks to grow to the maximum, the maximum.
LongPartnershipAfter, LongPartnershipGrow, LongPartnershipMax 216000, 432000, 1 The same as partners, instead of the peace bonus.
AidBonus, AidFullAt 3, 0.15 Both sides, held while aid flows either way, at this share of the production given; less aid, less in proportion.
ArmedUs, ArmedUsMax 1.25, 1 Per 36000 ticks of the observer's production in points given, and the most at a time.
ArmedOurEnemy, ArmedOurEnemyMax -2.5, -2 The same for arming an enemy of ours.
RivalBloc, RivalBlocTicks -0.6, 216000 Per this many ticks × (one alliance's size × the other's − 4), AI members; none at 0 or less.
ThreatExceededTarget, ThreatExceededOthers -2, -1 A threat exceeded: its target; the others.
AttackedSubmittedVictim, AttackedSubmittedOthers -2, -1 Attacked a faction that had given in to its threat.
RearmedClientAsker, RearmedClientOthers -2, -0.5 Armed a client again after promising to stop.
BrokePromiseBeneficiary, BrokePromiseOthers -2, -0.5 Broke a promise to keep fighting, × how much it mattered.
StoppedAidReceiver, StoppedAidOthers -2, -0.5 Stopped committed aid, × how much it mattered.
CovertCaught, CovertCaughtNuclearFactor -0.25, 3 Its covert operative destroyed by us outside its land, not at war: the drop for a unit with CovertOperative Yes (a number there is the unit's own drop); times the factor with a nuclear weapon on board. Catches do not add up: a new one lowers the mood only by what it exceeds of the earlier ones' share left.
CovertPromiseVictim, CovertPromiseOthers -2, -0.5 Its covert unit caught after it promised to stop its covert operations: the one it promised; the others.
AgreementCancelledMax -1 An agreement cancelled soon after the deal, less the later it is.
DealBroken -3 Broke a deal's obligation before its time.
NuclearTactical, NuclearStrategic, NuclearCities, NuclearSpace 1, 2, 4, 0.33 Nuclear use, Conquest only: −(restraint − 0.2) ÷ 0.8 × this level × the relation below × a factor for repeated strikes. NuclearSpace: satellites shot down.
RelationVictim, RelationBystander, RelationAttackerAlly 1, 0.4, 0.1 The relation: the victim and its allies; a bystander; the attacker's ally.
DeedVictim 1.5 The victim's own mood from deliberate deeds on it (massacres, cities struck, chemical, biological and salted weapons): −points x this, whatever the victim's Humanity, shown as "Genocide of our people". Others feel −points x their Humanity x the relation.

20. Game modes and mods with their own units

A game mode is a folder GameMode/<name>/ the game lays over the standard files, the way a mod is: a file it has replaces the standard one, or extends it with USE PREVIOUS; a file it does not have is the standard one. The same holds for the AI files, and the AI files are read in full whether the game uses them or not. So a mode or a mod that removes units or weapons must bring its own copy of every AI file that names them, or the game stops at loading (§2). Conquest and Standoff keep the standard units and have no AI files of their own.

Blitz has its own units and weapons, and shows what such a set needs. Its SpaceTypes.txt is all an empty replacement takes:

// GameMode/Blitz/AI/SpaceTypes.txt: no Space line in this mode
END
File in GameMode/Blitz/AI/ Why
SupportTypes.txt, NuclearTypes.txt, DefenceDef.txt, GroupsConquest.txt, StrategyConquest.txt Its own roles, groups and strategies.
SpaceTypes.txt Holds only END, with a comment. A mode without the Space line must still replace the file: the standard one names units Blitz does not have, and Unit Type not found Kinetic_Strike_Satellite would stop the game. Its SpaceRecon and SpaceDefence are types of its NuclearTypes.txt.
MissileCategoryMapping.txt Its Units/Missiles.txt declares three [AI_CATEGORY] lines of its own (Tactical Nuclear, Strategic Nuclear, Anti-Satellite) and sets AICategory on its weapons; the mapping names only these. The standard mapping would stop the game with Weapon category not found. With an empty one nothing counts as strategic.
CovertOps.txt No entries: no covert units. Its Security_Checkpoint default is looked up without an error.
StrategicValues.txt Its own unit names.
Conditional.txt Holds only END: the standard reactions name its missing technologies and units.

limits.txt, Personalities.txt and Mood.txt name no units, so Blitz uses the standard ones. Because Blitz's strategies need their research to finish, they set ResearchHoldsAttacks.

Test a mode's AI files by starting a game in that mode: they are checked against its own units, technologies and categories.

21. The AI cache

The sites behind the point types of §7 (where silos, airbases, radars and hiding spots can go) are not computed while the game loads. They come from a per-map cache, <AICache name>.aics, made by the map's AICache … generate from line (09 — Maps §6):

AICache "Maps/EarthRRUltraV3.Virtual/ai_cache_new.bin"                       // reads ai_cache_new.aics
AICache "Maps/MyMap.Virtual/ai_cache_new.bin" generate from "Maps/MyMap.Virtual/SRC/AIConfig.txt"
Change Make the cache again?
The AI files, units, weapons, technologies No: the cache holds places on the map, not units. A new group or unit only needs a point type that exists.
AIConfig.txt, water maps, regions (a rebuild), city positions, the landing file Yes (09 — Maps §10).
A cache of another format (reported at loading) Yes.

A missing cache, or one of another format, is not an error: the game loads with an info message and the AI has no sites to deploy to. Without a generate from clause the cache is not made while a map loads, so a new map needs it made before the AI can be judged.

22. Infamy.txt (optional)

Isolation, in Conquest only: what a faction's killing of civilians and use of nuclear and inhumane weapons costs it with the other factions. The same rules hold for an AI and a human player. The format is Mood.txt's: one Name value per line, // comments, END at the end, a rule left out keeps its default, an unknown name is reported and the rest of the file is skipped. Times are in ticks. The keyword reference; what infamy, sanctions and demands mean in play is in chapter 20.

Cap 20
HalfLife 216000
CityStruck 1
PariahAt 6
END

Infamy is the record of what a faction did, the same for every observer; atrocity is its part from deliberate deeds. Both halve every HalfLife. Infamy decides the stages and the sanctions, atrocity the demands and ultimatums. Each AI's own reaction (its mood) is in Mood.txt and its personality's Humanity and SanctionAt (§16).

Rule Default Meaning
Cap, HalfLife 20, 216000 Infamy at most; the ticks in which infamy and atrocity halve.
WorldShare 0.0025 People killed: 1 point per this share of the world's starting population.
DeliberateDeaths 3 Deliberate deaths count this many times collateral ones, and as atrocity: the weapon aimed at the city, an inhumane weapon (biological, salted) wherever aimed, or a city centre within a point attack's full effect range.
CityStruck 1 A city struck on purpose (aimed at, a nuclear explosion, people killed); atrocity.
TacticalUse, StrategicUse 0.25, 0.5 A tactical or strategic nuclear weapon used, on anything, at the reference yield below.
TacticalUseKt, StrategicUseKt, UseYieldExponent, UseYieldMin, UseYieldMax 10, 500, 0.5, 0.25, 2 The use's points by its yield (one warhead's): x (yield / the reference)^exponent, within the limits - a 2 kt shell 0.11, a 10 Mt warhead 1.0.
ChemicalUse 0.05 A chemical weapon used (one its data does not mark Inhumane): infamy only, never atrocity; all chemical use together at most ChemicalUseCap.
RepeatHalfLife 108000 A faction's recent uses of a kind of weapon (chemical, tactical, strategic, biological) halve in this time.
NuclearRepeatExponent 0.75 A nuclear use counts 1 / (1 + recent uses of its kind) to this power, other weapons 1 / (1 + recent uses). At 0.75, use alone reaches 3 at about 35 strategic or 270 tactical uses in 10 minutes; at 1 it hardly passes 3 at any rate.
ChemicalUseCap 2.5 All chemical use together adds at most this to the faded infamy. Its deaths in cities are not capped.
IncidentInterval 2000 A doer's deeds on one victim within this time make one incident for the moods.
InKind, NoNukes, AtPeace, PariahVictim 0.25, 1.5, 2, 0.25 A deed's multipliers: the victim used that level on the doer first in this war; the victim has no nuclear weapons; the two are not at war; the victim is a pariah.
CondemnedAt 1 Condemned: protests, no new partnerships, no courtship.
PariahAt, PariahOffAt 6, 5 Pariah from this infamy, and a pariah until it falls below the second.
SanctionLift 0.5 An AI sanctions from its SanctionAt and lifts the sanctions below this share of it.
SanctionRate, PariahRate 0.25, 0.4 With the match setting Economic Sanctions on, the target's production and science fall by this × the sanctioners' share of the world's production; a pariah's rate.
PariahLeaveTicks 36000 A pariah's AI partners leave its alliance this long after announcing it.
ProtestGap 36000 A protest at a faction at most this often.
DemandGapAI, DemandGapHuman 60000, 18000 The next demand to an AI or a human player at the earliest this long after the last.
DemandAtrocity, DemandMood, DemandHumanity 3, -2, 0.5 A demand to spare civilians: from this atrocity, at this mood toward the faction or lower, by a faction of this Humanity or more.
UltimatumAtrocity, UltimatumMood, UltimatumMoodPariah, UltimatumWin 6, -4, -3, 0.4 An ultimatum (war if refused): from this atrocity or after a demand refused (whoever made it) or a promise broken, at this mood or lower (the third value against a pariah), when the war's estimated win probability is at least this.
MaxAtrocityWars 2 Against an AI, no ultimatum while this many wars are fought on it for its atrocities.
SpareCiviliansLength 108000 A promise to spare civilians (no strikes aimed at cities, no inhumane weapons) lasts this long.
KeptAtrocity 5 A promise kept to its end lowers the atrocity to this, and the infamy by as much.
SanctionTermTicks 108000 Sanctions imposed for a threat carried out last this long.
SanctionerRate 0.05 With Economic Sanctions on, a sanctioner's own production and science fall by this x each target's share of the world's production.
SanctionedMood, SanctionBystanderMood -2, -0.25 When sanctions start: the target's mood toward the sanctioner, and every other faction's when the target's infamy is below CondemnedAt. Topped up to this level, not added again: sanctions imposed again after a lift only renew what has faded.