Diplomacy AI Development

So check me on this one. Askia and I have been battle buddies a long time. I have transparent diplomacy on, so there should not be any funny business.

Overall he has a positive rating of me before he declared war, so why would he declare?

Spoiler :

upload_2020-3-26_20-44-45.png



I'll also note that I my supply cap in soldiers and I'm military tier ahead of him. That said, most of my troops are on my other border.
 
Overall he has a positive rating of me before he declared war, so why would he declare?

He's a warmonger and military-focused civ, which probably have coded high flavors for war. You have a border with him and are the only clear target. What did you expect? Looking on the map, that war was only a matter of time. On the bright side, he shouldn't mind after peace out, unless he thinks of you as weak militarily or clear threat that is ready to win the game.
 
He's a warmonger and military-focused civ, which probably have coded high flavors for war. You have a border with him and are the only clear target. What did you expect? Looking on the map, that war was only a matter of time. On the bright side, he shouldn't mind after peace out, unless he thinks of you as weak militarily or clear threat that is ready to win the game.

Oh I assumed he would war me eventually, but I assumed after our diplomatic numbers started to decline for the various reasons warmongers come up with:)
 
So check me on this one. Askia and I have been battle buddies a long time. I have transparent diplomacy on, so there should not be any funny business.

Overall he has a positive rating of me before he declared war, so why would he declare?



I'll also note that I my supply cap in soldiers and I'm military tier ahead of him. That said, most of my troops are on my other border.

He's a warmonger and military-focused civ, which probably have coded high flavors for war. You have a border with him and are the only clear target. What did you expect? Looking on the map, that war was only a matter of time. On the bright side, he shouldn't mind after peace out, unless he thinks of you as weak militarily or clear threat that is ready to win the game.

Oh I assumed he would war me eventually, but I assumed after our diplomatic numbers started to decline for the various reasons warmongers come up with:)

@Cokolwiek is correct. Opinion is only one factor in calculating Approach.

Also, looking at those numbers; you need to have a positive score of > 30 to tilt your Approaches into the positive zone. If it's between -30 and 30 it just makes him more likely to be NEUTRAL, and being a warmonger sharing a land border with you gives him plenty of WAR weight to overcome that hurdle.
 
Mmmm, you have a point. Thank you for the feedback. :)

Do you have any suggestions on how it could be done better, then? I'm open to ideas.

(Note that the median factors in eliminated civs.)
OK, but that will lower the median even more.

My first suggestion is... a cap! (Didn't see that coming, did you? :)) I don't think it makes much difference if the civ has 10 or 12 more Wonders than you - but I can also see how people would disagree here.
Starting at 3 more like you do is OK (2 would be fine as well), and it could cap at 8 more if it's 20/wonder or 13 if it's 10/wonder (for a max penalty of 100)

Otherwise, with this kind of distribution, the average is a bit less punishing than the median since the high outliers drive it higher, but it'll still lead to high penalties.


Separately, I wonder if it makes sense to extend the distance for Warmongers as the eras pass. For instance: in Industrial, I wouldn't mind a Warmonger trying to conquer a FAR wonder hoarder, and even a DISTANT one from Modern on.
 
What about an exponential scaling?

Say the first wonder over the median generates -10, the second -15, third -25, fourth, -40

So being 1 or 2 wonders over the median has a moderate malus and each new wonder generates more animus than the one before
 
I've reached -320 diplo values from amassing wonders, so...

For now, I just think the diplo penalty scales too fast. I'm not sure if the idea overall needs drastic changes yet, wonders tend to be amassed by a few civs and it makes sense for everyone else to be wary of that happening.
 
I think the penalty should also be toned way down. The thing to remember, we already have penalties for "you are winning"....we don't need to do a big double dip on wonders as well.

I was thinking about what I personally want from the diplomacy system. And to me its summarized in three points:

  • Neutral is lame. The AI is pushed towards blocks, love me or hate me.
  • Those blocks allow for love. Right now its all hate at the end, I do want the ability to get some love from at least some of the AI players.
  • Allow for some "shake up" plays every so often. Maybe a hated AI out of the blue asks for help, which gives me a much bigger bonus to liking me than normal. Maybe a certain action that is normally not great suddenly angers a friend. This allows for some shakeup in the blocks.
 
In response to feedback here and after my own testing, I've determined the AI is too aggressive, so I've reduced the scaler to 5 per Wonder (from 20), and capped the penalty at -60 (-80 if cultural/conqueror).

This should be a drastic reduction from current aggression levels. :)

I think the penalty should also be toned way down. The thing to remember, we already have penalties for "you are winning"....we don't need to do a big double dip on wonders as well.

I was thinking about what I personally want from the diplomacy system. And to me its summarized in three points:

  • Neutral is lame. The AI is pushed towards blocks, love me or hate me.
  • Those blocks allow for love. Right now its all hate at the end, I do want the ability to get some love from at least some of the AI players.
  • Allow for some "shake up" plays every so often. Maybe a hated AI out of the blue asks for help, which gives me a much bigger bonus to liking me than normal. Maybe a certain action that is normally not great suddenly angers a friend. This allows for some shakeup in the blocks.

Hmm, I changed some logic in the approach function - now NEUTRAL is ranked and has weight subtracted like the other approaches. Let's see if that helps next version. :)
 
  • Allow for some "shake up" plays every so often. Maybe a hated AI out of the blue asks for help, which gives me a much bigger bonus to liking me than normal. Maybe a certain action that is normally not great suddenly angers a friend. This allows for some shakeup in the blocks.

Babysitting AI :goodjob:
Really a cool idea.
"Protect us from those Zulus and ask what you want!"
 
People have mentioned the CS penalties, and I think there is something to consider there.

Right now we have three general penalties imo:

1) Dick move penalties (broke a deal, put a citadel on me, change my religion).

2) Penalties for just being me (CS quests, settling areas)

3) Penalties for winning (high score, close to a victory condition).


I think some of the penalties for 2 and 3 overlap a bit. For example, I agree that just getting CS through quests and not diplomatic units shouldn't receive a real penalty (not my fault they like me better than you). However, if that is leading me to get ahead and starting to win, than the penalties for number 3 kick in, and that makes sense to me.

So I wouldn't mind the CS penalties toned down because of quests (if that is in any way possible).
 
I think CS penalities need to be toned down to be honest. Unless a civ is going for a diplomatic victory.. having an friend take control of a CS is not always a bad thing if it keeps an enemy from holding it.

Though "friends" can quickly become "enemies" thanks to the AI loving to take war bribes.. but hey.
 
What is the file that contains modifier values for warmongering? I'd like to adjust some numbers for testing.
 
Glad to see the changes to the wonder penalty. Any thoughts about making a similar change to the "reckless expansion" penalty? I think it is a bit extreme and hits too suddenly, like the wonder penalty. I happened to trigger both in my current game within a few turns, which was a disaster for AI relations.
 
Glad to see the changes to the wonder penalty. Any thoughts about making a similar change to the "reckless expansion" penalty? I think it is a bit extreme and hits too suddenly, like the wonder penalty. I happened to trigger both in my current game within a few turns, which was a disaster for AI relations.

Perhaps; let's see if using the median rather than the mean has an effect, though. :)

What is the file that contains modifier values for warmongering? I'd like to adjust some numbers for testing.

(1) Community Patch > Core Files > PNM Mods DB > DIPLO > AIWarmongerAdjustments.xml

A few of them are also in (3) CSD for CBP > DLL > AddDefines.sql, specifically these ones:
Code:
--World War and Warmonger

INSERT INTO Defines (
Name, Value)
SELECT 'WARMONGER_THREAT_PER_TURN_DECAY_INCREASED', '50';

INSERT INTO Defines (
Name, Value)
SELECT 'WARMONGER_THREAT_PER_TURN_DECAY_DECREASED', '200';

INSERT INTO Defines (
Name, Value)
SELECT 'WARMONGER_THREAT_ATTACKED_WEIGHT_WORLD_WAR', '50';

INSERT INTO Defines (
Name, Value)
SELECT 'WARMONGER_THREAT_ATTACKED_WEIGHT_WORLD_PEACE', '200';

INSERT INTO Defines (
Name, Value)
SELECT 'WARMONGER_THREAT_DECREASED_WORLD_WAR', '5';
 
AI really seems to overemphasise Score as a reason for hate, instead of well a whole bunch of other things. And civs in last place don't really seem to know when to quit and side with the winner.

I've just been playing a game as Egypt. Playing a Large Communitas map, which gave me a set of small continents and islands, with 8 city-states, and no civs connected by coastline. And a bunch of natural wonders to myself. So I was playing the entire early game with no other civilisations, except eventually for the Iroquois in the medieval era. Who had also got an isolated start, just on an even smaller area, and with a single city-state (and decided to pick Authority) and thus were really behind. I had picked Tradition, which ended up being suboptimal for filling all the space I had, but still worked.

So when I met everybody in time to rush the printing Press, after unlocking crossing oceans, I did so with very few diplomatic penalties. Every civ I met, I traded 3-4 luxuries to and secured open borders (they never seemed to want it from me). The Iroquois hadn't founded, so I quickly converted them, completely. The rest were on the largest continent and the religions were all set, so I didn't bother trying to convert them. The rest of the civs had all been fighting each other for the rest of the game, and so hated each other. Every single one of them had at least denouement against another one, and most had two or three. Cities had traded places all other the place, etc.

The Iroquois I put my best effort into winning over. They got my religion, defensive pact, sold tech. I sent them multiple trade routes, they bought every single one of my excess luxuries (which they really needed because a city of their rebelled and become a city state before me) and I gave them good deals on strategic resources they bought off me. Still backstabbed me.

Every single civ in the game, despite how much they hated each other turned on me, and declared war. Even though many of them had no real hope of beating me. The game seems to overvalue the number of units instead of tech because the Iroquis seemed to think it was a smart idea to launch a naval invasion of cavarals against frigates and Corvettes and got smashed.

The Zulus for example, had just gotten rolled and lost half their empire to two civs. Instead of working against them, they sent a bunch of units loose near a few of my cities and got picked off. They then did nothing for turns, all while refusing peace, and then showed up with a bunch of ships to fend off my counterattack against a civ that had just been kicking their teeth in before I met them. They were the one to start the chain of declarations, despite being the second-worst off, after the Iroquois.

Half these civs, had also just been relying heavily on me for resources. I had civs buying horses, iron and coal off me, as well as lots of luxuries. Half the ones I fought had unhappiness penalties as soon as they declared on me, so the declaration wasn't cheap on them.

Anyway, I've been playing for like 30 turns on Epic, at war with the whole world (the first war started like 50 turns ago, and the rest trickled in), and it is just such a bore. I hadn't geared up for a Domination Victory, but the game seems to be trying to force me to play that way. The AI launch badly planned naval invasions, and I throw them back. I've chewed up multiple times my number in units. The main damage to me was the trade routes they plundered going to their own cities and a single distant city-state that I got an alliance from a quest, and who got eaten. But I can't really launch counter invasions, because the AI has all gone full speed military building and the other civs come to save one of them, even if they had spent most of the game hating each other.

Also at this point, I was still nowhere near a victory. My best Tourism was Popular with the Iroquis, but most are much further behind because I hadn't seen them for most of the game. Tech-wise I started the wars about to enter the Industrial era so a science victory is still a long way off. Diplomatic I was likely in the best spot for, as I had alliances with ten city-states, a bit over half the number in the game (started at 20, but the other civs had been eating them), but the vast majority of those are in my area and I was still easily fending off attempts to invade them. But tech levels means a diplo victory is still a long way off. But these wars aren't really denting my chance of a victory, because none of them are even close to taking any of my cities.

A thing that I think really needs introducing, is civs accepting junior partner status. The Iroquois really had every rational reason to back me. They had my religion, they relied on my resources and they were dead last. Their capital was lower population than most of my secondary cities, and I had the same number of cities, spread over better more spaced out territory. Maybe becoming a vassal is too much, but they had no way of winning. They were dead last in tech, were still finishing their second policy tree when nearly everybody else was in their third and lost one of their cities to a rebellion.


Also minor thing. With the open borders, whenever I offered a mutual trade, barring the Iroquois, the AI just said Impossible. So I traded resources, and most civs seems to accept strategic resources. I was able to trade a couple of horses, even to civs that already had them for open borders. Civs seem to overrate strategic resources, paying lots of gold for them, while underrating luxuries (still buying them for 6-8 gold). Despite most civs in-game having unhappiness issues.
 
Recursive will know better than I, but score is actually not considered much.
Did you have a lot more Wonders than other civ? In the current version, it's a huge cause of hatred.

Otherwise it could be that your army was too small...

Also, some declarations of war are often a civ bribing another one to go to war with you.

So I get that it's a pain (I've had it happen too), but it's not because the programming is too simple.
 
Recursive will know better than I, but score is actually not considered much.
Did you have a lot more Wonders than other civ? In the current version, it's a huge cause of hatred.

Otherwise it could be that your army was too small...

Also, some declarations of war are often a civ bribing another one to go to war with you.

So I get that it's a pain (I've had it happen too), but it's not because the programming is too simple.

I have a decent number, being a Tradition Egypt. But other civs have some as well, and Germany and Brazil (the other top civs in game) are still getting some of the recent era wonders that I didn't target for beelining.

My army isn't that large, but its nearly all updated for the tech level, and I've had no issue throwing back the AI, even at war with the entire world, (7 civs). Playing on 6 for context, as a still somewhat new player to VP. A lot of the AI's have carpets of land units, which are utterly useless for attacking me. I also have my regional city-states locked down with alliances, which cover the approaches to some of my cities, so a lot of their invasions have floundered against the combined forces of them and my navy. Not sure if City-states are factored in calculations, normally, but in this game, they are quite useful defensively.

My issues aren't that I'm getting declarations of war. Of course, the top civs would be trying to shut me down. But it is all the lesser players, who have been getting their teeth kicked in, or are in no position to win, going to war when it blows their own feet off. I really don't see how some bribe (if that is what is happening), is worth all the downsides of losing my resources, and immediately sinking into unhappiness. It seems like there is no point to cultivating allies by nice to them, it is just better to attack nearby civs and vassalise them.
 
Back
Top Bottom