AI Attitude explained:
The AI attitude towards another player (be it human or AI) is defined as follows:
if no other sources are quoted then the calculations are from CvPlayerAI.cpp and the Leader specific values are from CIV4LeaderHeadInfos.xml
Friendly:
iAttitudeVal >= +10
Pleased:
iAttitudeVal >= +3
Cautious:
if no other Attitude rule is fulfilled
Annoyed:
iAttitudeVal <= -3
Furious:
iAttitudeVal <= -10
The following terms are used:
US (the active AI)
THEM (the opponent towards whom the attitude is calculated)
iAttitudeVal = +100 if US and THEM are on the same team (i.e. Team play or Permanent Alliance)
iAttitudeVal = -100 if THEM is Barbarian
In all other cases iAttitudeVal is calculated using the following items:
„not visible“ denotes Items not displayed ingame
Item 1 (not visible):
US iBaseAttitude
Item 2 (not visible):
THEM iAttitudeChange (source: CIV4HandicapInfo.xml - = +2 on Settler, +1 on Warlord, 0 on Chieftain, -1 on Noble and above)
Item 3 (not visible):
If AggressiveAI option is ON and THEM is Human:
-2
Item 4 (not visible):
If THEM is NOT Human:
+(4 – abs(US Peace Weight – THEM PeaceWeight))
abs means that the result of (US Peace Weight – THEM PeaceWeight) is always a positive value
PeaceWeight = iBasePeaceWeight + (0 to iPeaceWeightRand) as shown
by Seven05
Item 5 (not visible):
If THEM is NOT Human:
+ the lower of US iWarmongerRespect or THEM iWarmongerRespect
Item 6 (not visible):
- the higher of 0 or (THEM number of Team members – US number of Team members)
Item 7 (not visible):
if THEM is higher ranking:
+(RankDifference*iWorseRankDifferenceAttitudeChange/(NumberOfPlayersEverAlive+1)) Note: these modifiers are negative in the .xml - so this produces a negative modifier...
Item 8 (not visible):
if THEM is lower ranking:
+(RankDifference*iBetterRankDifferenceAttitudeChange/(NumberOfPlayersEverAlive+1))
Item 9 (not visible):
if US rank >= NumberOfPlayersEverAlive/2 AND THEM rank >= NumberOfPlayersEverAlive/2
+1
Item 10 (not visible):
if THEM WarSuccess > US WarSuccess:
+iLostWarAttitudeChange
WarSuccess seems to be the number of Units killed (according to CvUnit.cpp)
Item 11 (visible):
CloseBordersAttitude
Item 12 (visible):
WarAttitude
Item 13 (visible):
PeaceAttitude
Item 14 (visible):
SameReligionAttitude
Item 15 (visible):
DifferentReligionAttitude
Item 16 (visible):
BonusTradeAttitude
Item 17 (visible):
OpenBordersAttitude
Item 18 (visible):
DefensivePactAttitude
Item 19 (visible):
RivalDefensivePactAttitude
Item 20 (visible):
ShareWarAttitude
Item 21 (visible):
FavoriteCivicAttitude
Item 22 (visible):
TradeAttitude
Item 23 (visible):
RivalTradeAttitude
Item 24 (visible):
MemoryAttitude (i.e. Accepted or Rejected Demand)
Item 25 (visible):
AttitudeExtra (only if specified for a Scenario – not in Core Game)
All Items are added and the total Attitude is returned.