Some notes about diplomacy. Can be a bit spoiler'y, so read it at your own risk.
Here are some easy-for-me-to-write-in-human-language notes. See pastebin below with full diplomacy routine (written in more or less c, from disasm and decomp of the original game) for more detailed info.
1. there's "player's dominance" variable, conditions for it to be 1:
player is number 1 in powergraph ("4 advisors", variable value: 7)
player has more than 4 cities
and AI civ has more than 1 city
player doesn't have any nuclear bombs
and game turn is more than 200 (i.e. >= 1 A.D.)
if this variable is 1, AI civ will very unwilling to make peace and will make demands even if it is much weaker than you. So if you dominate the game, build 1 nuke just in case.
2. if both you and AI has at least 1 nuke, desired money tribute is divided by 2. Then, if you have more nukes than AI, tribute is decreased proportionally. Otherwise, it is increased proportionally. For example, if you have 1 nuke and AI has 3, then first: money/2, then: money*3/1, so result is: 3/2*money. If you have 4 nukes and AI has 2, then: money/2, then: money*2/4, and final result is: money/4
3. if AI is in vendetta with you, desired tribute is doubled
4. desired tribute is proportional to the game difficulty. Chieftain is *1, emperor is *5.
5. "aggressiveness" AI leader trait takes its part in determination of AI "fear" variable. Other factors are: "contact+war" status with other civs (and how strong they are compared to "our" AI civ), vendetta with you, and if you are stronger than AI civ or not.
If result "fear" is more than 0, AI changes its "want to attack" variable to 0, and there's also 50% chance that it will set its money demands to 0.
BUT if your "dominance" status (see p.1) is 1, AI will ignore its "fear" (including "aggressiveness" trait)
6. if AI under Republic, it will make a revolution (to monarchy) before talks if 1) "want to attack" variable is not 0 and 2) AI is not in vendetta with you and 3) AI military power *2 >= player military power*3 OR player_dominance is 1. If both of these last conditions are not true, AI simply will set its "want to attack" variable to 0, that's why AI with republican govt will not declare war on you. But if it's in vendetta with you, it will do nothing here, and further code doesn't prohibit AI from declare war under republic. So yes, vendetta AI can declare war under republic.
7. when you agree to cancel peace with 3rd civ, there's 50% chance that AI civ will not demand money from you (it will set "desired tribute" variable to 0). You also always get "war" and "vendetta" status with that 3rd civ, if you agreed to cancel peace. Btw, AI always selected last suitable civ to request/demand to cancel peace. For example, if AI at war with English and Mongols, their demand will always be the Mongols.
8. if you decline peace offer, "GIVECIV", "GIVECASH" and "GROVEL" responds will work only once, at the very first meeting with this civ. Even if you did not agreed to meet first time, flag of "first meeting" will be set anyway, and you cannot get these responds next time.
9. for "GROVEL" response (all money and all civ. advances for peace) AI (among other conditions) should have less than 2 cities
10. after making peace, on chieftain difficulty AI disbands all its units near your cities (if closest city from unit is yours and distance from it is 2 or less)
11. If only your civ and AI civ are active, game should make second option in "We respond..." ("have a military proposal for you") inactive (blue). But because the barbarians are also always active, this condition is never true and you still can select this option only to see nothing here. Sadly, it seems there's no place here to squeeze some bytes to fix that problem (without doing some ugly jumps)...
12. "mercenary" routine in "We respond..." is not working properly. AI will take your money, but then nothing will happen. There's simply no any code in the game here to change their diplomacy state to "war" with selected civ.
Anyway, formula for price here:
loc_merc_cost = FUN_minmax((((civ_military_power[att_civ])/2)*(civ_money[par_civ]/100))/50, 2, 9999)*50;
it cannot be less than 100$ and it's always 100$ when AI treasure is less than 100 or 3rd civ mil. power is less than 2 or when all this (civ_military_power[att_civ])/2)*(civ_money[par_civ]/100) expression is less than 150, which often is true.
The richer the AI civ and the stronger the 3rd civ, the more money AI civ will demand here.
13. With "instant advice" enabled, you will get *SCHISM from HELP.TXT message at the end of the negotiations, if next conditions are true:
1) number of AI cities is more than 4
2) and civilization place of your civ + 1 is less than civilization place of AI civ
3) and you is at war with AI civ
Notice that these conditions are not very correct: if there's no free civ slot, then civil war is still not possible, and your place actually should be only one position lower than AI for civil war (I have no idea why there's "1 place gap" here). And of course there's no check that AI civ even has a capital city.
Here are some easy-for-me-to-write-in-human-language notes. See pastebin below with full diplomacy routine (written in more or less c, from disasm and decomp of the original game) for more detailed info.
1. there's "player's dominance" variable, conditions for it to be 1:
player is number 1 in powergraph ("4 advisors", variable value: 7)
player has more than 4 cities
and AI civ has more than 1 city
player doesn't have any nuclear bombs
and game turn is more than 200 (i.e. >= 1 A.D.)
if this variable is 1, AI civ will very unwilling to make peace and will make demands even if it is much weaker than you. So if you dominate the game, build 1 nuke just in case.
2. if both you and AI has at least 1 nuke, desired money tribute is divided by 2. Then, if you have more nukes than AI, tribute is decreased proportionally. Otherwise, it is increased proportionally. For example, if you have 1 nuke and AI has 3, then first: money/2, then: money*3/1, so result is: 3/2*money. If you have 4 nukes and AI has 2, then: money/2, then: money*2/4, and final result is: money/4
3. if AI is in vendetta with you, desired tribute is doubled
4. desired tribute is proportional to the game difficulty. Chieftain is *1, emperor is *5.
5. "aggressiveness" AI leader trait takes its part in determination of AI "fear" variable. Other factors are: "contact+war" status with other civs (and how strong they are compared to "our" AI civ), vendetta with you, and if you are stronger than AI civ or not.
If result "fear" is more than 0, AI changes its "want to attack" variable to 0, and there's also 50% chance that it will set its money demands to 0.
BUT if your "dominance" status (see p.1) is 1, AI will ignore its "fear" (including "aggressiveness" trait)
6. if AI under Republic, it will make a revolution (to monarchy) before talks if 1) "want to attack" variable is not 0 and 2) AI is not in vendetta with you and 3) AI military power *2 >= player military power*3 OR player_dominance is 1. If both of these last conditions are not true, AI simply will set its "want to attack" variable to 0, that's why AI with republican govt will not declare war on you. But if it's in vendetta with you, it will do nothing here, and further code doesn't prohibit AI from declare war under republic. So yes, vendetta AI can declare war under republic.
7. when you agree to cancel peace with 3rd civ, there's 50% chance that AI civ will not demand money from you (it will set "desired tribute" variable to 0). You also always get "war" and "vendetta" status with that 3rd civ, if you agreed to cancel peace. Btw, AI always selected last suitable civ to request/demand to cancel peace. For example, if AI at war with English and Mongols, their demand will always be the Mongols.
8. if you decline peace offer, "GIVECIV", "GIVECASH" and "GROVEL" responds will work only once, at the very first meeting with this civ. Even if you did not agreed to meet first time, flag of "first meeting" will be set anyway, and you cannot get these responds next time.
9. for "GROVEL" response (all money and all civ. advances for peace) AI (among other conditions) should have less than 2 cities
10. after making peace, on chieftain difficulty AI disbands all its units near your cities (if closest city from unit is yours and distance from it is 2 or less)
11. If only your civ and AI civ are active, game should make second option in "We respond..." ("have a military proposal for you") inactive (blue). But because the barbarians are also always active, this condition is never true and you still can select this option only to see nothing here. Sadly, it seems there's no place here to squeeze some bytes to fix that problem (without doing some ugly jumps)...
12. "mercenary" routine in "We respond..." is not working properly. AI will take your money, but then nothing will happen. There's simply no any code in the game here to change their diplomacy state to "war" with selected civ.
Anyway, formula for price here:
loc_merc_cost = FUN_minmax((((civ_military_power[att_civ])/2)*(civ_money[par_civ]/100))/50, 2, 9999)*50;
it cannot be less than 100$ and it's always 100$ when AI treasure is less than 100 or 3rd civ mil. power is less than 2 or when all this (civ_military_power[att_civ])/2)*(civ_money[par_civ]/100) expression is less than 150, which often is true.
The richer the AI civ and the stronger the 3rd civ, the more money AI civ will demand here.
13. With "instant advice" enabled, you will get *SCHISM from HELP.TXT message at the end of the negotiations, if next conditions are true:
1) number of AI cities is more than 4
2) and civilization place of your civ + 1 is less than civilization place of AI civ
3) and you is at war with AI civ
Notice that these conditions are not very correct: if there's no free civ slot, then civil war is still not possible, and your place actually should be only one position lower than AI for civil war (I have no idea why there's "1 place gap" here). And of course there's no check that AI civ even has a capital city.
Last edited: