CivV AI: Why it hates you

silentknight111

Warlord
Joined
Oct 27, 2005
Messages
145
There's a very interesting XML file called "GlobalDiplomacyAIDefines.xml" that has all the basic diplomacy adjustments. It seems to apply to all civs, but I'm guessing their personalities further modify it from there. interestingly enough, negetive numbers are good, and positive numbers are bad. I guess you can think of the numbers as the amount of aggression the AI feels towards you.

What I found most notable while looking through this file is that the AI is weighted to be EXTREMELY aggressive towards you if it thinks you'd be very easy to defeat.

It gets +180 towards aggression if it thinks you are very weak:
Code:
<Row Name="APPROACH_WAR_PROJECTION_VERY_GOOD_PERCENT">
            <Value>180</Value>
 </Row>
That's a huge number, especially compared to:
Code:
<Row Name="OPINION_WEIGHT_ATTACKED_PROTECTED_MINOR_RECENTLY">
            <Value>20</Value>
 </Row>
or
Code:
<Row Name="OPINION_WEIGHT_WARMONGER_SEVERE">
            <Value>70</Value>
        </Row>

The only thing I an think, besides weighting the AI to attack the weak no matter what, is maybe this modifier applies only during a war, and not before one. Thus guaranteeing the AI stays at war if it's winning.

I highly recommend anyone who is confused by AI behavior look through this file... There are TONS of modifiers.
 
That's really cool. Thanks for posting it.
 
Kinda expected that , but this means you need to have a huge army in order for the AI to actually cooperate ? Which can become pretty impossible in Emperor+ where the AI builds insane sized armies. So it doesn't matter, the values are broken and need to be fixed.

And its still ******ed you're considered a warmonger when you destroy a civ the AI asked you to attack.
 
True.

I'm not sure what this one means exactly.. but it's huge:
Code:
<Row Name="COOP_WAR_LOCKED_TURNS_WAR_WEIGHT">
			<Value>1000</Value>
		</Row>
 
What's the difference between approach and opinion? Are you saying approach = during war and opinion = before war?

Is there an obvious parameter for defining 'warmonger' so that defenders don't get labeled incorrectly?
 
Kinda expected that , but this means you need to have a huge army in order for the AI to actually cooperate ?

No it's just barmy. I'm playing a game on Emporer where there is a massive Persian Empire, with the Persians, Germans, and myself about the same size. I've tried to get some deals going with the Germans and Persians but they just don't like me. On the other hand, the Persians, who I was trying to rein back, actually liked me enough to give me a defensive pact! Two turns later the Germans attack me saying "I can't overlook such a wonderful opportunity to attack a weak nation!". Oops

The Persians were almost worse. Firstly they complain that I'm massing troops on their borders, when actually they're in the middle of my borders and all my units are in my territory. Wait a second though, our open border agreement expired 100 turns ago so .... um well that's peculiar. Then they declare war on a nearby city state and laugh me "Hah I'm attacking your puny city state ally". Well they couldn't attack the city state at all if I could close my borders and stop them coming through my lands! I'm also presumably stuck with a diplomatic penalty if I attack the Persians (within 30 turns) since I said my troops weren't on their borders for war. Aaghh!

Horribly broken diplomacy. Needs a patch urgently.
 
I wish I knew. The more I look at this, actually, the more it gets confusing.

It's broken up into sections, and I think the numbers may work differently in the different sections. So, unfortunately, it might not be as much help as I thought. Comparing sections directly could lead to fasle assumptions. However, comparing numbers in the same section should work to give you a feeling for how the AI works.

I've attached the whole XML file in a zip for people who may not have current accesss to the file. Maybe some modder or other genius can shed more light.
 

Attachments

  • GlobalDiplomacyAIDefines.xml.zip
    5.6 KB · Views: 80
I'm reading it now. The one thing I'm curious about is the difference between an ignored promise and a broken promise.

You get a penalty for breaking a military promise (40 against the specific civ, 15 for all civs), but you only get -15 for that specific civ for ignoring the promise. That also applies to not settling (or is it massing?) near their borders and (I'm partially guessing) towards agreeing not to be friends with another civ.

EDIT: And this will be appreciated by some to know:

Behavior relationship change points:

Unforgiveable: 50
Enemy: 30
Competitor: 10
Favorable: -10
Friend: -30

Is it just me or are all these too low? It doesn't seem to take much to push it into the 30/50 range.

EDIT: I'm guessing the biggest concern is the difference between approach and opinion. Without feeling like looking into too much detail here at the moment, I'm at a loss to guess what it is.

EDIT (which I keep doing): I'm thinking I'm wrong with a simple + - system. I'm wondering if there are distinct values that add up. I'm seeing a cooperation desire system too and positive numbers are good here as well. So it looks like you want high cooperation desire numbers and low opinion weight.
 
EDIT (which I keep doing): I'm thinking I'm wrong with a simple + - system. I'm wondering if there are distinct values that add up. I'm seeing a cooperation desire system too and positive numbers are good here as well. So it looks like you want high cooperation desire numbers and low opinion weight.

Yeah, that's the conclusion I'm coming to.
 
I'll try and compile the common terms and distinct systems into categories. Maybe then we can hopefully figure out what these things mean (although testing is very difficult and I won't have the patience for it, so it'll be probably speculative from my end).

Any idea what Fierce, Strong, Weak, None are? Are these related to what you do? Are these AI personality types (like Ghandi vs. Montezuma)?
 
I'll try and compile the common terms and distinct systems into categories. Maybe then we can hopefully figure out what these things mean (although testing is very difficult and I won't have the patience for it, so it'll be probably speculative from my end).

Any idea what Fierce, Strong, Weak, None are? Are these related to what you do? Are these AI personality types (like Ghandi vs. Montezuma)?

I think it's just a threshold for the extremity of something. A fierce army compared to a weak army.
 
This would be huge if we could make sense of the diplomacy file. I think "fixing" diplomacy is very doable with a mod, probably unlike AI.

I think it's just a threshold for the extremity of something. A fierce army compared to a weak army.

I assumed the same thing.
 
Oh, once we figure out what all these things mean, we can change their diplomatic behavior significantly. It's all in XML files.

Of course, we'd also have to figure out how these numbers mix with the AI leader XML file.
 
Bah, this reeks of "blood thirsty self-centered sociopath" aproach to the AI if you ask me :D The numbers as they are were obviously thought with the intent of making the AI to be very responsive to weaknesses in the other civs and to be honest, the XML values are far more positive than negative in general ( in other words, the general impression that is very hard to not piss a AI is accurate ) ... so, with the basic values we should assume that the AI is a rabid dog that will strike you as soon as it perceives a weakness on you, regardless of their interests ( the values on the grand strategy handles are not as high as that , so I assume that this AI will shun the defense of their interests to kick the butt of a weak civ ... and that is suposedely playing to win ;) ). Not good , if you ask me ...
 
I don't think we can actually determine that any of that is true at the moment. It's easier for the AI to have a low opinion of you than a high one, but we don't know how they value this opinion compared to their cooperation desire system.

We also know it varies by leader. And not every leader is playing strongly to win.
 
I have my serious doubts about the "playing to win " philosophy as firaxis coders see it as a good winning strategy , but the fact is that the modifiers for the grand strategy never pass 20 in module , while there are modifiers in the order of the hundreths for when they perceive a enemy as weak makes me quite sure, that, if the two things pass by the same decision algorythim, the Ai will prefer to attack a weak guy than being pissed because someone is competing with them in the strategy they chose to win the game. That is is not playing to win in any sense, even in the rather sociopatical and 1:1 view firaxis AI coders have from quite a while ago ( BtS vassal mechanics are filled with that kind of nonsense, so it is not only a civ V thing )
 
Nice thread. Subscribing and looking forward to any new info that's revealed. I might take a look into the diplomacy XML myself at some stage and see if I can make any sense of it.
 
I have my serious doubts about the "playing to win " philosophy as firaxis coders see it as a good winning strategy , but the fact is that the modifiers for the grand strategy never pass 20 in module , while there are modifiers in the order of the hundreths for when they perceive a enemy as weak makes me quite sure, that, if the two things pass by the same decision algorythim, the Ai will prefer to attack a weak guy than being pissed because someone is competing with them in the strategy they chose to win the game. That is is not playing to win in any sense, even in the rather sociopatical and 1:1 view firaxis AI coders have from quite a while ago ( BtS vassal mechanics are filled with that kind of nonsense, so it is not only a civ V thing )

Just assuming but you have probably watched Soren's presentation of Fun AI vs Winning AI ;).

I think that bolded part is pretty much the same thing that Sirian was complaining at the time of CIV4 release on his game report (epic 6?)... hey they fixed that oh well... /
 
Bah, if they didn't wanted the AI to play to win ( like they touted so much ), they should had not made grand strategy code at all :D Maybe that would had helped them to have time for a less bugged and unbalanced released, methinks ;) It would even be more streamlined :devil:

Now making grand strategy code ( that is suposed to direct the AI for a desired win ) and let trivial stuff like border tension or a weak player in the other side of the globe derail you from your chosen path to win ... that is not even playing to lose :p, it is not play at all. I wonder if they thinked minimally on the consequences of this values.

BTW , and before i forget, I discovered a nice thing about the AI memory in my last game: they know that you breached agreements with other AI before they know you or the said AI ( that in my case was conveniently dead some milenia ago ) ... where is a good TMIT rant about map hacks when we need one ? :lol:
 
Please figure this out soon. I'm not familiar with xml, so i don't get this at all.

Here are some of my diplomacy issues:
-Alexander starts the game at Hostile
-Nobunaga starts out as my friend, then starts hating me for no apparent reason
-Washington switches from hostile to frienldy and back in a 10 turn cycle
-people accuse me of amassing troops near their borders when, not only are all of my units well within my borders, but I don't even know where said ai IS.
-Washington declares war on city-state. I declare war on city-state. Washing hates me on account of war-mongering
-settling 20 tiles away is 'too close for comfort' for some ai
-they like to rip you off in trades

Perhaps Firaxis put in some sort of 'pms generator'
 
Top Bottom