The max war plan can be 20 turns for normal.
iTimeModifier is 100 for normal [unless the AI has over 200(!) more power, it was supposed to be 2 but there is a bug in the code]
The AI doesn't wait for catapults, just enough troops for attack
Once the AREAAI_OFFENSIVE is returned the AI will start marching.
UNITAI_XXX are types that the AI can possible use to attack city.
The number of the units must be more than number of (cities+population) divided by 4 for total war. The AI totally doesn't care if will attack w/ warriors or catapults (or modern armor) once it has passed the initial power threshold. And the units fall in the UNITAI_XXX roles above, catapults promoted to barrage are actually not counted since they are most likely UNITAI_COLLATERAL.
War is a team decision so it calculates the units/cities/population of all the members.
-----
I'd be glad we can fit 5 archers/1axe/1spear and walls on the hill city by the time attacking. I'd dedicate delhi/bombay for units and perhaps start growing cottages in the copper city.
Code:
else if (AI_getWarPlanStateCounter((TeamTypes)iI) > ((20 * iTimeModifier) / 100))
{
AI_setWarPlan(((TeamTypes)iI), NO_WARPLAN);
}
The AI doesn't wait for catapults, just enough troops for attack
Code:
if (bTargets)
{
if ((countNumAIUnitsByArea(pArea, UNITAI_ATTACK) + countNumAIUnitsByArea(pArea, UNITAI_ATTACK_CITY) + countNumAIUnitsByArea(pArea, UNITAI_PILLAGE) + countNumAIUnitsByArea(pArea, UNITAI_ATTACK_AIR)) > (((AI_countMilitaryWeight(pArea) * iOffensiveThreshold) / 100) + 1))
{
return AREAAI_OFFENSIVE;
}
}
UNITAI_XXX are types that the AI can possible use to attack city.
The number of the units must be more than number of (cities+population) divided by 4 for total war. The AI totally doesn't care if will attack w/ warriors or catapults (or modern armor) once it has passed the initial power threshold. And the units fall in the UNITAI_XXX roles above, catapults promoted to barrage are actually not counted since they are most likely UNITAI_COLLATERAL.
War is a team decision so it calculates the units/cities/population of all the members.
-----
I'd be glad we can fit 5 archers/1axe/1spear and walls on the hill city by the time attacking. I'd dedicate delhi/bombay for units and perhaps start growing cottages in the copper city.