AI Leaders Personality Matrix

ori

Repair Guy
Retired Moderator
Joined
Dec 17, 2005
Messages
16,561
Location
Baden-Württemberg, Germany
These are three Excel spreadsheets of the BtS 3.13, Warlords V2.08 and Vanilla V1.61 CIV4LeaderheadInfos.xml files. In these versions all tags are annotated

The BtS version was compiled by karlkrlarsson
The Warlords version was compiled and annotated by ori
The Vanilla version was compiled by NeverMind and annotated by PeteT

The File can be found in the DownloadDataBase.

Please also note fengertao's Vanilla version of this spreadsheet.
 

NeverMind

Proud to be Russian
Joined
Apr 29, 2005
Messages
618
Location
Moscow, Russia
Good work, ori! I would like you to add my vanilla spreadsheet in your file, in order to keep this info in one place. ;)
 

ori

Repair Guy
Retired Moderator
Joined
Dec 17, 2005
Messages
16,561
Location
Baden-Württemberg, Germany
TDK said:
Thank you very much, it is appreciated. I'm on Team One in the SGOTM3 competition and we are playing for fastest diplomatic win(17 opponents! Agressive AI!!!). Might be interesting for you to follow, bet a lot of people are using your work there, sadly I didn't see it until yesterday(I was just happy to see you were not on one of our opponents teams ).

Just one more question, you wrote somewhere that there was an equivalent of the "Warmonger solidarity factor" for peacefull civs, but I didn't see it elaborated in the spreadsheet or in any of your posts, can you point me in the right direction?

Thanks again,

TDK

p.s. Feel free to post my questions with your answers in the forum for the benefit of the community if you like.


ori said:
Hi,
actually the calculation is:
iWorseRankDifferenceAttitudeChange*RankDifference/(NumberOfPlayersEverAlive+1)
i.e.
if there are ten Players in your case that would be
4*9/11 which would be rounded to 4
if there are 18 Players it would be
4*9/19 which would be 2...
I'll change the files soon to reflect this...
Oh and this applies to all relations, i.e. AI vs. human as well as AI vs. AI
Regards
ori

TDK said:
Ori, thanks for all the nice work you have done on the diplomatic relations mechanics. I have a question about your spreadsheet, the line: "iWorseRankDifferenceAttitudeChange in the Warlords version, does it apply to the AI relation to the human player? If I was number one in score and Cyrus was 10, would it mean that Cyrus would have a hidden +4(I assume the cap i 4, so it would never actually be 2*9=18) with me?

Thanks,

TDK

Answered in next post...
 

ori

Repair Guy
Retired Moderator
Joined
Dec 17, 2005
Messages
16,561
Location
Baden-Württemberg, Germany
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:

&#8222;not visible&#8220; 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 &#8211; abs(US Peace Weight &#8211; THEM PeaceWeight))
abs means that the result of (US Peace Weight &#8211; 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 &#8211; 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 &#8211; not in Core Game)

All Items are added and the total Attitude is returned.
 

ori

Repair Guy
Retired Moderator
Joined
Dec 17, 2005
Messages
16,561
Location
Baden-Württemberg, Germany
Note that:

Item 4 means that Leaders with a similiar Peace Weight have a positive modifier of up to +4 and Leaders with very different Peace Weights have a very high negative modifier (up to -9)

Item 5 means that Warmongers have a positive modifier with each other...

Edit: for Diplomacy Victory any AI will vote for the Player on whose team it is, if there is none it will vote for the Player towards whom it has the higher attitude if this attitude is higher than +7. If both Players are tied it will abstain, if the attitude towards both is +7 or below it will abstain.
 

Ralph_Jackson

Emperor
Joined
Mar 7, 2006
Messages
1,631
Location
Edinburgh Scotland
Ori, Thanks for the explanation re attitudes, I had tried and struggled to understand what was going on then found thid thread and it became clear

:goodjob:

Thanks

Ralph
 

ori

Repair Guy
Retired Moderator
Joined
Dec 17, 2005
Messages
16,561
Location
Baden-Württemberg, Germany
Ori, Thanks for the explanation re attitudes, I had tried and struggled to understand what was going on then found thid thread and it became clear

:goodjob:

Thanks

Ralph

:blush: actually I found one thing that is not quite right here (I corrected it in the Attitude thread but not here):

rank: is 0 for the HIGHEST scoring civ, i.e. the player with the highest rank number is the one with the lowest score. This means that iWorseRankAttitude applies when the AI has a lower score and iBetterRankAttitude applies when the AI has a higher score. Also item 9 thus applies if both players are in the lower half of the score table...
 

Ralph_Jackson

Emperor
Joined
Mar 7, 2006
Messages
1,631
Location
Edinburgh Scotland
Don't worry with the signposting in this thread I had puzzled that bit out myself!!

Ralph
 

TDK

Emperor
Joined
Feb 22, 2006
Messages
1,229
Location
Denmark
Ori, do you know if they changed anything for 1.74 Vanilla? Like the rounding bug in iBetterRankAttitudeChange that causes a value of 1 to be useless? Or is it the same as 1.61?

Also, I can't find where it says how long a leader "Refuse to talk" to you after you agree to stop trading with him?

Thanks,
TDK
 

ori

Repair Guy
Retired Moderator
Joined
Dec 17, 2005
Messages
16,561
Location
Baden-Württemberg, Germany
I don't know by heart but will check - tough I am away from my civ computer for the next two weeks :eek: (hope I don't go cold turkey ;)) so it will be a while before I reply to this - If I don't prod me :)
I think there where no or no remarkable changes in 1.74/2.13 though I will recheck this as well :)
 

ori

Repair Guy
Retired Moderator
Joined
Dec 17, 2005
Messages
16,561
Location
Baden-Württemberg, Germany
Ori, do you know if they changed anything for 1.74 Vanilla? Like the rounding bug in iBetterRankAttitudeChange that causes a value of 1 to be useless? Or is it the same as 1.61?

Also, I can't find where it says how long a leader "Refuse to talk" to you after you agree to stop trading with him?

Thanks,
TDK

I forgot about this - sorry:
there are no xml changes between 1.61 and 1.74 and none between 2.08 and 2.13.
I cannot find any changes for the BetterRank thing and for the time it takes for the AI to respond again I am unsure - I don't really follow that code too well, it confuses me :crazyeye: I'll try to understand it better and report again.

There are no changes for this file for the BtS 3.17 patch.
 

DrakenKin

Prince
Joined
Jan 8, 2010
Messages
461
Location
Montreal
Could we have some explanation on how to interpret the numbers?

Say right now I want to make Alexander go to war with another AI. I go to your spreadsheet for BtS and see that for Alexander, CONTACT_JOIN_WAR as a value of 20. How do I use this number to know how many diplomatic points I need in my current game to open this possibility to me?

It would be great if someone had the time to post how this spreadsheet can be used in a few different cases (a kind of tutorial or article with examples).
 

DrakenKin

Prince
Joined
Jan 8, 2010
Messages
461
Location
Montreal
Thanks, it cleared that specific problem up.

The numbers in the matrix are affected by the difficulty level, right? Is this documented somewhere?
 
Top Bottom