*(Revised on August 14th, 2022, with input from Alexeyev_)*

In this post, I'll lay out my plans for the revolution component in MNAI-U and EMM. This is the only area where I'll make substantial balance changes, and I welcome everybody's feedback on my suggestions. Since the whole post is very long, I put some things in spoilers that might be less interesting for some.

I plan to roughly proceed in the following order:

**Improved UI.**The most important aspect of this is to be more transparent about the various stability modifiers. I consider this not only an improvement by itself, but it will also make it much easier to provide well-founded feedback. This is mostly done as of version MNAI 2.9u, except the following:- Replace the old RevWatchAdvisor by a shortcut to the new "Revolution" page of the Customizable Domestic Advisor
- Improve the city screen revolution bar and its tooltip
- Use an "Instability" icon in place of the various occurrences of "stability" and "instability" in the game text.

**Balance/Improve stability.**This is about*when*a revolution occurs, and how you can prevent revolutions. I already made several small simplifications and improvements in version 2.9u. More on this below.**Balance/Improve revolutions.**This is about*what*a revolution is. Currently, there are peaceful revolutions that simply consist of demands to e.g. change a civic or join some other civilizations, and violent revolutions that spawn units. I don't really know how all of this works currently, so I'll go through it and see if there are any improvements to be made. This includes e.g. balancing the number of units in a revolution.**Additional flavor.**The revolution system as a whole still doesn't feel very FfH-y yet, and I think there is a lot of potential for variation depending on civilization and religion. Areas of possible changes include:- Types of demands by peaceful revolutionaries
- Types of units spawning (depending on the type of revolution; e.g. nationality-based or religion-based)
- Civilization of a newly spawned revolutionary player (probably usually the same as the mother civ or a previous owner)
- Revolutionary leaders (maybe depending on the type of revolution; also, when the pool of leaders is depleted, maybe generate a random name and use a generic portrait)
- All kinds of messages; generic messages could be made more fitting to the setting, and special messages depending on the type of revolution could be added.

**Spoiler**

*General guidelines*:

- Simplicity. It should be easy to understand what is going on in your cities, and what you can do about it. UI is huge factor here, of course, but this also means that there is an upper bound on the complexity of stability calculations.
- Variation. There should be different strategies to deal with revolutions, each with their own strengths and weaknesses. For example, I'll rather have civics push into a general direction instead of providing flat boni or penalties.
- Noticeable gameplay impact. This mostly concerns expansion. I think it is important to note that a game with revolutions is
*intended*to work differently than a game without; it's not simply an extra annoyance you'll have to deal with. Instead, it fundamentally changes your ability to expand; rushing through your enemies with an über-stack while also keeping their cities should not be viable most of the time. - Additive modifiers. In civ, almost all modifiers are added up, i.e. +10% and +10% means +20% instead of +21% (the latter corresponds to 1.10 times 1.10). This makes designing negative modifiers harder, since we have to take care when it is possible reach -100%, but I think it is worth the consistency and clarity.

**Spoiler**

*Local vs. national (in)stability*:

There are currently two ways of providing (in)stability for e.g. civics and buildings. A local (in)stability effect applies to a single city and is accumulated every turn. If this accumulated value raises above some threshold, a revolution happens. National stability effects do two things: First, it is added every turn to

You may have noticed that now a civic having "+1 local instability in every city per turn, +1 national instability per turn" doesn't make much sense; that's just +2 instability in every city every turn. There are a few instances in the code where the current (in)stability per turn in a city is used, and this does not use the national (in)stability effects. But I'm pretty sure the omission of national stability effects is not significant in any way. Thus, barring any surprises when checking the code more carefully, I plan to remove the distinction between local and national stability.

*each*city, just like local (in)stability. Second, it also accumulates, for your whole empire instead of a single city. However, as far as I can see, this accumulated value is not used anywhere except in the stability graph of the demographics screen.You may have noticed that now a civic having "+1 local instability in every city per turn, +1 national instability per turn" doesn't make much sense; that's just +2 instability in every city every turn. There are a few instances in the code where the current (in)stability per turn in a city is used, and this does not use the national (in)stability effects. But I'm pretty sure the omission of national stability effects is not significant in any way. Thus, barring any surprises when checking the code more carefully, I plan to remove the distinction between local and national stability.

**Proposed concrete effects**

Below I describe (to a varying degree of detail) how the various modifiers currently (MNAI v2.9u) work, and how I plan to change them. Civic and building effects are at the end; some of those are mostly based on flavor and are definitely subject to balance changes.

**Happiness**

**Spoiler**

*How it currently works*:

- If the city is unhappy (ignoring unhappiness from war weariness), then the base instability per turn is
`15 * (excess unhappiness)^0.8`

.

Then, several modifiers apply; -30% if the city was recently acquired (within 12 turns, gamespeed-adjusted), -30% from unhappy production (Governor's Manor and Pillar of Chains), and a more complicated bonus if the population is larger than the excess unhappiness:`(excess unhappiness) / population * 100 - 100`

. In the latter equation, the population is capped at 12. Instability from unhappiness is theoretically unlimited. - If the city is happy: First, excess happiness is capped by 10 or the population, whatever is lower. Then, the formula is
`(1.2 + (excess happiness) / pop) * (excess happiness)^0.6`

. If the owner of the city is a rebel and at war with the cultural owner of the city, a -50% malus applies.

Stability from happiness is therefore no more than`2.2 * 10^0.6 ~= 9`

.

- War weariness is still ignored for excess unhappiness, but counted for excess happiness.
- Base instability from unhappiness is simply
`100 * (excess unhappiness)/pop`

, capped at`100`

or`10*pop`

, whatever is lower. - Base stability from happiness is
`10 * (excess happiness)/pop`

, capped at`10`

. - -30% directly after acquiring. This decays by 2pp/turn, to 0% after 15 turns.
- -50% effect from unhappiness
*and*happiness from unhappy production buildings. - Further civic effects (see below)

*Rationale:*This is mostly a simplification. Unhappiness is capped by pop to ensure small cities don't go too crazy. Note that growing the population can never improve things on its own. The unhappy production effect is now neatly symmetric.

**Distance**

**Spoiler**

*How it currently works*:

It's a mess. First, a "communications bonus" is computed.

Then the effective distance is modified by civics and buildings. Then it is multiplied by a factor between 0.5 and 2 depending on civ size. This final value (rounded) is the base location effect.

Finally, if the city is not connected to the capital, there is an additional flat 3 instability for rebels, or

- Base communication is 0
- Each trade route but the first gives +17
- If the city is connected to the capital: +50, then +17 if engineering is researched, then add the city's trade route modifier, add the culture rate modifier, and add half of the gold rate modifier
- Coastal cities get +25 with the coastal trading tech (Fishing) or +50 with the ocean trading tech (Sailing)
- The city's maintenance modifier is subtracted
- +100 per airlift capacity (+100 from Obsidian gate)
- The bonus cannot be negative

*euclidean*city distance to the capital or nearest Summer/Winter palace. The formula for the effective distance is:
Code:

` 307 * (city distance) / (map diameter) / ( 1 + (comm. bonus) / 100 ) ) - 666 / (map diameter)`

Finally, if the city is not connected to the capital, there is an additional flat 3 instability for rebels, or

`5 + era + pop/3`

, capped at 10, for normal civs.
**Proposed:**First take the

*step*distance (not euclidean distance) to the shortest government center (capital or Summer/Winter palace), or the farthest city if there is no government center. This value is modified by the DistanceMaintenancePercent of the map size, divided by the maximum plot distance (diameter for flat maps). This value, between 0 and 1, is the adjusted distance.

Base distance instability is

`135 * (adjusted distance) * (0.7 + 0.1*population)`

.- +100% if not connected to the capital
- -50% if airlift is possible (Obsidian gate)
- Various civic modifiers
- Instability is capped at 100

**Spoiler**

*Rationale and further ideas*:

- The new formula is based on the base distance maintenance of the city (see CvCity::calculateDistanceMaintenanceTimes100())
- The constants I chose try to model the typical current values, which go up to roughly 200 instability for cities in opposite corners of the map with average communication.
- The communications bonus is weird and too complicated; it seems to be an attempt at modeling more efficient connections, without computing it in any concrete way.
- The flat
`666/diameter`

bonus is also weird, it basically subtracts 3 from the distance (assuming communication of roughly 67). Thus, it's actually very dependent on the map size. - The use of euclidean distance is arbitrary and doesn't fit in with other game mechanics.
- The empire size effect has been outsourced.

**Religion**

**Spoiler**

*How it currently works*:

The effects are split into good and bad effects, each with a base (in)stability and some possibly modifiers.

- State religion in city:
- Base stability: 4
- Holy city: +5 base stability
- Civic boni if we own the holy city (doubled if this is the holy city):
- Theocracy: +4
- Religion: +2
- Sacrifice the Weak: +5

- +50% if at war with at least 2 other players
- +50% from Theocracy
- +20% from Religion, Sacrifice the Weak, Crusade

- Non-state religions in city, if we have a state religion:
- +2.5 base instability from the first two non-state religions, +1 for each further non-state religion.
- If heathens own the holy city: +4 from Theocracy, +1 from Religion
- +4 if non-state-religion holy city
- +50% from Theocracy

**Proposed:**Split up effects further and add some flavor.

- State religion in city:
- Base stability: 4 for non-holy, 8 for holy city
- +50% from war against one more heathen players

- Various civic modifiers
- Stability if we own the holy city: +4 from Theocracy
- Non-state religions in city:
- Base instability mostly depends on state religion vs. present religions (penalties are additive):
- Order vs. Veil: +5
- Order vs. CoE/OO: +3
- RoK/Emp vs. Veil: +3
- RoK/Emp vs. CoE/OO: +2
- All other combinations, including no state religion vs. something: +1
- Non-styte Order and non-state Veil in city: +1
- Double effect for holy cities (e.g. Veil holy city +10 for Order player).

- Various civic modifiers

- Base instability mostly depends on state religion vs. present religions (penalties are additive):
- Instability if heathens own the state holy city: +4 from Theocracy

*Further ideas:*

- Possibly remove all boni and penalties caused by CoE as state religion
- Maybe treat CoE as neutral religion

**Culture rate**

**Spoiler**

*How it currently works*:

Take the culture rate (i.e., culture per turn), and modify it as follows, depending on era:

- Ancient: -33%
- Classical: -50%
- Medieval: -60%

Base stability is this modified rate to the power of 0.7, capped at 10. The cap is attained at a modified culture rate of 25.

If the player is at war with the majority culture in the city, the base stability is halved.

**Proposed:**Remove the era modifier and the "war with majority culture" modifier, and take the culture rate to the power of 0.6. This puts the effect somewhere between the previous ancient-era and classical-era effects. Maximum value of 10 is attained at culture rate 42.

*Further ideas:*Maybe buff this? Culture is rarely worth it otherwise. Might have to check what culture rates are typically attained.

**Nationality**

**Spoiler**

*How it currently works*:

If more than 60% own nationality: Base stability is

If more than 40% foreign nationality: Base instability is

`(ownPercent-60)/8`

, to a maximum of 5.If more than 40% foreign nationality: Base instability is

`(foreignPercent-40)^2 / 200`

. Cap is 13, which is attained at 91% foreign nationality. The current culture rate is subtracted from this, but cannot remove more than 90% of it (this doesn't mean much due to rounding).- If the city is recently acquired, -40% effect, and capped at 6.
- If we are at war with the majority culture, and we're not a rebel, +50% effect.
- If the majority culture is our vassal, -30% effect, and capped at 5.
- City states: +50% effect
- Liberty, Decentralization: +20% effect
- Republic, Military state: -20% effect

**Proposed:**The base formula is now

`foreignPercent^2 / 500 - 3`

instability, meaning 3 stability at up to 20% foreign culture, 2 at 30%, 1 at 35%, 0 at 40%, and going up to 17 *in*stability at 100%. However, the following modifiers apply when calculating "foreign culture", depending on the foreign player:

- -30% if the player is your vassal
- -50% if the player is the same civ as you, and you're not at war with them

**Unhealthiness**

*How it currently works:*First compute excess unhealthiness, where temporary unhealthiness only counts half. Base instability is

`2 * (excess unhealthiness)^0.6`

. Rebels get -67%. Instability from unhealthiness is theoretically unbounded.**Proposed:**Scale linearly: +1 instability per excess unhealthiness (temporary counts half), with a cap of 10. This is roughly lower than before in the range of 1-5 and above 15 unhealthiness, and higher between 6 and 14.

**Starvation**

*Current and proposed:*+100 instability when starving (i.e., +100 instability whenever a population point is lost).

**Garrison**

*How it currently works:*Base stability is

`2 * (# defenders / 2)^0.6`

, which is roughly `1.3 * (# defenders)^0.6`

. If the city has X% defense from buildings, the base stability is increased by X% (up to 100%). Final stability is capped by 8.Maximum stability is attained with 19 defenders at 0% defense, and with 6 defenders at 100% defense.

**Proposed:**Simply +1 stability per military unit, capped at 10. Each 5 population points reduce stability by 1 (but not below 0; i.e., in a 20-pop city, you need 5 defenders for +1 stability, but only 1 defender does not cause instability).

The building and civic modifiers apply.

*Rationale:*Linear scaling is nicer, and requiring more units for larger cities is intuitive and in line general balancing goals. It is not clear how walls are keeping the peace in the city, so it makes more sense to tie the percentage bonus to specific buildings.

**City Size**

*How it currently works:*Take the city size and subtract -3 in ancient, -4 in classical, and -5 in medieval era. If the result is positive, that's the instability per turn.

**Proposed:**Completely scrap this. City size has an effect on other modifiers.

**Empire Size**

*How it currently works:*The size of an empire is defined as the number of cities in the empire divided by the "target" number of cities from the world size (4 for Duel, 8 for Huge).

- Size > 2.0: +4 instability
- Size > 1.6: +3 instability
- Size > 1.4: +2 instability
- Size > 1.2: +1 instability
- Size > 1.0: +0 instability
- Size > 0.7: -1 instability
- Size <= 0.7: -2 instability

**Proposed:**As before, just that settlements only count 25%.

**Disorder**

*How it currently works:*If the city is in disorder, instability per turn is

- 75 normally
- 11 (15%) for recently acquired cities (12 turns at normal game speed) and rebel players
- 15 (20%) if a revolution occurred already in this city.

**Proposed:**If the city is in disorder, instability per turn is

- 75 normally
- If acquired within the last 15 turns, it's
`5*(turns since acquired)`

instead - -90% for rebel players
- -80% if a revolution occurred already in this city.

*Rationale:*Smoother effect for conquered cities to make it more intuitive; scrap game speed adjustments, since revolt turns are not affected by game speed either.

**Crime**

*How it currently works:*The formula is

`(crime - 20) / 10`

, where crime above 100 is not counted. This means crime below 0 gives a positive effect.**Proposed:**No changes.

**Culture spending**

*How it currently works:*Base stability is the square root of the culture slider value (0 for 0%, 10 for 100%). Creative leaders get a +70% bonus.

**Proposed:**Scrap this. It seems like a minor effect and the culture slider already affects stability from culture rate in a more intuitive way.

**Golden age**

*How it currently works:*-20 instability if in a golden age.

**Proposed:**No changes.

**Handicap**

*How it currently works:*Revolutions are not affected by Handicap.

**Proposed:**-45% instability at settler, -30% at chieftain, -15% at warlord, and no changes from noble onwards

**Civic effects**

*Proposed:*Entering anarchy now always gives a +50 one-time instability penalty in each city.

**Spoiler**

*Specific civics*:

**Despotism***Current:*+4 instability per turn, +25% from distance, +100 instability when adopting*Proposed:*+10% instability from distance

**City States***Current:*+1 instability per turn, +10% from distance, +50% from foreign nationality, -50 instability when adopting*Proposed:*+1 instability per turn, -50% from distance, +50% from nationality

**God King***Current:*+2 instability per turn, +20% from distance, -50 instability when adopting*Proposed:*+25% from distance

**Aristocracy***Current:*+5 instability per turn*Proposed:*+5 instability per turn, -25% from distance

**Theocracy***Current:*-4 instability per turn if owning state religion holy city, +4 instability per turn if heathens own holy city, +50% effects from religions, +50 instability when adopting*Proposed:*-4 instability per turn if owning state religion holy city, +4 instability per turn if heathens own holy city, +50% effects from religions

**Republic***Current:*-4 instability per turn, -20% from distance, -30 instability when adopting*Proposed:*-4 instability per turn, +25% from distance.

**Religion***Current:*-2 instability per turn if owning holy city, +1 instability per turn if heathens own holy city, +20% bonus from state religion*Proposed:*+25% positive effects from religions

**Pacifism***Current:*-2 instability per turn, -20 instability when adopting*Proposed:*-5 instability per turn, -50% stability from garrison, -50% maximum stability (cap) from garrison

**Nationhood***Current:*-1 instability per turn, -20 instability when adopting*Proposed:*-1 instability per turn, +25% from nationality

**Sacrifice the weak***Current:*+3 instability per turn, +20% from distance, -5 instability if owning Veil holy city, +20% stability from state religion, +200 instability when adopting*Proposed:*Extra +150 Stability from adopting, +20% effects from religions, -25% effects from happiness/unhappiness, +25% stability from garrison, +5 maximum stability (cap) from garrison, +2 instability per turn*Rationale:*The instability is meant to be countered by garrison effects. So you get more out of a big garrison, but are also punished more by a small garrison.

**Social Order***Current:*+100 instability when adopting*Proposed:*+25% effects from happiness/unhappiness, +2 maximum stability from happiness, +1 instability per turn*Rationale:*Recall that this civic gives +1 happiness per garrisoned unit. Similar to Sacrifice the weak, this amplifies garrison effects.

**Consumption***Current:*No effect*Proposed:*+25% effects from happiness/unhappiness

**Scholarship***Current:*No effect*Proposed:*No effect

**Liberty***Current:*-2 instability per turn, +20% penalty from foreign nationality, -50 instability when adopting*Proposed:*+50% from culture rate, +5 maximum stability (cap) from culture rate

**Crusade***Current:*-3 instability per turn, +20% bonus from state religion, +50 instability when adopting*Proposed:*-3 instability per turn, +20% bonus from state religion, +25% bonus from garrison

**Tribalism***Current:*+10% instability from distance*Proposed:*+10% instability from distance

**Apprenticeship***Current:*No effect*Proposed:*No effect

**Slavery***Current:*+4 instability per turn, +50 instability when adopting*Proposed:*+2 instability per turn, +2 maximum stability from garrison

**Arete***Current:*-2 instability per turn, -25% instability from distance*Proposed:*+25% stability from state religion

**Military State***Current:*-20% instability from nationality*Proposed:*-25% instability from nationality, +25% stability from garrison, +2 maximum stability from garrison, +2 instability per turn

**Caste System***Current:*+4 instability per turn, +20 instability when adopting*Proposed:*No effect

**Guilds***Current:*+2 instability per turn*Proposed:*No effect

**Decentralization***Current:*+5 instability per turn, +20% instability from distance, +20% instability from nationality, +40 instability when adopting*Proposed:*No effect

**Agrarianism***Current:*No effect*Proposed:*No effect

**Conquest***Current:*+1 instability per turn*Proposed:*+1 instability per turn, -10% instability from nationality

**Mercantilism***Current:*No effect*Proposed:*No effect

**Foreign Trade***Current:*-20 instability when adopting*Proposed:*No effect

**Guardian of nature***Current:*-2 instability per turn*Proposed:*+25% stability from state religion

**No Membership***Current:*No effect*Proposed:*No effect

**Overcouncil***Current:*No effect*Proposed:*+25% stability from happiness

**Undercouncil***Current:*No effect*Proposed:*-25% instability from crime

**Buildings**

**Spoiler**

*Buildings*:

**Archery Range***Current:*-1 instability/turn*Proposed:*+25% stability from garrison

**Asylum***Current and proposed:*-2 instability/turn

**Basilica***Current:*No effect*Proposed:*+50% stability from garrison

**Adventurers' Guild***Current:*No effect*Proposed:*-25% instability from distance

**Breeding Pit***Current:*No effect*Proposed:*-25% effect from happiness/unhappiness

**Chancel of Guardians***Current and proposed:*-1 instability/turn

**Citadel of Light***Current:*No effect*Proposed:*-1 instability/turn

**Command Post***Current:*No effect*Proposed:*+25% stability from garrison

**Courthouse**,**Governor's Manor***Current and proposed:*-1 instability/turn, -10% instability from distance

**Dungeon***Current:*-1 instability/turn, -10% instability from distance*Proposed:*-1 instability/turn

**Elder Council***Current and proposed:*-1 instability/turn

**Market***Current:*-1 instability/turn*Proposed:*No effect

**Monument***Current:*-1 instability/turn*Proposed:*No effect (but note the culture rate effect)

**Pagan Temple**,**Desert Shrine**,**Temple of the Hand***Current:*No effect*Proposed:*-1 instability/turn

**Smugglers' Port***Current:*+1 instability/turn, +5% distance instability*Proposed:*+1 instability/turn

**Temple of ...***Current:*No effect*Proposed:*-1 instability

**Training Yard**,**Arena**,**Sculptor's Studio***Current:*No effect*Proposed:*+25% stability from garrison

**Spoiler**

*Wonders*:

**Altar of the Luonnotar***Current:*No effect*Proposed:*-1 instability/turn

**Altar of the Luonnotar (anointed)***Current:*No effect*Proposed:*-2 instability/turn

**Altar of the Luonnotar (blessed)***Current:*No effect*Proposed:*-2 instability/turn, -1 instability/turn in all cities

**Altar of the Luonnotar (consecrated)***Current:*No effect*Proposed:*-3 instability/turn, -1 instability/turn in all cities

**Altar of the Luonnotar (divine)***Current:*No effect*Proposed:*-4 instability/turn, -2 instability/turn in all cities

**Altar of the Luonnotar (exalted)***Current:*No effect*Proposed:*-8 instability/turn, -2 instability/turn in all cities

**Altar of the Luonnotar (final)***Current:*No effect*Proposed:*-10 instability/turn in all cities

**Bazaar of Mammon***Current:*No effect*Proposed:*-25% effect from crime in all cities

**Bone Palace***Current:*No effect*Proposed:*-1 instability/turn in all cities

**Deruptus Brewing House***Current:*No effect*Proposed:*+10% effect from happiness/unhappiness

**Code of Junil***Current:*No effect*Proposed:*-50% instability from disorder in all cities

**Dies Diei***Current:*No effect*Proposed:*-5 instability/turn

**The Eyes and Ears Network***Current:*No effect*Proposed:*-1 instability/turn in all cities

**Summer Palace**,**Winter Palace***Current:*-2 instability/turn, -20% instability from distance*Proposed:*No effect (already reduces distance instability in nearby cities)

**Heron Throne***Current:*No effect*Proposed:*No effect

**Heroic Epic***Current:*No effect*Proposed:*-3 instability/turn

**National Epic***Current:*No effect*Proposed:*-3 instability/turn

**Nox Noctis***Current:*No effect*Proposed:*-100% effect from crime

**Palace (and replacements)***Current and proposed:*-5 instability/turn, -2 instability/turn in all cities

**Shrine of the Champion***Current:*No effect*Proposed:*-3 instability/turn

**Song of Autumn***Current:*No effect*Proposed:*+25% stability from culture rate in all cities

**Stigmata on the Unborn***Current:*No effect*Proposed:*+2 maximum stability from garrison in all cities

**Tablets of Bambur***Current:*No effect*Proposed:*-1 instability in all cities

**The Necronomicon***Current:*No effect*Proposed:*-25% effect from happiness/unhappiness in all cities

**Tower of Complacency***Current:*-10 instability/turn, -1 instability/turn in all cities, -50% instability from distance*Proposed:*No effect (note the excess happiness bonus)

**Spoiler**

*Special buildings*:

**Academy***Current:*-3 instability/turn*Proposed:*-2 instability/turn

**Hope***Current:*No effect*Proposed:*-1 instability/turn

**Unyielding Order***Current and proposed:*-4 instability/turn, -20% instability from distance

**Misc. effects**

*Current:*

- Infernals are exempt from all revolution effects

*Proposed:*

- -2 base instability in all cities (previously bound to palace).
- Infernals are exempt from all revolution effects
- No revolts while Elohim Sanctuary is active
- No revolts while affected by Stasis
- A player with rebel status gets -90% instability (how long does the rebel status last?)

Last edited: