Modding Guide - AI Params file

The AI Parameters File (AIParams.csv) is stored in the \INI\ directory and contains the following sections:

&&BUILDSEQUENCE

This determines the AI's sequence of building different classes of units when Ministers or AI Rulers use 'Autobuild' at military bases. Each cell refers to the Unit Class to be built, with the following values added to the class number to specify additional features:

  • + 128 : 'mobile preference' (avoid walking or towed units)
  • + 64 : 'missile preference' (prefer units with missile capacity)
  • + 32 : 'engineer preference' (prefer units with engineering capabilities)

There are three lines each for Land, Air, and Naval, with the first line of each group being Defense priority, the middle being mixed, and the last being Offense priority. This priority is set by the human player or the AI ruler.

&&UNITWEIGHTING

For each Unit Class this provides the weighting of different specs to determine what unit should be built from the available designs.

&&MISSILEWEIGHTING

As above except for this is for the production of missiles; the lines refer to the types of missile targets being prioritized.

&&AIREQRESPONSE

This section specifies the units to be used by the AI or Minister to respond to situations and hotspots on the map. The lines, in order, represent the type of AI military request. The first ten of these are also an exact match to the Hotspot-Request types that the human player can issue; the last six are used by the AI only.

  • 0 AIREQGARRISON Request to Garrison a hex for defense
  • 1 AIREQDEFENSE Request defensive-oriented units for area
  • 2 AIREQASSISTANCE Request 'assistance', for instance if a battle is going badly
  • 3 AIREQSUPPLIES Request resupply
  • 4 AIREQAIRSUPPORT Request air support for ground units
  • 5 AIREQLANDTRANSPORT Request transport units to be dispatched
  • 6 AIREQSEASUPPLY Request Sea resupply
  • 7 AIREQSEAATTACK Request Naval attack units
  • 8 AIREQATTACK Request (on land) attack units
  • 9 AIREQBATTLESUPPORT Request support for a land battle (not used by AI at present)

AI (both minister and AI-player) use only:

  • 10 AIREQCITYRESCUE Requested by Cities taken over if loyalty is to us
  • 11 AIREQAIRINTERCEPT Request intercept of airspace violation
  • 12 AIREQCITYLOST City was lost, request attempt to retake it
  • 13 AIREQBASELOST Base was lost
  • 14 AIREQINDUSTRYLOST Industrial complex was lost
  • 15 AIREQLANDLOST Land in general was lost

For each of those scenarios, the eight sets of three columns each give details on the types of units that should respond to the request. The second column (mtype) is 0/1/2/3 for land/air/navalsurface/submarine, the third column is the unit class (infantry, tank etc) that should be called to respond. (As of Update 7, the mtype is not used/ignored.)

The first number of each set is a little odd since it means different things for different types of units:

  • Ground units: 1 means 'mobile units only', meaning no walking infantry or towed artillery; 0 (or 'N') mean any units.
  • Air units: 1 means mission-type (fixed wing) units only, 0 (or N) mean any types including helicopters.
  • For both air and ground units, adding 2 to the value means 'don't check attack strength', since ordinarily the AI will look for stronger units as its first choice of responders. Since attack strength is not a requirement for resupply units, for instance, those types have the 2 added to this column.

Each request has an importance attached to it by the AI (or the human in case of hotspots), which determines how many units will respond to a request; units are requested in column order, after all 8 columns are done it loops back to column 1.

Note: the contents of the AIParams file were edited and updated as part of Update3, so when modding it make sure you start from the latest version.