War Weariness?

Cactus Pete

Deity
GOTM Staff
Joined
Feb 2, 2001
Messages
5,288
Location
Tuckasegee, NC
:confused: Does anyone know how war weariness(ww) is calculated? Is there a thread where this has been analyzed and discussed?

In particular, I'm curious about logical consequences -- e.g. if the number of units lost in battle effects ww; if ww occurs more quickly under Representation than under Hereditary Rule; and if more advanced societies (regardless of turns played) are more susceptible to ww.
 
I know it has to do if you are winning or losing (more WW if you are not winning FAST) and based on time (more WW for longer time) and based on number of enemies (more WW if fighting on multiple fronts)

It's true in real life too, though i wish it wasn't in wars that are good... People could be as gung ho about going to war vs Nazi germany, but if they started losing, they would have much more WW, at a time when they need every citizen happy to turn the tide of the war. Same thing w/ Iraqi war... The enemy doesnt have to win, just make us kill ourselves... America has never lost a war to a foreign power, we have always lost because of internal problems.
 
WW happens like this

For each Other Civ you have a number of WW points

Those points go up Every time you kill by/lose a unit to by one of their units OR take/lose a city to/from them... or use nukes I think (the amount might be modified by where the battle is taking place and on who declared the war)

Those points gow down by 1% every turn you are at peace

The unhappiness in your city=
Population of City * WW Points * Factors

The Factors include...
1-are you ate war.. if so *1 if not *0
2-Police State, Rushmore, Jails
3-?not sure about this one? is the War "defensive"..this might figure into the points rather than the unhappiness
4-Is this an "Always War" setup

How long you have been at war has nothing to do with it... if you declare war on someone that you have never had combat with, then there will be no War Weariness from them untill you start combat.
 
Krikkitone said:
How long you have been at war has nothing to do with it... if you declare war on someone that you have never had combat with, then there will be no War Weariness from them untill you start combat.

I'd thought this was supposed to be true, but now I'm not so sure. For example, in one game I attacked and took a long time fighting an opponent, and had +7 WW in my cities. The war ended when I eliminated that civ. Then the next turn I attacked a civ I had never fought before (offensively or defensively) and WW was back up to +6 in my cities on the turn I declared.

You mention that population size matters for WW, but it must have a very slim margin of variance by population since I always seem to have to same WW value in every city. I'll have to look more closely in a game where I have numerous cities with a larger spread in population values.
 
Eqqman said:
You mention that population size matters for WW, but it must have a very slim margin of variance by population since I always seem to have to same WW value in every city.

Not true. WW heavily depends on pop size. A city size 10 or below rarely have more than 3 WW, but a city above 20 will quickly grow to 7 or 10 WW.

I once did a small, informal "research" during a Monarch warmonging game. It was a huge map, 25 cities, so i had plenty of "test cases". Nothing here is definite proof, but heres what i observed:

- WW is very sensitive about pop size, but its not linear. Cities are divided in "groups": from 1-10, 11-15, 16-20, 20+. So, after a few turns of war, cities with pop size 3 will have the same WW as a city size 8. But a city size 10 have a much bigger (almost double) the WW of a city size 9.

- Time is a major factor too, and again, not linear: it starts with 1-2 in your major cities, then it turns to 3-4 after 4-5 turns, then raise to 7-10 after 10 turns. Ive never been in war for more than 10 turns, as 12 WW is enough to kill any economy, jails or no jails.

- Another important factor no one mentioned is if you are the aggressor or not. Being the attacker leads to heavy WW. But if you were not the one declaring the war, WW is almost neglectible (1-3 even after 5 turns)

