define what the differences between the UNITAIs ?

BoydofZINJ

Warlord
Joined
Oct 7, 2007
Messages
126
Can someone define what the differences between the UNITAIs ?


Some are obvious.

UNITAI_EXPLORE = explore the map (i would imagine) - would this be useful with "combat" units as well that you want to floating around a bit?

UNITAI_CITY_COUNTER =what does this do exactly?

UNITAI_COUNTER = same thing?


UNITAI_RESERVE = does the unit stay within culture bonus (but its that not the same as defense?
 
The UNITAI values do several things.

First, they are used by the AI when deciding which units to build depending on the AI's current war status (peace, limited war, attacking, defending, etc). The AI will, for instance, prefer a CITY_DEFENSE unit over an ATTACK_CITY (assuming they have similar combat strengths) if it is building the unit in a city that has a nearby threat. Since many units have multiple UNIT_AI values defined it can get complicated.

Second, they are used to gauge the threat in an area. The AI will evaluate enemy units and weigh their threat based on their UNITAI and combat strength.

Third, they are used when the AI assembles stacks of units. Depending on the 'head unit' UNITAI value it will assign other units to the stack as needed. This results in things like CITY_DEFENSE units escorting settlers but not showing up in assault stacks. Again, since many units have multiple UNITAI values you will get some variety.

Finally, they are used to determine the 'mission' of a stack. This also depends on the current state of war and whether the AI is attacking or defending.

COUNTER units, for example, may stay and defend a city or they may join attack stacks depending on whether the AI is attack or defending and whether or not they perceive a threat at the city where the COUNTER unit currently is. There is a bit of redundancy in this part which makes it hard to say exactly what the AI will do with a specific unit, compunded by the fact that many units have multiple UNITAI values.

RESERVE units can defend cities, escort settlers & workers, defend forts, defend future city sites, and protect other units (including those in attack stacks).

CITY_COUNTER is very similar to CITY_DEFENSE with different threshold for determining whether or not it will leave the city to attack the enemy.

It's hard to come up with a lit of what they each do exactly. Think of them a guidelines, not specific instructions or limitations and then their names should make a bit more sense. The exception here is with NOT_UNITAI values, units with those will not be used by the AI for those functions. So a unit with a NOT_UNIT_AI setting for UNITAI_ATTACK_CITY will never be used by the AI in a city attack stack but it may be used in an attack or pillage stack that makes an impromptu decsion to attack a city.
 
Thanks for the help.

Now I got some other questions. My first question is there a thread that explains what exactly what each line of the unit coe means. Some are easy to figure out like the icombat value. icombat = 10 the unit has a base combat value of 10. However, there are some I have no idea what it does... such as

<FeatureDefenses>



Second, I am looking to make a MOD that does one of the following

A. Have a Promotion called "Missile unit" and have a second promotion called "Anti Missile System" The second promotion, "Anti Missile System" will give the unit with this second promotion a defensive bonus of +50.

or

B. Have specific units called that are missile units such as UNITCOMBAT_MISSILEINFANTRY

Any unit with the promotion, "Anti Missile System" will get a bonus in defense against a unit thats a UNITCOMBAT_MISSILEINFANTRY.


Lastly, I am looking to figure out a way how to make a unit that is considered a pure long range unit such as a unit with UNITCOMBAT_LONGRANGEONLYARMOR
and all "land" units either get a bonus to attack this unit or the unit with the
UNITCOMBAT_LONGRANGEONLYARMOR
has a massive defense penality.
 
Features are things like forests & jungles, so feature defenses is a bonus to that units defense while it's in those features.

For the missile units the new unit combat type is probably a more elegant solution than a new promotion since the game doesn't currently support one promotion giving a bonus against units with another promotion (I don't think anyway).

For the bombardment units I would do the same unless you mean EVERY unit will get a bonus to attack them. In that case you can give the long range unit a penalty in the terrain defense just include every terrain type (grass, plains, desert, tundra and snow), you may also want to give them similar penalties for hills & features (forest & jungle) since you can use the no defensive bonus with this trick as tat cancels the penalty. Anyway, having the penalty on the one unit is easier and will look cleaner than having the bonus on every other unit out there. IMO anyway :)
 
Top Bottom