1. Current Approach Bias
What approach did we have towards this player last turn? This in some way modifies the final calculation. If we didn't have an approach towards this player last turn, assume it's NEUTRAL.
2. Default Weights
Add our NEUTRAL bias to the NEUTRAL approach.
Check if we were planning a war against them last turn. If yes, add 5x our WAR bias to the WAR approach.
Check if we were planning to demand from them last turn. If yes, add 5x our HOSTILE bias to the HOSTILE approach.
Domination Victory bias: If we're not at war yet, or we are at war and it's a stalemate or better (we're not playing defensively), and we're going for domination victory, add 10x WAR bias to the WAR approach.
3. City-State Quests
If a city-state gave us a quest to declare war on them, capture one of their cities, or liberate one of their cities, add 4x WAR bias to the WAR approach.
4. Declaration of Friendship
We have a Declaration of Friendship with this player:
- Add 10x FRIENDLY bias to the FRIENDLY approach.
- Subtract 10x WAR bias from the WAR approach.
- Subtract 10x HOSTILE bias from the HOSTILE approach.
- Subtract 10x GUARDED bias from the GUARDED approach.
- Subtract 10x DECEPTIVE bias from the DECEPTIVE approach.
- Subtract 10x NEUTRAL bias from the NEUTRAL approach.
5. Denunciations
We've currently denounced this player:
- Add 5x WAR bias to the WAR approach.
- Add 5x HOSTILE bias to the HOSTILE approach.
- Set approach score for FRIENDLY to 0.
We were friends and they denounced us (at any time in the past):
- Add 5x WAR bias to the WAR approach.
- Add 5x HOSTILE bias to the HOSTILE approach.
- Add 5x GUARDED bias to the GUARDED approach.
- Set approach score for FRIENDLY to 0.
This player has currently denounced us:
- Add 5x WAR bias to the WAR approach.
- Add 5x HOSTILE bias to the HOSTILE approach.
- Add 5x GUARDED bias to the GUARDED approach.
- Set approach score for FRIENDLY to 0.
6. Co-Op War Request
They refused our request to do a co-op war at least once:
- Subtract 2x the # of times they refused the request from the FRIENDLY approach.
- Add 2x the # of times they refused the request to the DECEPTIVE approach.
7. Military Threat
What is this player's military threat level? (GetMilitaryThreat function)
CRITICAL
- Add 8x WAR bias to the WAR approach.
- Add 5x AFRAID bias to the AFRAID approach.
- Add GUARDED bias to the GUARDED approach.
- Subtract NEUTRAL bias from the NEUTRAL approach.
- Subtract 4x HOSTILE bias from the HOSTILE approach.
- Subtract FRIENDLY bias from the FRIENDLY approach.
SEVERE
- Add 3x AFRAID bias to the AFRAID approach.
- Add 5x WAR bias to the WAR approach.
- Add 4x GUARDED bias to the GUARDED approach.
- Subtract NEUTRAL bias from the NEUTRAL approach.
- Subtract 3x HOSTILE bias from the HOSTILE approach.
- Subtract FRIENDLY bias from the FRIENDLY approach.
MAJOR
- Add 3x WAR bias to the WAR approach.
- Add 3x DECEPTIVE bias to the DECEPTIVE approach.
- Add 3x HOSTILE bias to the HOSTILE approach.
- Subtract FRIENDLY bias from the FRIENDLY approach.
- Subtract NEUTRAL bias from the NEUTRAL approach.
MINOR
- Add 2x NEUTRAL bias to the NEUTRAL approach.
- Add 2x FRIENDLY bias to the FRIENDLY approach.
- Add DECEPTIVE bias to the DECEPTIVE approach.
NONE
- Add 2x NEUTRAL bias to the NEUTRAL approach.
- Add 2x FRIENDLY bias to the FRIENDLY approach.
- Subtract GUARDED bias from the GUARDED approach.
- Subtract HOSTILE bias from the HOSTILE approach.
8. Warmonger Threat
What is this player's warmonger threat level? (GetWarmongerThreat function)
CRITICAL
- Add 15x WAR bias to the WAR approach.
- Add 7x AFRAID bias to the AFRAID approach.
- Subtract NEUTRAL bias from the NEUTRAL approach.
- Add 8x HOSTILE bias to the HOSTILE approach.
- Subtract FRIENDLY bias from the FRIENDLY approach.
SEVERE
- Add 5x AFRAID bias to the AFRAID approach.
- Add 10x WAR bias to the WAR approach.
- Add 4x HOSTILE bias to the HOSTILE approach.
- Add GUARDED bias to the GUARDED approach.
- Subtract NEUTRAL bias from the NEUTRAL approach.
- Subtract FRIENDLY bias from the FRIENDLY approach.
MAJOR
- Add 4x WAR bias to the WAR approach.
- Add 3x HOSTILE bias to the HOSTILE approach.
- Add GUARDED bias to the GUARDED approach.
- Add 2x DECEPTIVE bias to the DECEPTIVE approach.
- Subtract NEUTRAL bias from the NEUTRAL approach.
- Subtract FRIENDLY bias from the FRIENDLY approach.
MINOR
- Add 2x NEUTRAL bias to the NEUTRAL approach.
- Add 2x FRIENDLY bias to the FRIENDLY approach.
- Subtract 2x HOSTILE bias from the HOSTILE approach.
NONE
- Add 3x NEUTRAL bias to the NEUTRAL approach.
- Add 3x FRIENDLY bias to the FRIENDLY approach.
- Subtract 3x HOSTILE bias from the HOSTILE approach.
9. Victory Block Level
How much do we want to stop this player from winning? (GetVictoryBlockLevel function; the farther you are in the lead, the more they hate you)
NO DESIRE
- Add 2x FRIENDLY bias to the FRIENDLY approach.
- Subtract WAR bias from the WAR approach.
- Subtract HOSTILE bias from the HOSTILE approach.
WEAK DESIRE
- Add FRIENDLY bias to the FRIENDLY approach.
- Subtract WAR bias from the WAR approach.
- Subtract HOSTILE bias from the HOSTILE approach.
STRONG DESIRE
- Add 10x DECEPTIVE bias to the DECEPTIVE approach.
- Add 5x GUARDED bias to the GUARDED approach.
- Add 5x WAR bias to the WAR approach.
- Add 5x HOSTILE bias to the HOSTILE approach.
FIERCE DESIRE
- Add 15x DECEPTIVE bias to the DECEPTIVE approach.
- Add 5x GUARDED bias to the GUARDED approach.
- Add 10x WAR bias to the WAR approach.
- Add 10x HOSTILE bias to the HOSTILE approach.
10. Wonder Competitiveness Level
How much are we competing with this player for World Wonders? (GetWonderDisputeLevel function)
NO COMPETITION
- Add 2x FRIENDLY bias to the FRIENDLY approach.
- Subtract WAR bias from the WAR approach.
- Subtract HOSTILE bias from the HOSTILE approach.
WEAK COMPETITION
- Add FRIENDLY bias to the FRIENDLY approach.
- Subtract WAR bias from the WAR approach.
- Subtract HOSTILE bias from the HOSTILE approach.
STRONG COMPETITION
- Add 2x DECEPTIVE bias to the DECEPTIVE approach.
- Add GUARDED bias to the GUARDED approach.
- Add WAR bias to the WAR approach.
- Add HOSTILE bias to the HOSTILE approach.
FIERCE COMPETITION
- Add 5x DECEPTIVE bias to the DECEPTIVE approach.
- Add 2x GUARDED bias to the GUARDED approach.
- Add 2x WAR bias to the WAR approach.
- Add 2x HOSTILE bias to the HOSTILE approach.
11. Victory Competitiveness Level
What is their level of competitiveness with us for the same victory condition? (GetVictoryDisputeLevel function)
NO COMPETITION
- Add 2x FRIENDLY bias to the FRIENDLY approach.
- Subtract WAR bias from the WAR approach.
- Subtract HOSTILE bias from the HOSTILE approach.
WEAK COMPETITION
- Add FRIENDLY bias to the FRIENDLY approach.
- Subtract WAR bias from the WAR approach.
- Subtract HOSTILE bias from the HOSTILE approach.
STRONG COMPETITION
- Add 10x DECEPTIVE bias to the DECEPTIVE approach.
- Add 5x GUARDED bias to the GUARDED approach.
- Add 5x WAR bias to the WAR approach.
- Add 5x HOSTILE bias to the HOSTILE approach.
FIERCE COMPETITION
- Add 15x DECEPTIVE bias to the DECEPTIVE approach.
- Add 5x GUARDED bias to the GUARDED approach.
- Add 10x WAR bias to the WAR approach.
- Add 12x HOSTILE bias to the HOSTILE approach.
12. Territory Dispute Level
How much do we want their lands? (GetLandDisputeLevel function)
NO DESIRE
- Add FRIENDLY bias to the FRIENDLY approach.
- Subtract DECEPTIVE bias from the DECEPTIVE approach.
- Subtract GUARDED bias from the GUARDED approach.
- Subtract 2x WAR bias from the WAR approach.
- Subtract 2x HOSTILE bias from the HOSTILE approach.
WEAK DESIRE
- Subtract 0.5x FRIENDLY bias from the FRIENDLY approach.
- Add 0.5x DECEPTIVE bias to the DECEPTIVE approach.
- Add 0.5x GUARDED bias to the GUARDED approach.
- Add 0.5x WAR bias to the WAR approach.
- Add 0.5x HOSTILE bias to the HOSTILE approach.
STRONG DESIRE
- Subtract FRIENDLY bias from the FRIENDLY approach.
- Add DECEPTIVE bias to the DECEPTIVE approach.
- Add GUARDED bias to the GUARDED approach.
- Add WAR bias to the WAR approach.
- Add HOSTILE bias to the HOSTILE approach.
FIERCE DESIRE
- Subtract 2x FRIENDLY bias from the FRIENDLY approach.
- Add 2x DECEPTIVE bias to the DECEPTIVE approach.
- Add 2x GUARDED bias to the GUARDED approach.
- Add 2x WAR bias to the WAR approach.
- Add 2x HOSTILE bias to the HOSTILE approach.
13. Are Either Of Us Close to Winning the Game?
If they're winning, go into panic mode. If we're close to winning, a different approach might be better (unless we're close to domination).
Note that this function doesn't check whether the AI is currently going for the victory condition they're close to; seems they will shoot for other victories if the opportunity strikes.
They're Close to Domination Victory
- Add 2x DECEPTIVE bias to the DECEPTIVE approach.
- Add 2x GUARDED bias to the GUARDED approach.
- Add 10x WAR bias to the WAR approach.
- Add 5x HOSTILE bias to the HOSTILE approach.
We're Close to Domination Victory
- Add 20x WAR bias to the WAR approach.
- Add 20x HOSTILE bias to the HOSTILE approach.
- Add 10x DECEPTIVE bias to the DECEPTIVE approach.
They Control More than One Capital
- Add (2 * # of capitals they control * WAR bias) to the WAR approach.
- Add (2 * # of capitals they control * HOSTILE bias) to the HOSTILE approach.
- Add (2 * # of capitals they control * DECEPTIVE bias) to the DECEPTIVE approach.
They're Close to Science Victory
- Add 20x WAR bias to the WAR approach.
- Add 20x HOSTILE bias to the HOSTILE approach.
We're Close to Science Victory
- Add 5x FRIENDLY bias to the FRIENDLY approach.
- Subtract 5x WAR bias from the WAR approach.
- Subtract 5x HOSTILE bias from the HOSTILE approach.
They're Close to Diplomatic Victory
- Add 10x WAR bias to the WAR approach.
- Add 10x HOSTILE bias to the HOSTILE approach.
- Add 10x DECEPTIVE bias to the DECEPTIVE approach.
We're Close to Diplomatic Victory
- Add 10x FRIENDLY bias to the FRIENDLY approach.
- Subtract 10x WAR bias from the WAR approach.
- Subtract 10x HOSTILE bias from the HOSTILE approach.
They're Close to Cultural Victory
- Add 20x WAR bias to the WAR approach.
- Add 20x HOSTILE bias to the HOSTILE approach.
- Add 20x DECEPTIVE bias to the DECEPTIVE approach.
We're Close to Cultural Victory
Is this player the civ we have the lowest influence towards?
If yes, and our military strength is greater than theirs:
- Add 10x WAR bias to the WAR approach.
- Add 10x HOSTILE bias to the HOSTILE approach.
If yes, and our military strength is equal or less than theirs:
- Add 10x FRIENDLY bias to the FRIENDLY approach.
- Subtract 10x WAR bias from the WAR approach.
- Subtract 10x HOSTILE bias from the HOSTILE approach.
If no:
- Add 5x FRIENDLY bias to the FRIENDLY approach.
- Subtract 5x WAR bias from the WAR approach.
- Subtract 5x HOSTILE bias from the HOSTILE approach.
14. Disabled Victory Types
Science, Diplomatic and Cultural Victories are all Disabled
- Add 20x WAR bias to the WAR approach.
- Add 20x HOSTILE bias to the HOSTILE approach.
Domination Victory is Disabled
- Divide the current WAR approach score by 10.
- Divide the current HOSTILE approach score by 10.
15. We're Cramped (Surrounded/Can't Expand)
- Add 2x WAR bias to the WAR approach.
- Add 2x HOSTILE bias to the HOSTILE approach.
16. Other Player's War Weariness
If the other player has more than 0 War Weariness and their empire is very unhappy:
- Add (WAR bias * their War Weariness * 10) to the WAR approach.
- Add (HOSTILE bias * their War Weariness * 10) to the HOSTILE approach.
- Add (FRIENDLY bias * their War Weariness * 5) to the FRIENDLY approach.
17. Nukes
If the other player is human, assume their likelihood of using nukes against us is 100.
Otherwise:
- If nukes have been used by or against the other AI, their likelihood of using nukes against us is 100.
- If the other AI's war projection of a war against us is DESTRUCTION (they would surely lose a war against us), then their likelihood of using nukes against us is 100.
- Otherwise, take the other AI's flavor for using nukes, add 1 to it, and multiply it by itself (since they need to roll twice before using nukes).
We Have Nukes and They Don't
- Add 5x WAR bias to the WAR approach.
- Add 5x HOSTILE bias to the HOSTILE approach.
They Have Nukes and We Don't
If they are human, or an AI with a likelihood of nuking us greater than 50:
- Add 25x AFRAID bias to the AFRAID approach.
- Add 5x GUARDED bias to the GUARDED approach.
- Add 5x DECEPTIVE bias to the DECEPTIVE approach.
- Add 5x FRIENDLY bias to the FRIENDLY approach.
- Subtract 5x WAR bias from the WAR approach.
- Subtract 5x HOSTILE bias from the HOSTILE approach.
We Both Have Nukes
If they are human, or an AI with a likelihood of nuking us greater than 25:
- Add 2x WAR bias to the WAR approach.
- Add 2x GUARDED bias to the GUARDED approach.
18. Current Wars
For each other player (not on this player's team) that we're at war with:
If the war state is CALM or STALEMATE (we're equal):
- Add 2x NEUTRAL bias to NEUTRAL approach.
- Add 0.5x FRIENDLY bias to FRIENDLY approach.
If the war state is DEFENSIVE or NEARLY DEFEATED (we're losing this war):
- Add 2x FRIENDLY bias to FRIENDLY approach.
- Subtract 5x WAR bias from WAR approach.
- Subtract 4x HOSTILE bias from HOSTILE approach.
If the war state is OFFENSIVE or NEARLY WON (we're winning this war):
- Add NEUTRAL bias to NEUTRAL approach.
- Add 0.5x DECEPTIVE bias to DECEPTIVE approach.
19. Approaches We've Adopted Towards Other Players
For each other player:
If we're planning war against this other player OR are planning to demand from this other player OR our approach towards them is WAR or HOSTILE:
- Add 2x NEUTRAL bias to NEUTRAL approach.
- Add 2x FRIENDLY bias to FRIENDLY approach, and also see below;
If the person whose approach we're deciding right now is our neighbor (proximity CLOSE), we want them on our good side (since we're being hostile to the other guy):
- Add 3x FRIENDLY bias to FRIENDLY approach.
- Subtract WAR bias from WAR approach.
- Subtract HOSTILE bias from HOSTILE approach.
Is the target of our hostilities also our neighbor? Then it's doubly important to have the neighbor we're examining on our good side:
- Add 3x FRIENDLY bias to FRIENDLY approach.
- Subtract WAR bias from WAR approach.
- Subtract HOSTILE bias from HOSTILE approach.
Approach towards other player is HOSTILE:
- Add NEUTRAL bias to NEUTRAL approach.
Approach towards other player is AFRAID:
- Add FRIENDLY bias to FRIENDLY approach.
Approach towards other player is DECEPTIVE:
- Add FRIENDLY bias to FRIENDLY approach.
Approach towards other player is GUARDED:
- Add NEUTRAL bias to NEUTRAL approach.
Other player has a Defensive Pact with the player we're looking at
If the other player's military strength is equal to or greater than ours:
- Subtract 2x WAR bias from WAR approach.
- Subtract 2x HOSTILE bias from HOSTILE approach.
Other player is at war with the player we're looking at
If the other player is our biggest competitor (GetBiggestCompetitor function), we're happy this guy is at war with them:
- Subtract 2x WAR bias from WAR approach.
- Subtract 2x HOSTILE bias from HOSTILE approach.
- Add 2x FRIENDLY bias to FRIENDLY approach.
If the other player is our most valuable friend (GetMostValuableDoF function), we're mad at this guy for being at war with them:
- Add 2x WAR bias to WAR approach.
- Add 2x HOSTILE bias to HOSTILE approach.
If the other player is not our most valuable friend, but they are our most valuable Defensive Pact (GetMostValuableDefensivePact function), we're mad at this guy for being at war with them:
- Add 2x WAR bias to WAR approach.
- Add 2x HOSTILE bias to HOSTILE approach.
20. Sanity Check: Trade with Them
If we're earning GPT from this player, and ((our GPT - GPT from them) / 2) is less than 0, meaning our economy would go negative from going to war with them, then:
- Add ((our GPT - GPT from them) / 2) to the WAR approach.
- Add ((our GPT - GPT from them) / 2) to the HOSTILE approach.
- Add ((our GPT - GPT from them) / -2) to the DECEPTIVE approach.
- Add ((our GPT - GPT from them) / -2) to the NEUTRAL approach.
- Add ((our GPT - GPT from them) / -2) to the FRIENDLY approach.
21. Vassalage
The other player, or his team, has vassals:
For each vassal:
If our approach towards the vassal is HOSTILE:
- Add 5x HOSTILE bias to HOSTILE approach.
If our approach towards the vassal is WAR:
- Add 5x WAR bias to WAR approach.
If our approach towards the vassal is DECEPTIVE:
- Add 2x DECEPTIVE bias to DECEPTIVE approach.
If our approach towards the vassal is GUARDED:
- Add 2x GUARDED bias to GUARDED approach.
The player is our vassal, or our team's vassal
- Set HOSTILE approach score to 0.
- Set WAR approach score to 0.
We're a vassal of this player, or of their team:
What do we think about how they're treating us?
CONTENT
- Add 5 to FRIENDLY approach.
- Add 2 to NEUTRAL approach.
- Add -5 to HOSTILE approach.
- Add -5 to GUARDED approach.
DISAGREE
- Add 0 to FRIENDLY approach.
- Add 2 to NEUTRAL approach.
- Add 2 to HOSTILE approach.
- Add 2 to GUARDED approach.
MISTREATED
- Add 0 to FRIENDLY approach.
- Add 2 to NEUTRAL approach.
- Add 4 to HOSTILE approach.
- Add 4 to GUARDED approach.
UNHAPPY
- Add -6 to FRIENDLY approach.
- Add -4 to NEUTRAL approach.
- Add 6 to HOSTILE approach.
- Add 8 to GUARDED approach.
ENSLAVED
- Add -6 to FRIENDLY approach.
- Add -8 to NEUTRAL approach.
- Add 10 to HOSTILE approach.
- Add 10 to GUARDED approach.
We're unhappy because they forcefully declared independence from us
- Add 4 to WAR approach score.
- Add -10 to DECEPTIVE approach score.
- Add -10 to FRIENDLY approach score.
We're happy because they gave us our independence peacefully
- Add -4 to WAR approach score.
- Add 2 to DECEPTIVE approach score.
- Add 5 to FRIENDLY approach score.
22. War Projection
How well do we a think a war against this player would go? (GetWarProjection function)
Estimated outcome of the war for us:
DESTRUCTION (we would be destroyed)
- Add 15x AFRAID bias to AFRAID approach.
- Subtract 10x WAR bias from WAR approach.
- Subtract 10x HOSTILE bias from HOSTILE approach.
- Add 5x FRIENDLY bias to FRIENDLY approach.
DEFEAT
- Add 5x AFRAID bias to AFRAID approach.
- Subtract 5x WAR bias from WAR approach.
- Subtract 5x HOSTILE bias from HOSTILE approach.
- Add 2x FRIENDLY bias to FRIENDLY approach.
STALEMATE
- Add AFRAID bias to AFRAID approach.
- Subtract WAR bias from WAR approach.
- Subtract 2x HOSTILE bias from HOSTILE approach.
- Add FRIENDLY bias to FRIENDLY approach.
UNKNOWN
- Subtract AFRAID bias from AFRAID approach.
- Add WAR bias to WAR approach.
- Add HOSTILE bias to HOSTILE approach.
- Subtract FRIENDLY bias from FRIENDLY approach.
GOOD
- Subtract 2x AFRAID bias from AFRAID approach.
- Add 2x WAR bias to WAR approach.
- Add HOSTILE bias to HOSTILE approach.
- Subtract FRIENDLY bias from FRIENDLY approach.
VERY GOOD
- Subtract 5x AFRAID bias from AFRAID approach.
- Add 5x WAR bias to WAR approach.
- Add 5x HOSTILE bias to HOSTILE approach.
- Subtract 2x FRIENDLY bias from FRIENDLY approach.
23. Target Value
Our assessment of this player's value as a military target (based on city strength/comparative military power/defensive pacts/vassalage and some other things) (GetPlayerTargetValue function)
IMPOSSIBLE
- Add 5x FRIENDLY bias to FRIENDLY approach.
- Add 5x NEUTRAL bias to NEUTRAL approach.
- Subtract 5x WAR bias from WAR approach.
- Subtract 5x HOSTILE bias from HOSTILE approach.
BAD
- Add 2x FRIENDLY bias to FRIENDLY approach.
- Add 2x NEUTRAL bias to NEUTRAL approach.
- Subtract 2x WAR bias from WAR approach.
- Subtract 2x HOSTILE bias from HOSTILE approach.
AVERAGE
- Add NEUTRAL bias to NEUTRAL approach.
- Add FRIENDLY bias to FRIENDLY approach.
- Subtract HOSTILE bias from HOSTILE approach.
- Subtract WAR bias from WAR approach.
FAVORABLE
- Add HOSTILE bias to HOSTILE approach.
- Subtract NEUTRAL bias from NEUTRAL approach.
- Subtract FRIENDLY bias from FRIENDLY approach.
- Add WAR bias to WAR approach.
SOFT
- Add 2x HOSTILE bias to HOSTILE approach.
- Subtract 2x NEUTRAL bias from NEUTRAL approach.
- Subtract 2x FRIENDLY bias from FRIENDLY approach.
- Add 2x WAR bias to WAR approach.
24. Military Aggressive Posture
This is how much threat is posed by their military deployment near our borders (GetMilitaryAggressivePosture function).
NONE
- Add 2x FRIENDLY bias to FRIENDLY approach.
- Add 2x NEUTRAL bias to NEUTRAL approach.
LOW
- Add FRIENDLY bias to FRIENDLY approach.
- Add NEUTRAL bias to NEUTRAL approach.
- Add GUARDED bias to GUARDED approach.
MEDIUM
- Add GUARDED bias to GUARDED approach.
- Add DECEPTIVE bias to DECEPTIVE approach.
- Subtract NEUTRAL bias from NEUTRAL approach.
- Subtract FRIENDLY bias from FRIENDLY approach.
- Add WAR bias to WAR approach.
HIGH
- Add 2x GUARDED bias to GUARDED approach.
- Add 2x WAR bias to WAR approach.
- Add HOSTILE bias to HOSTILE approach.
- Add 2x DECEPTIVE bias to DECEPTIVE approach.
- Subtract 2x NEUTRAL bias from NEUTRAL approach.
- Subtract 2x FRIENDLY bias from FRIENDLY approach.
INCREDIBLE
- Add 5x GUARDED bias to GUARDED approach.
- Add 2x HOSTILE bias to HOSTILE approach.
- Add 5x WAR bias to WAR approach.
- Add 5x DECEPTIVE bias to DECEPTIVE approach.
- Subtract 5x NEUTRAL bias from NEUTRAL approach.
- Subtract 5x FRIENDLY bias from FRIENDLY approach.
25. Reckless Expansion
If this player is a reckless expander ("They believe we are building new cities too aggressively!")
- Add 2x WAR bias to WAR approach.
- Add 2x DECEPTIVE bias to DECEPTIVE approach.
- Add 2x HOSTILE bias to HOSTILE approach.
26. Other Player's War Status
If the player is already at war with another major civilization, and we've met the other player, we might want to gang up on the guy we're looking at:
If WarProjection >= GOOD, VictoryDisputeLevel >= STRONG, VictoryBlockLevel >= STRONG, TargetValue >= AVERAGE:
For each other player we've met that they're at war with:
- Add these integer values together to get a bonus value: victory block level + victory dispute level + war projection level + target value level
- Add 0.5x of this bonus value to the WAR approach.
- Add 0.5x of this bonus value to the HOSTILE approach.
27. Other Player Vassal Penalty
If the other player is not our master, for each vassal the other player has, increase the WAR and GUARDED approach scores by 10%.
i.e. 1 vassal = 110%, 2 vassals = 120%, etc.
28. Peace Treaty Consideration
If we made a peace treaty with this player or their team less than 25 turns ago:
- Subtract 10x WAR bias from WAR approach.
- Subtract 10x HOSTILE bias from HOSTILE approach.
29. Only Two Players Left
If there are only two major civilizations alive:
- Set FRIENDLY approach score to 5x FRIENDLY bias.
If going for Domination Victory:
- Set FRIENDLY approach score to 0.
- Add 1000 to WAR approach score.
30. Locked into Co-Op War Against This Player
- Add 100 to WAR approach score.
31. Defensive Pact
We have a Defensive Pact with this player or their team:
- Add 15x FRIENDLY bias to FRIENDLY approach.
- Subtract 5x WAR bias from WAR approach.
- Subtract 5x HOSTILE bias from HOSTILE approach.
- Subtract 5x GUARDED bias from GUARDED approach.
- Subtract 5x DECEPTIVE bias from DECEPTIVE approach.
32. Co-Op War Promise
We made a co-op war promise to this player:
- Subtract 10x WAR bias from WAR approach.
- Subtract 10x HOSTILE bias from HOSTILE approach.
33. Agreed to Remove Troops from their Borders
- Subtract 10x WAR bias from WAR approach.
- Subtract 10x HOSTILE bias from HOSTILE approach.
34. Can We Declare War on this Player?
If they're a vassal:
- Subtract 5x WAR bias from WAR approach.
- Subtract 5x HOSTILE bias from HOSTILE approach.
We're not able to declare war on them:
- Set WAR approach score to 0.
- Set HOSTILE approach score to 0.
We are able to declare war on them:
- Subtract FRIENDLY bias from FRIENDLY approach.
- Add 5x WAR bias to WAR approach.
- Add 5x HOSTILE bias to HOSTILE approach.
35. Same Team
If we're on the same team, set FRIENDLY approach score to 100 and all other approach scores to 0.
36. Distance
(Less likely to want to attack targets that are far away, more likely to want to attack targets that are closer.)
If we're not currently at war with them and our WAR or HOSTILE approach score is > 0, do the following function, otherwise skip:
If we can't reach the target by land, by sea or with a naval invasion, abort!
- Subtract 15x WAR bias from WAR approach score.
- Subtract 15x HOSTILE bias from HOSTILE approach score.
Before they're able to embark over oceans, the AI strongly prefers to start wars with neighbors and close targets, and prefers land-based attacks.
After they're able to embark over oceans, AIs that are going for world conquest treat far and distant targets as if they were neighbors and close targets, respectively.
(Polynesia can embark over oceans from the start of the game)
PLAYER PROXIMITY CHECK (We can't cross oceans yet)
Target is a NEIGHBOR who we can reach by land:
- Increase WAR approach score by 15%.
- Increase HOSTILE approach score by 15%.
Target is a NEIGHBOR who we can't reach by land
- Subtract 2x WAR bias from WAR approach.
- Subtract 2x HOSTILE bias from HOSTILE approach.
Target is CLOSE and we can reach them by land:
- No change.
Target is CLOSE and we can't reach them by land:
- Subtract 2x WAR bias from WAR approach.
- Subtract 2x HOSTILE bias from HOSTILE approach.
Target is FAR:
- Subtract 3x WAR bias from WAR approach.
- Subtract 3x HOSTILE bias from HOSTILE approach.
Target is DISTANT:
- Subtract 4x WAR bias from WAR approach.
- Subtract 4x HOSTILE bias from HOSTILE approach.
PLAYER PROXIMITY CHECK (We can cross oceans)
Target is a NEIGHBOR:
- Increase WAR approach score by 15%.
- Increase HOSTILE approach score by 15%.
Target is CLOSE:
- No change.
Target is FAR and we're not going for Domination Victory:
- Decrease WAR approach score by 40%.
- Decrease HOSTILE approach score by 40%.
Target is FAR and we're going for Domination Victory:
- Increase WAR approach score by 15%.
- Increase HOSTILE approach score by 15%.
Target is DISTANT and we're not going for Domination Victory:
- Decrease WAR approach score by 50%.
- Decrease HOSTILE approach score by 50%.
Target is DISTANT and we're going for Domination Victory:
- No change.
37. Has Unique Unit
If this civilization has a unique unit:
We have the unique unit unlocked, and at least one of them active
- Multiply WAR approach score by 10.
- Multiply HOSTILE approach score by 10.
We have the unique unit tech unlocked, but none of them constructed
- Divide WAR approach score by 10.
- Divide HOSTILE approach score by 10.
- Multiply DECEPTIVE approach score by 2.
We don't have the unique unit tech, but will have it soon
- Divide WAR approach score by 5.
- Divide HOSTILE approach score by 5.
- Multiply DECEPTIVE approach score by 2.
We don't have it, and we won't have it soon
- Divide WAR approach score by 10.
- Divide HOSTILE approach score by 10.
38. Most Important Player Modifiers
If this player is not our greatest competitor (GetBiggestCompetitor function):
- Divide WAR approach score by 2.
- Divide HOSTILE approach score by 2.
If they are our greatest competitor:
- Multiply WAR approach score by 2.
- Multiply HOSTILE approach score by 2.
If they are our most valuable friend (GetMostValuableDoF function):
- Divide WAR approach score by 2.
- Divide HOSTILE approach score by 2.
- Multiply FRIENDLY approach score by 2.
If they are our most valuable Defensive Pact (GetMostValuableDefensivePact function):
- Divide WAR approach score by 2.
- Divide HOSTILE approach score by 2.
- Multiply FRIENDLY approach score by 2.
39. Opinion Modifier
The opinion score is obtained from the positive and negative modifiers shown in the diplomacy screen when mousing over their approach, messages like:
- "You have no contested borders.", or
- "Territorial disputes strain your relationship."
These modifiers have a numerical value attached to them which can be seen with the Transparent Diplomacy advanced setting enabled.
The sum total of the positive and negative modifier values is the Opinion score, with one change: in the code, positive modifiers reduce your opinion value (so a negative opinion score is good), and negative modifiers increase your opinion value (so a positive opinion score is bad).
The following values affect how opinion applies in approach calculation:
iWarMod - the WAR bias * the leader's Boldness * 2
iHostileMod - the HOSTILE bias * the leader's Denounce Willingness * 2
iDeceptiveMod - the DECEPTIVE bias * the leader's Meanness * 2
iGuardedMod - the GUARDED bias * (10 - the leader's Forgiveness) * 2
iFriendlyMod - the FRIENDLY bias * the leader's Loyalty * 2
iNeutralMod - the NEUTRAL bias * the leader's DiploBalance score * 2
The various flavors like Boldness, Denounce Willingness and Loyalty have a defined XML value which is randomized game to game to make each game less predictable.
The way these flavors work is as follows (example):
- If Boldness is high, then having a negative opinion score will greatly increase the WAR approach, but having a positive opinion score will greatly decrease the WAR approach.
- If Boldness is low, then having a negative opinion score will slightly increase the WAR approach, but having a positive opinion score will slightly decrease the WAR approach.
A higher opinion always means less likelihood of hostile behavior, and more likelihood of friendly behavior, and the reverse for a lower opinion. This is a key modifier.
Now for the actual opinion calculation:
If Opinion > 0 (bad opinion)
Increase WAR approach score by (iWarMod + Opinion)%.
Increase HOSTILE approach score by (iHostileMod + Opinion)%.
Increase DECEPTIVE approach score by (iDeceptiveMod + Opinion)%.
Increase GUARDED approach score by (iGuardedMod + Opinion)%.
Multiply FRIENDLY approach score by 100.
Divide FRIENDLY approach score by (100 + iFriendlyMod + Opinion) or 100, whichever is greater.
If the opinion score for this player is worse than the "Competitor" threshold:
Multiply NEUTRAL approach score by 100.
Divide NEUTRAL approach score by (100 + iNeutralMod + Opinion) or 100, whichever is greater.
If Opinion < 0 (good opinion)
Multiply Opinion by -1.
Increase FRIENDLY approach score by (iFriendlyMod + Opinion)%.
Multiply WAR approach score by 100.
Divide WAR approach score by (100 + iWarMod + Opinion) or 100, whichever is greater.
Multiply HOSTILE approach score by 100.
Divide HOSTILE approach score by (100 + iHostileMod + Opinion) or 100, whichever is greater.
Multiply DECEPTIVE approach score by 100.
Divide DECEPTIVE approach score by (100 + iDeceptiveMod + Opinion) or 100, whichever is greater.
Multiply GUARDED approach score by 100.
Divide GUARDED approach score by (100 + iGuardedMod + Opinion) or 100, whichever is greater.
If the opinion score for this player is better than the "Favorable" threshold:
Multiply NEUTRAL approach score by 100.
Divide NEUTRAL approach score by (100 + iNeutralMod + Opinion) or 100, whichever is greater.
If the opinion score for this player is between the "Competitor" and "Favorable" thresholds:
Multiply Opinion by -1.
Increase NEUTRAL approach score by (iNeutralMod + Opinion)%.
40. Make Changes in Approach Gradual
For each of the approaches:
A. Calculate the "average" value of this turn's score and the last turn's score using this formula: (0.5f + (Approach Score * 0.10f) + (Approach Score Last Turn * (1 - 0.10f)))
B. Set the approach score to this "average" value.
41. Pick a War Face If Going to War
If the highest approach score after all these calculations is WAR (therefore the AI is planning a war), but the AI is not currently at war with you or declaring war right this second, AI will pick a "War Face", which determines how it will act towards you until either WAR isn't the highest approach anymore or war is declared.
If the AI had a War Face last turn, it will use that one. Otherwise, it will figure out the next-highest APPROACH score (after WAR), and based on the result, pick a war face.
If the next-highest approach score is:
HOSTILE
- AI will act HOSTILE to you until it's ready for war.
DECEPTIVE
- AI will act NEUTRAL to you until it's ready for war.
AFRAID
- AI will act HOSTILE to you until it's ready for war.
FRIENDLY
- AI will act FRIENDLY to you until it's ready for war.
OTHERWISE
- AI will act NEUTRAL to you until it's ready for war.
42. Decide What Approach to Show to the Player
The AI picks its highest approach and uses that towards you. If all approach scores are 0, it will use the NEUTRAL approach.
If the AI is currently at war with you, the WAR! approach is shown.
If the AI is planning war with you, they will use their War Face (see #41 above).
If the AI's approach towards you is DECEPTIVE, it will show up as FRIENDLY.
Otherwise, the approach shown to you is the AI's approach towards you.