- Im not sure if killing or losing units has any role in WW. As i only play single player, i usually win all my wars (AI sucks on that, and i only go to war when im sure of winning). But, even conquering several cities and decimating the enemys troops, my WW never goes down. And its rate never slowed down. So i think (but this is a blind guess) that time (# of turns), pop size, and role (who declared war) are the major, and perhaps the only factors.
 
I looked at the SDK and it Seems that is should be keeping track of it by team (each turn putting together all the WW from all the nonbarbarian teams that are alive and that you are at war with.)

So either I'm reading the SDK wrong (Very likely), or there was some type of bug (it might not be a bug if they were on the same team... formed a Permanent Alliance, etc. But then you would probably be at war with them even if there was no combat)

(note: it also is adjusted down for Multiplayer, and for AIs...although I didn't see anything on the defensive War, so that part is probably wrong...unless it shows up somewhere else.)

Well in the XML, there is no 'time term' but there are a bunch of unit/city kill terms.....implying everytime you lose a unit OR kill a unit, it goes Up (winning also makes them unhappy but not as much as losing). (MLions test may be biased by the fact that he was probably killing units/taking cities at a fairly steady pace)

As for the popsize, that is definitely in there, but there maybe a 'rounding up factor' that would make it work

Only Real solution seems like it would be someone who can actually understand exactly what the SDK code means.
 
SDK is really great to bust some myths and biased tests :) Thanks Krikktone!

As for the "side" of war (defensive, agressor), im sure its true... i remind reading it somewhere official (either Manual or Civlopedia, ill check it out and paste here). Also, ive noticed this clearly in my games: whenever i am attacked, WW is almost neglectible. Also, when im attacked, usually i just defend (kill invading forces), and it takes a long time for me to regroup and counter strike to their cities. So wars are much longer (attacker AI will only pay for peace after my counterstrike, and after losing 1-2 cities), and much less rewarding (takes a long till i raze cities). That should lead to bigger WW, but its the opposite: i barely get angry faces when im not the attacker.

But you´re right: if killing units and taking cities is a factor in WW, then my tests are surely biased. I usually attack with massive forces, and take a city every 3-4 turns.
 
I think there is a possibility that the WW Points gained depend on Where the action takes place (ie combat on your territory costs less than on their's for you). However the 'who declared' may be there, in some other part, but I didn't see it.

I also know that the results of combat do matter (there are 4 values
your unit successfully defended
your unit successfully attacked
your unit died defending
your unit died attacking

In the XML somewhere (range from 1-3)
 
1. Who declared war. WW is cut in half if another person declared war on you.
2. Police state (Civic), Jail (Building), and Mount Rushmore (National wonder) can slow WW by 100%. This WILL eliminate the automatic WW you get over time.
3. If you are winning, or losing. If you lose a whole bunch of troops, then WW automatically increases in all cities for that turn. If you lose no troops, but kick the enemy hard, then WW remains unchanged. This WW is seperate from the time WW.
4. If the fighting is in your borders, WW goes up faster if you lose. If it's in a foreign country, it goes up slower if you lose.

At best you can have 100% less TIME WW if you have all the of necessary items, have the overall WW increasements cut in 2 if someone else declares war on you, experience next to no WW if you win all the battles, and fight on foreign soil. This is extremely hard to accomplish though. This is why a 'defensive' war has a lot less WW.

Other factors that are harder to control that affect WW are: Time, population, nationality, and religion.

Time: Over time WW will increase gradually. You can stop this totally by following my advice though.

Population: Larger cities experience much more WW than smaller ones, for obvious reasons. (Balance)

Nationality: If the civilization you are fighting has some of it's nationality in your borders, you'll get extra WW. ("We demand to be returned to our homeland." pops up AFTER you conquer a city during war, and this counts as WW.)

Religion: If the civilization you are fighting has the same religion as your cities, you'll get extra WW. (We will not fight against brothers and sisters of our fate.)

So in summary you can actually stop all linear time WW from happening if you build a jail in every city, build mount rushmore, and adopt police state. BUT if you are LOSING the war, you will still get WW. There's no way to stop the 'losing the war' WW from happening except by winning the war.
 
Are you sure about this.... it wouldn't seem to fit with the SDK/XML... so unless you really know how to read it (I'm sort of guessing) or have done Rigorous tests.
 
Theodorick said:
1. Who declared war. WW is cut in half if another person declared war on you.

This is what i notice from observations too... but would be great if we find an actual quote from Manual, Civlopedia, SKD orother "official" source"

Theodorick said:
2. Police state (Civic), Jail (Building), and Mount Rushmore (National wonder) can slow WW by 100%. This WILL eliminate the automatic WW you get over time.

Eliminate? Completely? This would be huge! But i dont think thats true. Do you have any source to back this up? "100% less time WW" may be different from "no time WW", because game has some weird maths here and there.

Theodorick said:
Nationality: If the civilization you are fighting has some of it's nationality in your borders, you'll get extra WW. ("We demand to be returned to our homeland." pops up AFTER you conquer a city during war, and this counts as WW.)

I wouldnt count this as WW, beucase it happens even when you´re not at war. Any city with a strong foreign cultural pressure will suffer that (specially newly conquered cities that belonged to the AI for a looong time). Not sure if this is aggravated by war, though.

Theodorick said:
Religion: If the civilization you are fighting has the same religion as your cities, you'll get extra WW. (We will not fight against brothers and sisters of our fate.)

Although this only happen in times of war, this is listed separatly in the Hapiness bar... so i wouldnt count it as WW either. Unless we have some proof that Police State, Jails, etc, has any effect on it. Btw... does it increase over time?
.
 
Is WW the same for each city in your empire. For example, lets say I had 2 cities, each settled by me, that are the same size with the same inprovements. Would they have the same WW. Also, I assume that captured cities have WW different than cities that were always yours.
I ask this because every time I go to war it seems that I always one or two problem cities, while other similar cities seem to jump for joy that I am at war.
It does make for interesting gameplay.
 
WW is the same in each city.... but the Unhappiness caused is
1. proportional to population
2. Reduced by Jails in the city

I've heard that the Jail+Rushmore+PState=25% (PState+Rush) X 75% Jails

so they don't eliminate it entirely, but they do help a lot


Also there is no indication of ANY time component to WW, only actions.
 
Civbowl said:
Also, I assume that captured cities have WW different than cities that were always yours. I ask this because every time I go to war it seems that I always one or two problem cities.

Thats because the "We yearn to return to our motherland" factor. Its not WW, because it has its own entry in the unhapiness list, and its present even when at peace. It happens due to strong foreing cultural presence in/around the captured cities. It fades off gradually when you produce culture in those cities. But, in a recently captured city right into the heart of an enemy empire, it can take a LONG time... the only way to completely get rid of this problem is to wipe out the other civilization (or build massive culture and wait a LOT of turns)
 
Krikkitone said:
Also there is no indication of ANY time component to WW, only actions.

Wow, thats surprising, really surprising! Because thats one thing i observate in every war i go into: after 4-5 turns WW becomes a major issue, and after 10 or so turns its usually huge enough for me to stop war.

And, as we discussed earlier, although my tests are surely biased by my gameplay style, usually when i go to war its a sure win... i never lose cities or get pillaged, and i rarely lose troops (except suicide seiges), and i capture cities in a fairly constant rate (a city every 3-4 turns).

So, if only actions were relevant, mine should keep WW really low, but thats not what i see: it grows quite steadly.

I think its time for us to really dig into the SDK. We have way too many guessing (including mine), and very few facts. Thanks Krikktone for bringing some light into this subject!

Is there anyone out there with experience in coding that can show us the formulas about WW ?
 
MestreLion said:
Wow, thats surprising, really surprising! Because thats one thing i observate in every war i go into: after 4-5 turns WW becomes a major issue, and after 10 or so turns its usually huge enough for me to stop war.

And, as we discussed earlier, although my tests are surely biased by my gameplay style, usually when i go to war its a sure win... i never lose cities or get pillaged, and i rarely lose troops (except suicide seiges), and i capture cities in a fairly constant rate (a city every 3-4 turns).

So, if only actions were relevant, mine should keep WW really low, but thats not what i see: it grows quite steadly.

Your strategy would lead to a Rapid rise in WW

You don't get WW for Losing you get it for Winning AND Losing.
(I poked around a Lot more... looks like I am wrong about a time factor, but not what you would think, time actually Decreases WW)

From the XML

WW_UNIT_KILLED_ATTACKING=3 (your unit is killed while attacking)

WW_KILLED_UNIT_DEFENDING=1 (you killed a unit that was defending)

WW_UNIT_KILLED_DEFENDING=2 (your unit was killed while defending)

WW_KILLED_UNIT_ATTACKING=2 (you killed a unit that was attacking)

WW_UNIT_CAPTURED=2 (your unit was captured)

WW_CAPTURED_UNIT=1 (you captured a unit)

WW_CAPTURED_CITY=6 (you captured a city)

WW_HIT_BY_NUKE=3 (you were hit by a nuke)

WW_ATTACKED_WITH_NUKE=12 (you attacked with a Nuke)

WW_DECAY_RATE=-1 (This is the time term, -1)

WW_DECAY_PEACE_PERCENT=99 (if you are at peace apparently 1% of WW leaves each turn)


Things to note... When dealing with units, Winning is better than losing for WW
When dealing with Cities+Nukes, Winning is WORSE than Losing for WW... capturing cities leads to WW, Losing them does not.


BASE_WAR_WEARINESS_MULTIPLIER=5

FORCED_WAR_WAR_WEARINESS_MODIFIER=-50

MULTIPLAYER_WAR_WEARINESS_MODIFIER=-50

The last two seem to be entered into %es... Forced War means the game is in Always War status

Here seems to be one of the places it is added in...this is in the Unit part of the SDK, in a section dealing with combat... I've cut it down a bit

if (pPlot->findHighestCultureTeam() != getTeam())
{
GET_TEAM(getTeam()).changeWarWeariness(pDefender->getTeam(), GC.getDefineINT("WW_UNIT_KILLED_ATTACKING"));
}
if (pPlot->findHighestCultureTeam() != pDefender->getTeam())
{
GET_TEAM(pDefender->getTeam()).changeWarWeariness(getTeam(), GC.getDefineINT("WW_KILLED_UNIT_DEFENDING"));
}

The thing to note is those pPlot->findHighest culture team

Which seem to say that if the combat action takes place on Your soil (where you have the Highest culture) then it doesn't add to War Weariness.

Another section of the SDK
void CvTeam::doWarWeariness()
{
int iI;

for (iI = 0; iI < MAX_TEAMS; iI++)
{
if (getWarWeariness((TeamTypes)iI) > 0)
{
changeWarWeariness(((TeamTypes)iI), GC.getDefineINT("WW_DECAY_RATE"));

if (!(GET_TEAM((TeamTypes)iI).isAlive()) || !isAtWar((TeamTypes)iI))
{
setWarWeariness(((TeamTypes)iI), ((getWarWeariness((TeamTypes)iI) * GC.getDefineINT("WW_DECAY_PEACE_PERCENT")) / 100));


So each turn WW goes down by -1 (the Decay rate) and if you are at Peace an additional 1% is removed

Also it seems that Each Team is stored Seperately for WW purposes (ie When England Does WW it checks its German WW, American WW, Aztec WW, in a Scenario or with PAs, it may also check its Russian-Chinese Alliance WW)


For the Actual Anger (From the City Area)

int CvCity::getWarWearinessPercentAnger()
{
int iAnger;

iAnger = GET_PLAYER(getOwnerINLIN()).getWarWearinessPercentAnger();

iAnger *= max(0, (getWarWearinessModifier() + GET_PLAYERgetOwnerINLINE()).getWarWearinessModifier() + 100));

iAnger /= 100;

return iAnger;
}

So it looks like the Jail (city Modifier) does add to Rushmore and Police State (Player Modifiers)

Elsewhere in the City file


iUnhappiness = ((iAngerPercent * (getPopulation() + iExtra)) / GC.getDefineINT("PERCENT_ANGER_DIVISOR"));

So it is proportional to population.
 
A file in the Player SDK

if (!isBarbarian())
{
for (iI = 0; iI < MAX_CIV_TEAMS; iI++)
{
if (GET_TEAM((TeamTypes)iI).isAlive())
{
if (atWar(((TeamTypes)iI), getTeam()))
{
iNewWarWearinessPercentAnger += GET_TEAM(getTeam()).getWarWeariness((TeamTypes)iI);
}
}
}
}
iNewWarWearinessPercentAnger *= GC.getDefineINY("BASE_WAR_WEARINESS_MULTIPLIER");


So if you are not a Barbarian and at War with a Living Team then you get War Wearienss Anger from the War Weariness
(combat actions with Barbarians don't make any War Weariness)

That War Weariness Anger is then multiplied by the WW factor of 5 and Reduced by the "Forced War" and "Multiplayer" factors if they apply, and Reduced by AI difficulty bonuses.

iNewWarWearinessPercentAnger *= GC.getDefineINT("BASE_WAR_WEARINESS_MULTIPLIER");

if (GC.getGameINLINE().isOption(GAMEOPTION_ALWAYS_WAR) || GC.getGameINLINE().isOption(GAMEOPTION_NO_CHANGING_WAR_PEACE))
{
iNewWarWearinessPercentAnger *= max(0, (GC.getDefineINT("FORCED_WAR_WAR_WEARINESS_MODIFIER") + 100));
iNewWarWearinessPercentAnger /= 100;
}
if (GC.getGameINLINE().isGameMultiPlayer())
{
iNewWarWearinessPercentAnger *= max(0, (GC.getDefineINT("MULTIPLAYER_WAR_WEARINESS_MODIFIER") + 100));
iNewWarWearinessPercentAnger /= 100;
}
iNewWarWearinessPercentAnger *= max(0, (GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getWarWearinessModifier() + 100));
iNewWarWearinessPercentAnger /= 100;

if (!isHuman() && !isBarbarian())
{
iNewWarWearinessPercentAnger *= GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getAIWarWearinessPercent();
iNewWarWearinessPercentAnger /= 100;

iNewWarWearinessPercentAnger *= max(0, ((GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getAIPerEraModifier() * getCurrentEra()) + 100));
iNewWarWearinessPercentAnger /= 100;
}


Who declares war seems to have no effect (in the Declare War section all there is is something saying the WW % Anger should be updated)

So it doesn't matter who declared, it matters how you act, if the War is on your soil=no WW, if the War is off your Soil=WW.

(of course if they declare on you, most of the initial attacks are going to BE on your soil, so you get no WW)



One other thing, the anger divisor is 1000, so with a base WW andger multiplier of 5 and and a typical unit combat costing 2 WW points
General rule:
1% extra unhappiness in your cities per unit combat off of your soil
3% extra unhappiness in your cities per city you take
(we'll ignore nukes for now)

So with 15 unit combats and 3 cities taken, you expect ~24% WW based unhappiness in your cities (unless you have Jails, etc.) That's about 2-3 for a pop of 10 about 5 for a pop of 20.
 
So the "simple" formula seems to be:

WW Unhappiness=Pop x (WW Anger % Modifiers) x World Size Modifier x Active WW/200
Divide by 2 if Multiplayer game, Divide by 2 if Always War or Permanent War/Peace. (AIs also have a Modifier)
(WW Anger % modifiers=Jail, Rushmore+Police State)


Active WW= sum of all WW from all living teams that you are at war with

WW from a team= Starts at 0 and is changed by

1. Combat Actions: only gained where you are not Culturally dominant borders [ie a city that was someone else's for a long time might NOT count as where you are culturally dominant, even if it is within your borders]
Your unit attacks their unit=+3 if you lose +1 if you win
Their Unit attacks your unit =+2 (win or lose)
You capture their unit=+1
They capture Your unit=+2
You capture a city=+6
You launch a nuke=+12 (WW regardless of culture)
You are hit with a Nuke=+3 (WW regardless of culture)

2. Time Actions
Each turn =-1
Each turn at Peace= x 99% (rounded down)
(so if it started at 102, and you were at peace, it would drop to 99)
102-1=101
101*0.99=99.99 (round down)=99
 
Wow, thats an AMAZING research, Krikktone! Surprising results, too! I didnt expect that winning war (killing units and capturing cities) would raise WW ! :)

I think you gathered enough info (and conclusions) for a Strategy Article!
 
Back
Top Bottom