Hey Civvers!
I have a question on the unhappiness statement in this post's title.
I just got DOW by Japan and Sumeria. In going through my cities, two of them which are close to Sumeria have unhappiness all of a sudden for that reason. Neither city ever belonged to Sumeria or any other AI.
So would anybody know why I'm getting this unhappiness reason?
Motherland Anger is governed by an obscure math formula shown by
DanF5771.
Note the code is long enough to have a scroll bar to view all of it.
While diggin' I found this:
Code:
int CvCity::getCulturePercentAnger() const
{
int iTotalCulture;
int iAngryCulture;
int iCulture;
int iI;
iTotalCulture = plot()->countTotalCulture();
if (iTotalCulture == 0)
{
return 0;
}
iAngryCulture = 0;
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
{
if (GET_PLAYER((PlayerTypes)iI).getTeam() != getTeam())
{
iCulture = plot()->getCulture((PlayerTypes)iI);
if (iCulture > 0)
{
if ([B][COLOR="Red"]atWar[/COLOR][/B](GET_PLAYER((PlayerTypes)iI).getTeam(), getTeam()))
{
iCulture *= std::max(0, (GC.getDefineINT("AT_WAR_CULTURE_ANGER_MODIFIER") + 100));
iCulture /= 100;
}
iAngryCulture += iCulture;
}
}
}
}
return ((GC.getDefineINT("CULTURE_PERCENT_ANGER") * iAngryCulture) / iTotalCulture);
}
which is called in
int CvCity::unhappyLevel(int iExtra) const
with GlobalDefines.xml values
AT_WAR_CULTURE_ANGER_MODIFIER = 50
CULTURE_PERCENT_ANGER = 400
PERCENT_ANGER_DIVISOR = 1000 (in CvCity::unhappyLevel)
this should give something like MotherlandUnhappy = 0.4 * 1.5*Sum(EnemyCulture)/TotalCulture * CityPopulation
Example: Size 17 city with 50% EnemyCulture
MotherlandUnhappy = 0.4 * 1.5 * 0.5 * 17 = 5
I don't know what's up with the iExtra.
Motherland Anger = Floor (0.4 * 1.5 * Enemy Culture in your city tile * City Population)
So if you have a 7 population city, the enemy owns 27% of the plot culture in your city tile, and you are at war with them, the motherland anger is Floor(0.4*1.5*0.27*7) = Floor(1.134) = 1

Same calculation, but you are
NOT at war with the AI, then you use 1 instead of 1.5
Motherland anger is Floor(0.4*1*0.27*7) = Floor(0.756) =0 or no motherland anger.
Yes, only the culture from the civilizations you are at war with is multiplied by 1.5, when at peace *1.
What I've seen so far is that Doubles (2.208) are always truncated to the (lower) Integer (2).
Your example for size 8 city with 92% culture (peace):
MotherlandUnhappy = 0.4 * 1 * 0.92 * 8 = 2.944 --> 2
Best way to get rid of motherland anger is to kill off the enemy civ completely.
That is the only way to permanently get rid of AI plot culture.
Next best way is build a lot of culture buildings and wait a long time so the city is 90% player and 10% AI.
As long as there is no war, then motherland anger is 0 until the city reach Population 25.
Also of note, once and a while a barb city will leave behind plot culture and you get a city that is 90% barbarian / 10% player and has a lot of motherland anger.

Size 7 city (99% barb culture) has 4 motherland anger, and war with barbs is permanent.
How to get rid of barbarian motherland anger?
The answer is, you can't get rid of it!
Barb plot culture sticks around the entire game, even if you destroy every barb city, and every civ techs far enough past Renaissance that the
barbs stop spawning, hahahaha