I analyzed code of
Messages are defined in:
Code is in
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.
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: