SnowlyWhite
Emperor
We should have seen more early declaration in this case on Monarch even.
If AIs like gilgamesh have roughly 1.6% chance per turn to consider either a war or a limited war, it means that they are 73% likely to declare war sometime in the first 80 turns. If power ratio of 0.5 is not what deters them, what is it then? Why do I not get declared as often on Monarch?
well, 1st of all, gilgamesh declared in turn 104... it was perfectly mathematical, can't complain

however, supposing there would be less turns(normal - but while you are "safer" on normal, the probability of ai - ai wars is also smaller, which favors slower speeds, so overall balanced):
The decision process behind a total war is the following:
1) Roll the dice, i.e. generate a number up to that AI's iMaxWarRand number. If the rolled number is 0, i.e. a 1/iMaxWarRand chance every turn, the AI decides to see if it wants to go for a total war. Note that this doesn't mean it will go for a total war, only that it will consider it. The number iMaxWarRand is 200 for Asoka and Washington, 300 for Lizzy and 100 for Toku and HC. Note that if the roll is 0 at this step, the AI will not consider a limited or dogpile war that turn even if it doesn't decide to go for a total war after all.
1/iMaxWarRand - it's tiny; a warmonger like toku apparently gets 1% chance/turn
in that 1% case:
3) The AI then makes three passes through all the other civs it has met, to see who to go to war against, if any. If a suitable target is found in one pass, it doesn't bother to do the subsequent passes.
A) On the first pass, only adjacent neighbors are considered. Just who is considered adjacent is determined by the AI's iMaxWarMinAdjacentLandPercent number, ranging from 0 to 4. If that many percent of the AI's total land borders the considered target, it is a valid target for that pass (for those who have 0, it is enough to be reachable via land). Asoka has 0, HC has 1, Washington 3, Lizzy and Toku 4. This means we are valid targets for Asoka and Washington for this pass, but not for any of the others.
so, beside those with 0, you're less of a target for the others. Let's say monty's case of 130% - though I think monty has 0 after how he declares:
it's irrelevant if you're 1% of his power, if some neighboring ai is already under 130% his power. Only if no neighbor is under 130% his power, then you're considered.
6) Each civ that matches the criteria so far (i.e. not liked enough, and not strong enough) is a potential target, so if any civ gets this far in the calculations, the AI will start planning a war. To find who of the potential targets that the AI will choose, calulate the AI's war value against that civ. This is done by the following steps:
- Take the number of land tiles the target owns that borders the AI, multiplied by 4(1).
- Add the "capitol proximity" between the target and the AI - this is quite simply the plot distance between the two capitols, multiplied by 1.5 if the capitols are on different land masses(2).
- Multiply the number gotten by a factor determined by the AI's attitude towards the target: 1 for Friendly, 2 for Pleased, 4 for Cautious, 8 for Annoyed and 16 for Furious.
basically, even if that 1% happens, and then no neighbor was found(or a neighbor was found, but his iMaxWarMinAdjacentLandPercent = 0 and you're checked too if on same landmass)
- the main thing is bordering him; if you don't, then warValue of whoever's the unlucky neighbor will be way higher then you
your warValue after (1) will be 0, while the neighbor will be dunno... 100+;
step (2) is wrongly explained, but I don't have the code around - basically, from this explanation, warValue would increase if you're further away and be greatest if you're on a diff. continent(which we know it ain't the case, since they always seem to declare close to home - as it'd also be logic)
at step (3), your warValue, which should still be way smaller then the neighbor, is multiplied by relations for both of you and said neighbor. So unless the neighbor has very good relations and you have crappy ones, to offset (1)(Take the number of land tiles the target owns that borders the AI, multiplied by 4), you should again be safe.
All in all, more or less what we know - there aren't that many wars and yes, power is relatively irrelevant. Mind you, that's taking this guy's word, as again, I don't have the code here.
Also, I didn't look at all at this either:
.Diplomatically, there are two reasons for the AI to go to war. Either they decide to go to war because a demand is rebuked, or they are bought or coerced into a war by an ally.
However, here, logically you'd get a special "check" if you rebuke, so here power probably matters! Unless you're saved by diplo. But again, no clue about the mechanics.
Also, some interesting things I've noted earlier:
// if we not human, do we want to continue war for strategic reasons?
// only check if our power is at least 120% of theirs
if (!isHuman() && iOurPower > ((120 * iTheirPower) / 100))
// if we total warmonger, value peace at 70% * power ratio factor
if (bDagger || AI_maxWarRand() < 100)
// if we limited warmonger, value peace at 70% * power ratio factor
if (AI_limitedWarRand() < 100)
// if we dogpile warmonger, value peace at 70% * power ratio factor
if (AI_dogpileWarRand() < 100)
// Discourage capitulation to a team that has not done the most damage
if (iTheirSuccess < iOthersBestSuccess)
{
iOurSuccess += iOthersBestSuccess - iTheirSuccess;
}
iMasterPower = (2 * iMasterPower * iTheirSuccess) / (iTheirSuccess + iOurSuccess);
which are more or less self explenatory.