How civil war event works in CivDos...
1)Civil war event is called if AI civ has more than 4 cities and somebody captured their capital and human player's place is lower than place of this AI civ.
Problem: city counter and civ place are updated only at the beginning of new turn, so as long as you did not complete your turn you can split old civ as much as you want. But you will not split it into some new rebel civ of new color - instead you will add new cities (if possible) to same rebel civ (why? see (2)) City counter is not updated when you capture enemy city, but it does update (-1) when you destroy "loyalist" city during capture, so in this case number of cities can become 4 or less at current turn.
Civil war event is called during city capture routine, but before capital is captured or destroyed,
so at this moment this city always belongs to its old civ and is not destroyed. Also, old palace is still not destroyed at the moment.
2) game checks civs starting from 1 to 7, and if some civ has 0 unit counter and 0 city counter - this civ will be our "rebel" civ. First aviable civ is selected. Problem here: settlers and nukes are not included into unit counter, so, for example, you can wait with your NONE settler for your own sudden rebel civ! This bug actually happened to somebody on Fanatics, I remember reading about it...
And another problem! Remember, that you can split old civ as long as you want. But its worse than that! Our first "rebel" civ still has 0 cities and 0 units on its counters, so we can split old civ further! This way, we will change more "loyalist" cities and units to rebels, if "loyalist" actually still have some cities for that... Also, it's possible that rebel civ will change its "flavor" in process: for example, Babylonians (rebel) can become Zulu (rebel). In extreme case, you can start another civil war in Loyalist last city, so you will immediately destroy their civ, so only rebel civ will remain from these two.
3) game counts population of all Loyalist cities on every continent
4) game sets "capital continent": where is old capital was. Strange and useless code here: if "capital continent" already has been set, it can be changed if Loyalist civ has _another_ city with palace and this city is on the same X line as civ's first settler ("start position X coordinate" in JCivED)...
5) if some "capital continent" was found (this is always true, because C.W. can happen only when capital is captured): call "spawn civ" function for rebel civ...
5) if civ was succesfully spawned*, select which civ from the pair of same color it will be. If new rebel civ is beyond original number of civs (for example, you had selected 5 civs in "level of competition" and rebel civ is number 6th), then its "flavour" selected randomly. Also, in this case, after destruction of rebel civ settler of another civ of this color can appear, just like after destruction of normal civ from 4000 BC.
*if civ was not active (normally, dead civs or civs beyond "level of competition" are not active), then "spawn civ" function simply sets some variables, it does not create first settler. Also in this case it always returns "true". But if civ was active (it's possible, if some active civ had had 0 normal units and 0 cities - for example, if you waited with your NONE settler) - then normal rules to spawn "first" civ settler are used and this function can return "0" if failed to do so.
6) But if vacant place is from some normal dead civ, then some strange rule is used. Dead green, yellow, pink and gray civs always change their "flavour" to another (for example, English always become Greeks and Aztecs always become Egyptians etc.). After destruction of such rebel civ, no new civ can be spawned. But for all other colors (white, blue, cyan) rebel civ in dead civ slot sets its "flavour" randomly, just according to (5) rule. In this case, after destuction of rebel civ, new civ can be spawned, just like in (5).
6) game sets rebel civ leader's name, civ single/adjective and civ plural name
7) if Loyalist civ is the player (can never happen), then game should show non-existent "*SCHISM" message from KING.TXT; for AI, game shows "*ESCHISM"
8) rebels got 1/2 of Loyalist treasury; new Loyalist treasury calculates as old treasury minus rebels' treasury
9) for some reason, game sets rebels' military power as half of Loyalist mil. power. And does not change Loyalist mil. power at all. This data is of course wrong, but maybe it's here so we have at least some changes before correct re-calculation next turn.
10) rebels' bulb meter is changed to lyalists'; same for number of tech
11) same for current government
12) civ. advances data (bit per tech) copied, but not data about source of these civ. advances. So this data is still -1 (so, even though rebel civ _knows_ these techs, in civilopedia these techs will be without "Discovered" or "Taken from <Loyalist civ>" subtitle).
13) rebel's timer to talk with player is set to game_turn-8, which means that they will talk to you only 8 turns later. But because your contact status with them probably is 0, it does not matter and they will speak immediately anyway
14) diplomacy status of rebels to Loyalists is set to 1 ("contact" and nothing more)
15) diplomacy status of Loyalists to rebels is set to 9 ("contact" and "vendetta").
Vendetta between AIs means that they will never talk to each other, so this war will be eternal.
Only if Loyalists will change their govt they will forget all vendettas including this one.
16) game tries to divide loyalists and rebels to their own continents:
initially, loyalist pop. score is population of capital continent and rebel pop. score is 0.
If rebel pop. score is bigger than loyalists' OR current continent is the "capital" continent of loyalists,
then this continent is belong to Loyalists (and its population is added to total Loyalists population, if not their "capital" continent). Else continent is belong to Rebels (and its population is added to total Rebels population).
17) if in result of this divorce, rebel pop. score*2 <= loyalists pop. score (too small!) OR rebel pop. score > loyalists pop. score (too big!), then game uses ALTERNATIVE way to divide loyalists and rebels:
while rebel population*3 < original loyalist population, game selects farest city from old loyalist capital and makes it Rebel. So roughly 1/3 of population are rebels is this case (this always happens when civ has cities only on one continent).
18) but if "continental divorce" population divide ok, then game simply makes all loyalist cities on rebel continents rebel cities.
19) then, game changes some loyalist units to rebels or change their home cities (too much to write and this post is already very big, so I will skip that)
20) game granted rebels a new capital. New capital is selected as a city with smallest sum of distances from all other cities of this civ. "X start coordinate" of civ is changed to X coordinate of this city.
21) if Loyalists is the player (never can happen), then game changes camera position to... current camera position;
and if they are AI, game granted them a new capital. Rules to select it the same as for rebels. "X start coordinate" of civ is changed to X coordinate of this city. Before that, game changes civ of their old capital to -1 to exclude it from this logic (it's important, because at the moment, their old capital is still belong to them).
22) if (1) condition was ok, but game failed to add rebel civ ("civil war" function returned 0) - then game select a city according to (20) rule, excluding captured city (for that, civ of captured civ is temporarily changed to aggressor civ, and after that it's changed back). And current production in this city is changed to Palace. Even if this civilization has no tech for it. Production of palace can not be interrupted by AI, there are special rule about that.
1)Civil war event is called if AI civ has more than 4 cities and somebody captured their capital and human player's place is lower than place of this AI civ.
Problem: city counter and civ place are updated only at the beginning of new turn, so as long as you did not complete your turn you can split old civ as much as you want. But you will not split it into some new rebel civ of new color - instead you will add new cities (if possible) to same rebel civ (why? see (2)) City counter is not updated when you capture enemy city, but it does update (-1) when you destroy "loyalist" city during capture, so in this case number of cities can become 4 or less at current turn.
Civil war event is called during city capture routine, but before capital is captured or destroyed,
so at this moment this city always belongs to its old civ and is not destroyed. Also, old palace is still not destroyed at the moment.
2) game checks civs starting from 1 to 7, and if some civ has 0 unit counter and 0 city counter - this civ will be our "rebel" civ. First aviable civ is selected. Problem here: settlers and nukes are not included into unit counter, so, for example, you can wait with your NONE settler for your own sudden rebel civ! This bug actually happened to somebody on Fanatics, I remember reading about it...
And another problem! Remember, that you can split old civ as long as you want. But its worse than that! Our first "rebel" civ still has 0 cities and 0 units on its counters, so we can split old civ further! This way, we will change more "loyalist" cities and units to rebels, if "loyalist" actually still have some cities for that... Also, it's possible that rebel civ will change its "flavor" in process: for example, Babylonians (rebel) can become Zulu (rebel). In extreme case, you can start another civil war in Loyalist last city, so you will immediately destroy their civ, so only rebel civ will remain from these two.
3) game counts population of all Loyalist cities on every continent
4) game sets "capital continent": where is old capital was. Strange and useless code here: if "capital continent" already has been set, it can be changed if Loyalist civ has _another_ city with palace and this city is on the same X line as civ's first settler ("start position X coordinate" in JCivED)...
5) if some "capital continent" was found (this is always true, because C.W. can happen only when capital is captured): call "spawn civ" function for rebel civ...
5) if civ was succesfully spawned*, select which civ from the pair of same color it will be. If new rebel civ is beyond original number of civs (for example, you had selected 5 civs in "level of competition" and rebel civ is number 6th), then its "flavour" selected randomly. Also, in this case, after destruction of rebel civ settler of another civ of this color can appear, just like after destruction of normal civ from 4000 BC.
*if civ was not active (normally, dead civs or civs beyond "level of competition" are not active), then "spawn civ" function simply sets some variables, it does not create first settler. Also in this case it always returns "true". But if civ was active (it's possible, if some active civ had had 0 normal units and 0 cities - for example, if you waited with your NONE settler) - then normal rules to spawn "first" civ settler are used and this function can return "0" if failed to do so.
6) But if vacant place is from some normal dead civ, then some strange rule is used. Dead green, yellow, pink and gray civs always change their "flavour" to another (for example, English always become Greeks and Aztecs always become Egyptians etc.). After destruction of such rebel civ, no new civ can be spawned. But for all other colors (white, blue, cyan) rebel civ in dead civ slot sets its "flavour" randomly, just according to (5) rule. In this case, after destuction of rebel civ, new civ can be spawned, just like in (5).
6) game sets rebel civ leader's name, civ single/adjective and civ plural name
7) if Loyalist civ is the player (can never happen), then game should show non-existent "*SCHISM" message from KING.TXT; for AI, game shows "*ESCHISM"
8) rebels got 1/2 of Loyalist treasury; new Loyalist treasury calculates as old treasury minus rebels' treasury
9) for some reason, game sets rebels' military power as half of Loyalist mil. power. And does not change Loyalist mil. power at all. This data is of course wrong, but maybe it's here so we have at least some changes before correct re-calculation next turn.
10) rebels' bulb meter is changed to lyalists'; same for number of tech
11) same for current government
12) civ. advances data (bit per tech) copied, but not data about source of these civ. advances. So this data is still -1 (so, even though rebel civ _knows_ these techs, in civilopedia these techs will be without "Discovered" or "Taken from <Loyalist civ>" subtitle).
13) rebel's timer to talk with player is set to game_turn-8, which means that they will talk to you only 8 turns later. But because your contact status with them probably is 0, it does not matter and they will speak immediately anyway
14) diplomacy status of rebels to Loyalists is set to 1 ("contact" and nothing more)
15) diplomacy status of Loyalists to rebels is set to 9 ("contact" and "vendetta").
Vendetta between AIs means that they will never talk to each other, so this war will be eternal.
Only if Loyalists will change their govt they will forget all vendettas including this one.
16) game tries to divide loyalists and rebels to their own continents:
initially, loyalist pop. score is population of capital continent and rebel pop. score is 0.
If rebel pop. score is bigger than loyalists' OR current continent is the "capital" continent of loyalists,
then this continent is belong to Loyalists (and its population is added to total Loyalists population, if not their "capital" continent). Else continent is belong to Rebels (and its population is added to total Rebels population).
17) if in result of this divorce, rebel pop. score*2 <= loyalists pop. score (too small!) OR rebel pop. score > loyalists pop. score (too big!), then game uses ALTERNATIVE way to divide loyalists and rebels:
while rebel population*3 < original loyalist population, game selects farest city from old loyalist capital and makes it Rebel. So roughly 1/3 of population are rebels is this case (this always happens when civ has cities only on one continent).
18) but if "continental divorce" population divide ok, then game simply makes all loyalist cities on rebel continents rebel cities.
19) then, game changes some loyalist units to rebels or change their home cities (too much to write and this post is already very big, so I will skip that)
20) game granted rebels a new capital. New capital is selected as a city with smallest sum of distances from all other cities of this civ. "X start coordinate" of civ is changed to X coordinate of this city.
21) if Loyalists is the player (never can happen), then game changes camera position to... current camera position;
and if they are AI, game granted them a new capital. Rules to select it the same as for rebels. "X start coordinate" of civ is changed to X coordinate of this city. Before that, game changes civ of their old capital to -1 to exclude it from this logic (it's important, because at the moment, their old capital is still belong to them).
22) if (1) condition was ok, but game failed to add rebel civ ("civil war" function returned 0) - then game select a city according to (20) rule, excluding captured city (for that, civ of captured civ is temporarily changed to aggressor civ, and after that it's changed back). And current production in this city is changed to Palace. Even if this civilization has no tech for it. Production of palace can not be interrupted by AI, there are special rule about that.
Last edited: