Diplomacy AI Development

When the AI does a triple war declaration against you (aka 3 nations declare on you immediately), is that pure coincidence, or are they actually coordinating for a 3 way?

Probably one civ asked two other civs if they'd like to do a coop war against you.
 
Found a significant bug in the warmongering calculation. Working on fixing it.
 
Found a significant bug in the warmongering calculation. Working on fixing it.

Did another rewrite of all the code. Should hopefully fix the bugs and excessive penalties.
 
Is Harun Al-Rashid supposed to hate me for competing for world wonders and apply a -100 opinion when i only have two wonders while he has 15?
sounds a bit extreme.
 
Is Harun Al-Rashid supposed to hate me for competing for world wonders and apply a -100 opinion when i only have two wonders while he has 15?
sounds a bit extreme.
I think that phrase means you completed a wonder that he had already partially built.

-100 is a bit harsh
 
I think that phrase means you completed a wonder that he had already partially built.

-100 is a bit harsh
I only built Terracotta and Leaning tower of pisa, not sure he'd be interested in terracotta but maybe leaning tower?
Still -100 is bit too much.
Also something is definitely not working as intended when it comes to Warmonger fervor calculation but i guess this is the bug Recursive squashed.
 
Is Harun Al-Rashid supposed to hate me for competing for world wonders and apply a -100 opinion when i only have two wonders while he has 15?
sounds a bit extreme.

It is possible on Deity difficulty if the leader has the Cultural personality and also has 10 Wonder competitiveness. I bumped up the thresholds a bit as they were too low (a single Wonder could trigger it, now you need to beat them to 3 if they have max. competitiveness) and I reduced the opinion penalty by 25% - also for City-State competition and territorial disputes. I think all things considered the penalties were excessive, since there's also an approach penalty, but a high penalty is necessary for competitiveness to avoid making diplomacy too easy. I did fix several missing positive modifiers for next version.
 
Last edited:
Hey Recursive!
As if I've read it already in a different thread, but came to ask just to be sure: will there be warmonger adjustments for the next version? For example in my current game I was DoW-d by Assyria, and their units gain +40% combat bonus? (warmonger fervour) This doesn't seem right :crazyeye:
 
Hey Recursive!
As if I've read it already in a different thread, but came to ask just to be sure: will there be warmonger adjustments for the next version? For example in my current game I was DoW-d by Assyria, and their units gain +40% combat bonus? (warmonger fervour) This doesn't seem right :crazyeye:

Yes.
 
I reworked the common foe bonus (which is fixed for next version). It can go up to +100 now, but how much is added depends on how strong the opponent you damaged is compared to the grateful AI. The stronger the opponent the more value you gain for damaging them.

Also, you won't gain recent assist or common foe bonuses while at war with a civ anymore.

And finally, AI will now consider the common foe bonus when choosing Defensive Pacts and coop wars.

The bonus to DPs is substantial, so helping civs in war is a good strategy to get a DP with them.
 
Annnnd I've fixed several more diplomacy issues, one of which was a significant bug (when reevaluating players, the AI would only prioritize approaches based on the players being reevaluated, not all valid players as was intended).

The role of the AI's opinion in the approach calculation has also been modified to be less extreme and make more use of leader flavors.

Stealing from the AI (citadels, spies, coups, religious conversion, digging up artifacts) now causes them to instantly reevaluate their approach towards you.
 
Last edited:
Annnnd I've fixed several more diplomacy issues, one of which was a significant bug (when reevaluating players, the AI would only prioritize approaches based on the players being reevaluated, not all valid players as was intended).

The role of the AI's opinion in the approach calculation has also been modified to be less extreme and make more use of leader flavors.

Stealing from the AI (citadels, spies, coups, religious conversion, digging up artifacts) now causes them to instantly reevaluate their approach towards you.

Very nice. Does this have any effect on other civs opinions, & presumably that works the same for player.
 
digging up artifacts
Is this only done after the player chooses to not build a landmark? Asking because the AI used to consider you stealing from them when you started digging.
 
nice to see how much it is evolving! A lot seems to have been reported on vassalage, but just in case an additional remark (sorry if I missed it in the discussions): say you play tall/peacefully and you work on establishing good relations with a neighbouring civ A. But then your friend A asks to be the vassal of a more powerful civ B (I imagine as a protection against an aggressive civ C). Then civ B finds you weak and declares war on you, and drags your friend A to war against you. Is it supposed to happen often? Or counterable as tall/peaceful? Or has that behavior been modified?
 
Very nice. Does this have any effect on other civs opinions, & presumably that works the same for player.

It affects all the AI players' evaluations of all other players.

Is this only done after the player chooses to not build a landmark? Asking because the AI used to consider you stealing from them when you started digging.

Yes. I fixed that bug a long time ago. :)

nice to see how much it is evolving! A lot seems to have been reported on vassalage, but just in case an additional remark (sorry if I missed it in the discussions): say you play tall/peacefully and you work on establishing good relations with a neighbouring civ A. But then your friend A asks to be the vassal of a more powerful civ B (I imagine as a protection against an aggressive civ C). Then civ B finds you weak and declares war on you, and drags your friend A to war against you. Is it supposed to happen often? Or counterable as tall/peaceful? Or has that behavior been modified?

Voluntary vassalage is less likely to happen for next version, I've fixed several issues including its overeagerness to capitulate.

Aside from that however, that is intended. When you become a vassal you give up political independence.
 
My complete changelog for next version:
Code:
Voluntary Vassalage
- Fixed excessive AI desire for voluntary vassalage
- Masters who accept a voluntary vassal now go to war with anyone the vassal is currently at war with, preventing troops from being kicked out + AI trained to handle this
- Added option to disable voluntary vassalage (DiploAIOptions.sql)
- Fixed being able to have a Defensive Pact and Voluntary Vassalage in the same trade deal

Opinion Score
- Fixed recent trade, common foe, vassal protection opinion bonuses not being applied
- Vassal protection bonus now nullified if you attack your vassal
- Adjusted penalties for competition with the AI
- Reduced "denounced by our friend" penalty, also applies less often
- Reworked common foe bonus to account for power difference between AI and damaged player; now can go up to +100
- The effect of an AI's opinion score on approach selection is now less extreme; increased consideration of leader personality + prioritization if the AI hates or likes a lot of people

Approach
- Improvements to AI approach selection towards both civs and City-States
- Reduced tendency to gravitate towards neutral
- Fixed erratic shifts in approach while AI is planning war
- Fixed a major bug with AI approach prioritization

Bugfixes
- Fixed militaristic City-States not spawning units
- Another major revision of warmongering calculation, fixed excessive penalties and several bugs, dropped flavor elements
- AI less likely to denounce friends
- Fixed some issues with difficulty-related code
- Fixed missing distance check from third party war bribes
- Fixed AI Morocco plundering their friends' trade routes

Balance
- Penalty for breaking PTP now scales with era
- Fixed excessive anti-warmonger fervor

Other
- Improvements to DP + coop war logic
- Adjustments to AI strength perception of humans
- Diplo Flavors Rework now fully integrated + VictoryCompetitiveness now a 1-10 scale
- AI no longer considers Grand Strategy before the medieval era (for domination) and renaissance era (otherwise); prior to this it uses its "diplo personality" which is based on flavors
- Added text to show when a Peace Treaty with a player's DP ally is blocking the ability to declare war
- Tweaked war information display
- Significant code cleanup and enum sanitization (still ongoing)
 
Last edited:
So here is a case where I think the AI behavior is irrational.

Spoiler :

upload_2021-4-13_17-5-26.png



Now Siam has been a rabid dog all game. He attacks, peaces, attacks, peaces...alllllll gaaaaaame long. And never once has he made a dent against me, we both just drain each other and then peace out.

So though that was highly annoying, ok even though we have the same religion you hate my guts for some reason this game, got it.

But now I am fighting Morocco, who is just 5 votes from winning Hegemony, with 6 turns until the hegemony vote. I am not winning in any category, Siam himself is now outteching me, and we both have the same Ideology.

and yet Siam takes a bribe to go to war with me....it makes no sense. He can sit back, let me exhaust myself on Morocco, kill the threat, THEN try to pounce on me.


And I'll note I'm wondering if this is an effect of some of the flavors, as I've noticed this "dog with a bone" behavior from Siam in other games. It feels like once he hates you, he will not rest until he has removed you from the earth, no matter how many turns go by.
 
So here is a case where I think the AI behavior is irrational.



Now Siam has been a rabid dog all game. He attacks, peaces, attacks, peaces...alllllll gaaaaaame long. And never once has he made a dent against me, we both just drain each other and then peace out.

So though that was highly annoying, ok even though we have the same religion you hate my guts for some reason this game, got it.

But now I am fighting Morocco, who is just 5 votes from winning Hegemony, with 6 turns until the hegemony vote. I am not winning in any category, Siam himself is now outteching me, and we both have the same Ideology.

and yet Siam takes a bribe to go to war with me....it makes no sense. He can sit back, let me exhaust myself on Morocco, kill the threat, THEN try to pounce on me.


And I'll note I'm wondering if this is an effect of some of the flavors, as I've noticed this "dog with a bone" behavior from Siam in other games. It feels like once he hates you, he will not rest until he has removed you from the earth, no matter how many turns go by.

This should be better for next version.

However in the approach calculation there actually isn't a check that goes "if Civ A is damaging our rival Civ B, we should let them be". There is one for being at war with the biggest competitor, but it's not enough to outweigh other factors. It's a bit hard to program because being at war doesn't cut it, and action needs to be taken against runaways earlier rather than later. I'll see what I can do.

EDIT: Okay, I have added such a check for next version (which was fairly complicated). Let's see how it performs. :)
 
Last edited:
What are the conditions of breaking a Pledge to Protect? And what triggers "you've aggressively attacked this City State"?
 
Top Bottom