• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Defines.lua actually has a value for AE_DISTANCE_BASE, but it's presently set too low. In my own play I've upped it from 0.75 to 1.2 (while actually increasing the AE at close distances), and found the results a lot better.
 
Defines.lua actually has a value for AE_DISTANCE_BASE, but it's presently set too low. In my own play I've upped it from 0.75 to 1.2 (while actually increasing the AE at close distances), and found the results a lot better.
Isn't that the x0.75 multiplier per distance hop? In that case that would make far away countries get more AE. Did you compare AE generation form an identical peace deal between the 0.75 and 1.2 values? Best do it with a peace deal that generates AE around the world like in OP's case.
 
Sorry, it seems I am a bit late to the conversation but it still seemed like a bit of clarification on the AE calculation could be helpful to some.

The formula presented on the Wiki and then discussed in the video is quite wrong and incomplete, probably an error in reasoning on behalf of the wiki editor just trying to fit
the numbers found in defines.lua on some model function very familiar to him, the exponential function.

For the correct formula the following variables are of importance:

D = The development of the conquered province (this is capped at 30),
AEmod = The aggressive expansion modifier of the conquering country,
P = The conquered province,
SN = The spy network of the conquering country in C in %,
AEDist = The variable AE_DISTANCE_BASE in defines.lua normally set to 0.75,
C = The country which gets the calculated AE relation malus towards the conquering country,
CoBe = This is 1 for a co-belligerent country and 1.5 (resp. ALLY_AE_MULT from defines) if the country is not a co-belligerent,
d(P,C) = The in game distance from the province P to the nearest owned province of the country rounded down to the nearest multiple of 100, divided by 100 and then capped at 4.
For example if the distance is 347 we get 347 -> 300 -> 3 and for 879 we get 879 -> 800 -> 8 -> 4.
RC = This a factor depending on Religion and culture of P resp. C. We always compare the religion of P with the state religion of C and the culture of P with the primary culture of C.
0.5 if Rel(P) and Rel(C) are in a different religious group 0 if Cult(P) is in a different culture group than Cult(C)
We get RCrel = 1 if Rel(P) and Rel(C) are different but in the same religious group and RCcult = 0.25 if Cult(P) is in the same culture group as Cult(C)
1.5 if Rel(P) and Rel(C) are the same and Rel(C) is also the religion of the conquering country 0.5 if Cult(P) is the same as Cult(C)
2 if Rel(P) and Rel(C) are the same and Rel(C) is not the religion of the conquering country
Where Rel() and Cult() denote the obvious. The we get RC = RCrel + RCcult
If both P and C are in the HRE add 0.5 to RC.

Then the AE malus the conquering country gets with C upon conquering P is:

AE = D * (3/4) * (1-AEmod) * (1-SN/1000) * CoBe * RC * ( 1 / ( 1 + AEDist * d(P,C) ) ).

A interesting remark is that a couple of the quantities theorized by looking at the defines do not play a role at all:
(i) There is no continent reduction,
(ii) AE_ATTACKER_DEVELOPMENT and AE_DEFENDER_DEVELOPMENT do not work and only do sth. if set to zero or a value rounded to zero, i.e. < 0.0001,
(iii) It does not matter at all how big the conquering country is, only how close C is to P.

Regarding OP's specific problem here are a couple more remarks:
(i) As observed correctly before the distance function is capped. This leads to for example Egypt not being farther away from Tangiers than Indonesia for the purpose of AE,
(ii) The case where the conquering country is of a different religion than the province is maybe more extreme than intended or has been changed at some point:
There is a value AE_INFIDEL_CONQUEST = 0.25 which should increase AE by 25% in this case. This does not work at all, insted the extra AE from same religion is doubled,
leading to a 50% increase instead,
(iii) As the continent reduction does not work currently it may have been at some point intended to reduce this problem, but does not currently do so.

I hope this clarifies the topic a bit.
Have fun exactly calculating the AE you will get before conquering to min/max even more. :)
 
Last edited:
Thank you very very much for this information!

Can you also tell us how the HRE plays into that formula? Is 0.5 added to RC if the province is in the empire or something like that?

I'm curious how you got that formula. Are you working for Paradox or do you have access to the source code in some way?

SN = The spy network of the conquering country in the country owning P in %,
All the ingame tests that I did about that suggest that it is actually the spynetwork in country C that counts. Maybe it is a bug and the code intends it to be different?
To see whether the spynetwork in the country owning P or in the country C matters, I did the following test just now: I started the game version 1.29.3 as Austria in 1444. Then I did the following(quoted texts are console commands):
  1. "add_claim 65" (claim on München)
  2. On Dec 11, declare war on Bavaria with that claim
  3. On Jab 12, look at a peace deal in which I would annex all of Bavaria(58 dev). This would create 93 AE with Bavaria and 84 AE with many nearby princes(e.g. Augsburg or Brandenburg)
  4. "spynetwork bav 100" add 100 spynetwork in Bavaria
  5. look at the peace deal again. Now this would create 84 AE with Bavaria and still 84 AE with many nearby princes(e.g. Augsburg or Brandenburg)
  6. "spynetwork bra 100" add 100 spynetwork in Brandenburg
  7. look at the peace deal again. Now this would create 74 AE with Brandenburg.
 
I don't find it unreasonable at all that they take such high AE when there's a random colony nearby. They may not care much about the situation in Egypt specifically, but they would notice that Spain is potentially very dangerous. Then they start to worry about exactly why they got themselves a foothold in easy range of their own heartland and decide to team up against them to eliminate what certainly is a credible threat. AE is by and large a measure on how big a threat you are to them, but rather than looking at your military strength it accounts for how you use it.
 
Sorry, it seems I am a bit late to the conversation but it still seemed like a bit of clarification on the AE calculation could be helpful to some.

The formula presented on the Wiki and then discussed in the video is quite wrong and incomplete, probably an error in reasoning on behalf of the wiki editor just trying to fit
the numbers found in defines.lua on some model function very familiar to him, the exponential function.

For the correct formula the following variables are of importance:

D = The development of the conquered province ,
AEmod = The aggressive expansion modifier of the conquering country,
P = The conquered province,
SN = The spy network of the conquering country in the country owning P in %,
AEDist = The variable AE_DISTANCE_BASE in defines.lua normally set to 0.75,
C = The country which gets the calculated AE relation malus towards the conquering country,
CoBe = This is 1 for a co-belligerent country and 1.5 (resp. ALLY_AE_MULT from defines) if the country is not a co-belligerent,
d(P,C) = The in game distance from the province P to the nearest owned province of the country rounded down to the nearest multiple of 100, divided by 100 and then capped at 4.
For example if the distance is 347 we get 347 -> 300 -> 3 and for 879 we get 879 -> 800 -> 8 -> 4.
RC = This a factor depending on Religion and culture of P resp. C. We always compare the religion of P with the state religion of C and the culture of P with the primary culture of C.
0.5 if Rel(P) and Rel(C) are in a different religious group 0 if Cult(P) is in a different culture group than Cult(C)
We get RCrel = 1 if Rel(P) and Rel(C) are different but in the same religious group and RCcult = 0.25 if Cult(P) is in the same culture group as Cult(C)
1.5 if Rel(P) and Rel(C) are the same and Rel(C) is also the religion of the conquering country 0.5 if Cult(P) is the same as Cult(C)
2 if Rel(P) and Rel(C) are the same and Rel(C) is not the religion of the conquering country
Where Rel() and Cult() denote the obvious. The we get RC = RCrel + RCcult

Then the AE malus the conquering country gets with C upon conquering P is:

AE = D * (3/4) * (1-AEmod) * (1-SN/1000) * CoBe * RC * ( 1 / ( 1 + AEDist * d(P,C) ) ).

A interesting remark is that a couple of the quantities theorized by looking at the defines do not play a role at all:
(i) There is no continent reduction,
(ii) AE_ATTACKER_DEVELOPMENT and AE_DEFENDER_DEVELOPMENT do not work and only do sth. if set to zero or a value rounded to zero, i.e. < 0.0001,
(iii) It does not matter at all how big the conquering country is, only how close C is to P.

Regarding OP's specific problem here are a couple more remarks:
(i) As observed correctly before the distance function is capped. This leads to for example Egypt not being farther away from Tangiers than Indonesia for the purpose of AE,
(ii) The case where the conquering country is of a different religion than the province is maybe more extreme than intended or has been changed at some point:
There is a value AE_INFIDEL_CONQUEST = 0.25 which should increase AE by 25% in this case. This does not work at all, insted the extra AE from same religion is doubled,
leading to a 50% increase instead,
(iii) As the continent reduction does not work currently it may have been at some point intended to reduce this problem, but does not currently do so.

I hope this clarifies the topic a bit.
Have fun exactly calculating the AE you will get before conquering to min/max even more. :)

Thank you this is great info.

So those d(P,C) "hops" are indeed capped to only 4 leading to "Egypt not being farther away from Tangiers than Indonesia". This is really big issue because it creates ridiculous worldwide coalitions if you are unlucky to see lots of the world. It also encourages not exploring.

Somebody made this function to cut of nicely at 25% on 4 hops.. its way too much for farther parts of the world. I calculated for more hops. Not sure how far Indonesia is from Egypt.. but probably even 10% of AE is too much - still would be way better to have more hops than 4.

hop - AE reduction
1 0.571428571428571
2 0.4
3 0.307692307692308
4 0.25
----------------------
5 0.210526315789474
6 0.181818181818182
7 0.16
8 0.142857142857143
9 0.129032258064516
10 0.117647058823529

That flat -10AE for other continent we mentioned might be wonky at continent borders. But having flat -10 for distances over >500 or similar is probably sensible.

Also would be nice to fix that same religious AE issue (point "ii") if its bug or not intended.

@Johan , @Groogy could you please look at this, thank you : )
 
(iii) As the continent reduction does not work currently it may have been at some point intended to reduce this problem, but does not currently do so.
It used to work but by 1.16 they decided that world wide coallitions made more sense and therefore removed the AE reduction from different continents. For example in patch 1.13 the continent AE reduction was still a thing; the dudes in SEA could not care less with what happened in West Africa.
 
Thank you very very much for this information!

Can you also tell us how the HRE plays into that formula? Is 0.5 added to RC if the province is in the empire or something like that?

I'm curious how you got that formula. Are you working for Paradox or do you have access to the source code in some way?

All the ingame tests that I did about that suggest that it is actually the spynetwork in country C that counts. Maybe it is a bug and the code intends it to be different?
To see whether the spynetwork in the country owning P or in the country C matters, I did the following test just now: I started the game version 1.29.3 as Austria in 1444. Then I did the following(quoted texts are console commands):
  1. "add_claim 65" (claim on München)
  2. On Dec 11, declare war on Bavaria with that claim
  3. On Jab 12, look at a peace deal in which I would annex all of Bavaria(58 dev). This would create 93 AE with Bavaria and 84 AE with many nearby princes(e.g. Augsburg or Brandenburg)
  4. "spynetwork bav 100" add 100 spynetwork in Bavaria
  5. look at the peace deal again. Now this would create 84 AE with Bavaria and still 84 AE with many nearby princes(e.g. Augsburg or Brandenburg)
  6. "spynetwork bra 100" add 100 spynetwork in Brandenburg
  7. look at the peace deal again. Now this would create 74 AE with Brandenburg.

Yes thank you the relevant spy network is indeed the one in C and for the HRE you just have to add 0.5 if P and C are both in the HRE.
The province dev used for the calculation is also capped at 30 and furthermore D*CoBe*(3/4) is capped at 50 which is obviously irrelevant but still.
I edited this in the original post, such oversights tend to happen if you post in a forum without math formatting.

I don't find it unreasonable at all that they take such high AE when there's a random colony nearby. They may not care much about the situation in Egypt specifically, but they would notice that Spain is potentially very dangerous. Then they start to worry about exactly why they got themselves a foothold in easy range of their own heartland and decide to team up against them to eliminate what certainly is a credible threat. AE is by and large a measure on how big a threat you are to them, but rather than looking at your military strength it accounts for how you use it.

I think you got something wrong in the example. The Indonesian nations do not get this much AE because Spain has a colony near them, this is in fact completely irrelevant for the calculation. They get this much AE as they get a lot of positive modifiers ( same religion + infidel conquest ) and the impact of distance is quite limited, i.e. they do not get less AE as say Morocco would, if they still existed, despite being much farther away. Refer to the formula for details.

Now whether this is unreasonable is obviously debatable. From a historical and a gameplay perspective. But I think there has been sufficient argumentation why some of the people do not like this from a gameplay perspective. ( just read through the thread keyword: Grand sunni coalition)

Regarding the continent reduction, I personally find it rather arbitrary as it leads to weird behavior at continent borders especially in Egypt at the Africa, Asia, Europe border.
If this has been removed at some point it would be worth considering to replace its effect somehow.

Whether something works as intended is very hard to see from the values in the defines as there is a lot of legacy code left in there.
For example the defines for the trade system of EU3.
 
I think you got something wrong in the example. The Indonesian nations do not get this much AE because Spain has a colony near them, this is in fact completely irrelevant for the calculation. They get this much AE as they get a lot of positive modifiers ( same religion + infidel conquest ) and the impact of distance is quite limited, i.e. they do not get less AE as say Morocco would, if they still existed, despite being much farther away. Refer to the formula for details.

Thanks for clarification. this is really important. So to reduce AE:
* Do not reveal nations at all - don't explore if you are going to conquer (i tend to do this mistake..). So thats zero AE with unkown guys obviously. If you have revealed nations damage is done already. Unfortunately we can't really control automatic fog reveal or starting position visibility - thats 50 years i think to spread visibility from same tech group you are in* I really don't like how this works.
* AE is calculated from provinces taken - so taking farther provinces can delay issues a bit - if P's go into another hop category. I tried this two days ago, it matters even in India for example which part of Orissa you are taking in peace deal - ie. taking farther land does not involve Viyanagar into coalition... closer does.

But I think there has been sufficient argumentation why some of the people do not like this from a gameplay perspective. ( just read through the thread keyword: Grand sunni coalition)
Yup its awful for gameplay, there's no way its good or even indifferent. Realism is really no argument - if we go down that route everything falls apart.

Regarding the continent reduction, I personally find it rather arbitrary as it leads to weird behavior at continent borders especially in Egypt at the Africa, Asia, Europe border.
If this has been removed at some point it would be worth considering to replace its effect somehow.

That flat -10AE for other continent we mentioned might be wonky at continent borders. But having flat -10 for distances over >500 or similar is probably sensible. That would work.
 
@Groogy Could you comment on AE being:

- capped after a really small distance,
- unmodified by different continents?

Both of these things are currently wrongly implemented, flat out. If the corresponding AE is deemed to small (… I don't think it would, but whatever), there's always room to tinker with other values, but having no distance decay and no continent modifier at all looks very bullshit to me.
 
This has been really bothering me lately. Can something be done about AE propagation on distance? Here nations like Sulu, Perak, Siak and Mallaca will for world coalition because they really hate situation in Egypt. They should not even know or care about the area -_-. I colonized there - Mamluks don't even have Exploration.
View attachment 531426


I've suggested in the past the game have "regional coalitions" so that situations like this wouldn't happen. I just played Spain myself and I thought it was silly that the Central Americans were threatening to coalition me as I was taking land in Europe
 
Ottomans started a coalition in my current game because I took a bunch of stuff in Malacca. Their closest territory was Egypt. Historically Ottomans said exactly zero about British and Dutch expansion into what is today Indonesia.

There were never really "globe spanning coalitions" of the type that form in EU4. The biggest coalition in the period was the one against Napoleon, didn't meaningfully extend outside of Europe - America gave exactly zero shits that the French were raping and pillaging their protestant brothers in Germany and elsewhere.

I understand why its in the game - WC would be a lot easier if not for the whole globalist alliance thing - but its insanely unhistorical...but with communication between continents taking months during this era...its not really even plausible.
 
Its not that its that much harder with worldwide coalitions its just annoying, looks very stupid and promotes special more gamey playstyle and exploiting. You'll speed 5 more and wait for absolutism for reduced AE. This waiting also gives you time to fill up ideas to prepare. And you will not conquer Sunni's too early but some weaker group like Hindu or Buddhist.
Then a bit later if i am conquering SEA region, usually Mallaca and Pasai they are big and rich, and Mali and Jolof from West Africa or Mamluks join coalition they won't do crap.. Everyone mostly care about ottomans anyway. It just artificially slow down player until you can have like 100k+ units with good quality to ping-pong ottomans when they come close - all others get stackwiped quickly anyway.

Even ddrjake in his last Prome game just exploited allies and tributaries and gave them up to game coalition. Next time i play i won't explore anything lel except few guys next on kill list -_- whats one more exploit.. right. I already have to play around the system to avoid corruption.

I'd rather have higher local AE (like in very hard - its doable) and reduced far AE propagation than this what we have now.
 
@Tempscire do you know if allies and subjects get less AE and how exactly the amount is calculated in these cases?

Allies take about 1/3rd AE from memory. It can become a factor if you're going ham

Vassals take trivial AE that I never recall being a factor.

Client states colonial Nations, and personal unions to my knowledge do not take aggressive expansion at all
 
Last edited: