[BTS] The Final and Definitive Truth about Diplomatic Modifiers

I analyzed code of CvGameTextMgr::getAttitudeString - a string of green & red text when hover over the leader showing its attitude (diplomacy value).

Messages are defined in:

Civ4/Assets/XML/Text/CIV4GameTextInfos.xml
Beyond the Sword/Assets/XML/Text/CIV4GameText_BTS.xml

Code is in CvPlayerAI.cpp / CvDeal.cpp / etc:

Code:
CvPlayerAI::AI_getCloseBordersAttitude
TXT_KEY_MISC_ATTITUDE_LAND_TARGET: Our close borders spark tensions.

CvPlayerAI::AI_getWarAttitude
TXT_KEY_MISC_ATTITUDE_WAR: This war spoils our relationship.
iAtWarAttitudeDivisor = -5 & iAtWarAttitudeChangeLimit = 5
= max(turns / div, -limit) - 3

CvPlayerAI::AI_getPeaceAttitude
TXT_KEY_MISC_ATTITUDE_PEACE: Years of peace have strengthened our relations.
for ALL AIs: iAtPeaceAttitudeDivisor == 60 & iAtPeaceAttitudeChangeLimit = 1
= min(counter / div, limit)

CvPlayerAI::AI_getSameReligionAttitude
TXT_KEY_MISC_ATTITUDE_SAME_RELIGION: We care for our brothers and sisters of the faith
for ALL AIs: iSameReligionAttitudeChange == 1 & iSameReligionAttitudeDivisor = 10
iSameReligionAttitudeChangeLimit is in range [1:7]
if same religion then = change + 1 if we have holy city + min(turns / div, limit)

CvPlayerAI::AI_getDifferentReligionAttitude
TXT_KEY_MISC_ATTITUDE_DIFFERENT_RELIGION: We are upset that you have fallen under the sway of a heathen religion
for ALL AIs: iDifferentReligionAttitudeDivisor = -5 & iDifferentReligionAttitudeChangeLimit = -1
iDifferentReligionAttitudeChange is in range [-2:0]
if different religion then = change - 1 if we have holy city for state religion + max(turns / div, limit)

CvPlayerAI::AI_getBonusTradeAttitude
TXT_KEY_MISC_ATTITUDE_BONUS_TRADE: We appreciate the years you have supplied us with resources
for ALL AIs: iBonusTradeAttitudeDivisor = 50 & iBonusTradeAttitudeChangeLimit = 2
= min(counter / div, limit)

CvPlayerAI::AI_getOpenBordersAttitude
TXT_KEY_MISC_ATTITUDE_OPEN_BORDERS: Our Open Borders have brought our people close together.
iOpenBordersAttitudeDivisor = 25 & iOpenBordersAttitudeChangeLimit = 2
= min(counter / div, limit)

CvPlayerAI::AI_getTradeAttitude
TXT_KEY_MISC_ATTITUDE_TRADE: Our trade relations have been fair and forthright.
AI_getPeacetimeGrantValue
AI_getPeacetimeTradeValue
[grant + max(0, trade_me2you - trade_you2me)] / (met_counter + 1) / 5 LIMITED to [0:4]

CvUnit::gift
grant is changed on gifting unit: getProductionCost() / 5

CvTeamAI::AI_techTradeVal
    iCost = std::max(0, (getResearchCost(eTech) - getResearchProgress(eTech)));
    iValue = ((iCost * 3) / 2);
    iValue += (((iCost / 2) * (iPossibleKnownCount - iKnownCount)) / iPossibleKnownCount);
3/4 * percent_unknown_tech

CvPlayerAI::AI_cityTradeVal
300 + pop*50 + culture_level*200 + (pop*50+turns+100)*4*culture_percent/100

TXT_KEY_MISC_ATTITUDE_EXTRA_GOOD: Past events have brought our people together.
TXT_KEY_MISC_ATTITUDE_EXTRA_BAD: Past events have drawn our people apart.

In human words:

* resource gifting increases a counter every turn by a number of resources, bonus is counter / 50, but no greater than 2. Like 1 resource gives +1 after 50T, +1 = 2 after 100T, then stops changing.
* open borders increases a counter every turn, bonus is counter / 25, but no greater than 2. Like +1 after 25T, then +1 = 2 after 50T, then stops changing.
* meeting AI gives +1 once after 60T.
* trade value decreases by dividing on how many turns you met AI, bonus = value / turns but no greater than 4
* gifting a unit gives trade value 5 times less of unit's cost
* trade value of a tech depends on how unknown the tech, and 3/4 of the research cost
* gifting a newly built city gives roughly 300+50+200+(50+100)*4 = 1150 trade value. If you know AI even for 300T (end game??) 1150 / 300 ~= +4 diplomacy attitude!! Gifting a city is almost permanent +4.
* positive religion modifiers increases every 10T up to limit, negative decreases every 5T. See above analysis and consult XML files - the limits are different for every leader.
 
Last edited:
Wow, I was not aware that gifting units counts towards trade value.
I wonder what use of it. Warrior cost is 15, gifting gives 15/5=3. IDK the value of 10 gold.

Anyway it is not possible to gift a Warrior to Tokugava for opening border because gifting happens inside open border...

Probably it is a micro optimization for missionaries, when you spread religion.
 
Last edited:
Gifting units for diplo is very close to useless - you just don't get much diplo per :hammers:. City gift OTOH gives massive diplo bonus per :hammers:.
 
I believe gifting units technically works better with units you cannot build and don't have a conventional production value, I.E. Great People, but realistically it's not something you're ever going to see make a difference one way or another. Even if you do end up in a situation where you I.E. give an AI a Great Prophet to build a Shrine you intend to conquer later, or a Great Engineer to try and manipulate UN elections by having that AI build the UN wonder itself.
 
I like your scenarios of gifting units.
I believe the most common will be gifting missionaries to civ if you anyway want to spread religion into his cities?
It can save you up to 2 golds per turn and a give a little bit trade bonus apparently.

Previously I've only gifted units as a proxy war, when didn't want for some civ A take city from undeveloped civ B and at the same time wasn't ready to start war with civ A.
And sometimes you can gift workers if you don't need such big amount of them anymore.
 
Back
Top Bottom