'You traded with our worst enemy'

Bjarkov

Chieftain
Joined
Jul 2, 2014
Messages
81
How does the 'You traded with our worst enemy' diplomatic malus work? I notice I'm not getting it every time I trade with someone's worst enemy, but some times I get it with the first trade I ever conduct and some times I can trade with impunity. What mechanics are behind this? Some leader-specific variable and a lot of random factor?
 
Not sure of the code (I'm sure someone will stop by with the actually code), but it seems to be a factor of several things, most important of which is length of time you've known the AI.

For instance, you just meet a AI "X" and "Z" who are WEs, you immediately trade with X, you will always get a -4 hit with Z. Conversely, just trading any tech on first contact will get +4 with that AI, but you probably know that.

I think other factors are indeed the AI personality. For instance, someone like Monty seems to be way more sensitive to WE trades than guys like Gandhi and Mansa.

I'm also pretty sure relative value of the tech for a given timeframe factors in as well. It seems trading techs just for gold vs. techs/maps can result in little to no malus, as long as you've known that AI for a bit.

I've no clue if there is any randomness to hit for trades. There are certainly points where I know I will get a hit or no hit.
 
Two questions about this, from an emperor game (Wang Kon recent nobles club map):

1. In the diplo mouse-over, it doesn't list WE under both leaders. So on that map, Nappy wanted me to cut trades with Lincoln. Nappy didn't have any red text about WE, but Lincoln did. If I lost diplo points w Nappy, shouldn't his diplo screen told me so? (Btw not running BUG so maybe that is part of the interface problem).

2. Does open border count as "traded w WE"?
-same map, after I cancelled deals w Lincoln, nappy still pestering me about trading with Lincoln and to cancel deals.

Epilogue: I will post a report later in NC thread, but my main diplo goal that game was not to be stabbed in back by Nappy, whereas I viewed Lincoln as not much a threat. Difficulty: I didn't give him OB so he could not settle "my" territory. So Lincoln founds Buddhism, converts JC and Nappy, who then demands I convert. Ok. Then I oracle CoL. Confu spreads automatically to Nappy, and he converts. This is great, he will be in tension with JC and Lincoln... Until nappy demands I convert to confu. At th time it was in ~5 cities versus 2 Buddhism, but decision time. So I convert, and a Cold War with Lincoln develops, but I'm keeping nappy happy. Long story short, after about 5 Dow of JC-Nappy and them trading those desert cities, and me culturally flipping Nappys FP city, I stab nappy in the back and clean his carcass. Then Lincoln-probably stewing how I treated him for millennia, though only ~ -3, ultimately declares on me via vassaling JC. Great experience in diplo!
 
Two questions about this, from an emperor game (Wang Kon recent nobles club map):

1. In the diplo mouse-over, it doesn't list WE under both leaders. So on that map, Nappy wanted me to cut trades with Lincoln. Nappy didn't have any red text about WE, but Lincoln did. If I lost diplo points w Nappy, shouldn't his diplo screen told me so? (Btw not running BUG so maybe that is part of the interface problem).

2. Does open border count as "traded w WE"?
-same map, after I cancelled deals w Lincoln, nappy still pestering me about trading with Lincoln and to cancel deals.

Open borders are indeed classified as a continuous trade (like a ressource trade) that will cause 'We demand that you stop trading with..' AI stupidity. This gives a 'You refused to stop trading with our worst enemies', which is not the same thing as 'You have traded with our worst enemies'.

'You have traded with our worst enemy' hits on the event that you conduct a trade with a hated AI. Example: I trade Alphabet for Mathematics with Mansa, and now Qin has a '-2: You have traded with our worst enemy!', Mansa being the worst enemy of Qin
 
I think it mathers how much value the trade is too. F.ex an expencive tech trade (f.example CS for fudalism) seems to piss them off more then a cheap tech trade (f.example 50gold for monotheism)
 
The worst enemy code:

Code:
int CvPlayerAI::AI_getRivalTradeAttitude(PlayerTypes ePlayer) const
{
	// XXX human only?
	return -(range(((GET_TEAM(getTeam()).AI_getEnemyPeacetimeGrantValue(GET_PLAYER(ePlayer).getTeam()) + (GET_TEAM(getTeam()).AI_getEnemyPeacetimeTradeValue(GET_PLAYER(ePlayer).getTeam()) / 3)) / ((GET_TEAM(getTeam()).AI_getHasMetCounter(GET_PLAYER(ePlayer).getTeam()) + 1) * 10)), 0, 4));
}

AI_getHasMetCounter returns the turns the civs are known each other, this is why you often see -4 for traded w/ worst enemies upon meeting.

Passing time (turns) decays worst-enemy value.

Things like gifting units, or opening borders, triggers trade with worst enemies. But it is insignificant compared to lopsided tech trades.

Buying techs with gold will never trigger worst enemy as long as you don't overpay. Zero value (i.e. neutral) trades don't do anything for trade with the worst enemy.
 
Zero value (i.e. neutral) trades don't do anything for trade with the worst enemy.

Interesting.. So if I ask what would make a deal work and they offer some, but not all their gold, it won't give me a hit for trading with worst enemy?
 
Interesting.. So if I ask what would make a deal work and they offer some, but not all their gold, it won't give me a hit for trading with worst enemy?

That's right. Either the human fits the price exactly, to suit the AI, or the AI contributes some of their gold, but not all of it.
 
"Buying techs with gold will never trigger worst enemy as long as you don't overpay. Zero value (i.e. neutral) trades don't do anything for trade with the worst enemy."

Wow I guess I really didn't know this mechanic worked, especially this part. Interesting for sure, might help me work on my diplo game.
 
Very useful info here! Taking care to balance trades with hated AIs is certainly going to help my diplomacy

hmm. I'm reading the code as
'return every 4th integer between the value (( Trade val player 1 + Trade val player 2 ) / 3 ) / ( time since AIs met *10 ) , and 0. Reverse the sign'.
So a trade between two civs where both trade 1500 value would give the same results as a trade of 2000 vs 1000, or 2999 vs 1? Where am I wrong?
 
In your interpretation of the range() function.
You are reading it as python, but it is C++.

I figured as much :) I failed to find any C++ docu on range() and now I'm curious. What does it do?

(edit)
However the range function works, I'm sure we can agree that it generates the same output if called twice with identical input? I hoped so :) So what matters here is more the calculation of the input than what the actual function does. The input appears to me to be the sum of the trade values divided by the number of turns since the civs met, multiplied by a fixed factor.
It would appear to me that the balance of the trade doesn't matter; it is the magnitude of the total trade that counts. So a 1500 vs 1500 trade would yield the same result as a 2999 vs 1 trade, other parameters being equal?
 
range() isn't a standard function. It is a firaxis function. My guess is it limits a value to a range, in this case 0..4, because it's the only thing which makes sense.
 
"Buying techs with gold will never trigger worst enemy as long as you don't overpay. Zero value (i.e. neutral) trades don't do anything for trade with the worst enemy."

Wow I guess I really didn't know this mechanic worked, especially this part. Interesting for sure, might help me work on my diplo game.

In my current game, I had a tech-trade in which I got a little money (less than the AI had) to make the deal equal. I still got -1 trading with worst enemy.

From all of my experience, trades only needing to be equal to not cause the malus is definately wrong, I remember often to have gotten -1, -2, or even -3 on relations in big trades, even if gold equalled them out.
 
Fair trade points is value of gifts divided by ((HasMetCounter+1)*5).

Trade with worst enemy:

The thing is working different than other negatives.
It doesn't matter how often you trade with worst enemies, it's the value relative to the turns you know the one giving you negatives.

Edit: I just see a misunderstanding in FiveAces post:
There is only a max of 1 worst enemy for a civ at any given time (it can change).
It's the one at annoyed or below with the lowest attitudeVal (the numeric value with all the hidden modifiers one cannot really know :().

You have an allowance of 10*HasMetCounter before you get 1 negative. Gifts (as e.g. giving in to demands :crazyeye:) count full, trades with 1/3 the value of your side of the trade.

Open borders have nearly no value (total number of cities of both partners), health or happiness resources count 100. It's techs which amount for a lot (1.5 - to nearly 2 times the beaker value depending on how many civs know the tech).

The mechanism for getting fair trade +points is similar. Notable there is that gifts count the same as excess trade value and the divider is 5*HasMetCounter.

This is easy to prove with gold gifts on the turn of discovery:

(1) 5 Gold Gift

Spoiler :






10*(HasMetCounter + 1) = 10*1 = 10 amounts to –1 WE
5*(HasMetCounter + 1) = 5*1 = 5 amounts to +1 FT

If 1G = +2 trade value

5G*2 = 10 = –1 WE
5G*2 = 10 = +2 FT​

(2) 10 Gold Gift

Spoiler :






10*(HasMetCounter + 1) = 10*1 = 10 amounts to –1 WE
5*(HasMetCounter + 1) = 5*1 = 5 amounts to +1 FT

If 1G = 2 trade value

10G*2 = 20 = –2 WE
10G*2 = 20 = +4 FT​

(3)Above Gifts, after 1 turn has passed

Spoiler :




10*(HasMetCounter + 1) = 10*2 = 20 amounts to –1 WE
5*(HasMetCounter + 1) = 5*2 = 10 amounts to +1 FT(FT)

1G = +2 value

5G gift to Genghis

5G*2 = 10 = 0 WE
5G*2 = 10 = +1 FT

10G gift to Gandhi

10G*2 = 20 = –1 WE
10G*2 = 20 = +2 FT​

In an actual game, things might not be so simple, since you are mostly dealing with trades, which are worth 1/3 of a gift in terms of determining diplo, and I don't know if this screws things up. bestsss didn't seem to think so.

The value of a tech is also variable.

And I presume that you took an AI's gold that was rounded to the nearest 5. Perhaps a more exact amount could have been gained by manually adding +/–1G ?
 
Top Bottom