No announcement yet.

City revolts

  • Filter
  • Time
  • Show
Clear All
new posts

  • City revolts

    Firstly, hello to you all - I stumbled across the site recently and am highly impressed with what you are doing with the mods and scenarios. The game has potential, but it seems Activision thought that was sufficient - how unusual.

    I've spent a bit of time poking about in the text files and looking at the SLIC coding etc... I had a couple of ideas I was thinking about I wanted to run past you all for your opinions and, maybe, some guidance...

    As in history, it is not solely civilian contentment that effects political and civil upheaval in a nation as is modelled in all the Civ games it seems. Rather it is an important factor along with others, including: nationalism/culture/religion, greed, power struggles, social upheaval and so on.

    I would like to introduce code that tests each city at the end of each round for a chance to revolt. The result of a revolt would be as per the present game rules - ie a new civilisation is established. Now, I was thinking about quite what would effect this chance to revolt, and came up with the following indicative numbers:

    Base chance of revolt: 0.5%


    per square removed from capital: +0.01%
    State is in anarchy (ie between governments): +0.1%
    Democracy: -0.2%
    Virtual democracy: -0.3%
    Conquered city (representing discontented occupied population): +0.5% maybe reducing over time (if it can be done)
    Happiness modifier: yet to work this out...something like (100%-happiness%)/10 or some such - whatever works really.

    Result of successful revolt

    1. Create new civilisation! (or barbarians if civs are maxed out)
    2. Create a garrison for the new civ (which the game does not presently do which is STUPID if you ask me!)
    3. If the city had been conquered, then set it to liberated to reflect its return to self rule, then, check if the original civ was wiped out, if so rebirth it, if it still exists, say 50/50 chance it joins the old civ, or strikes out on its own.
    4. If the city was unconquered, set it to conquered.

    Of course, this means establishing an array to record the status of some variables for each city in the game, namely: which civ settled the city, whether the city is conquered or not -off/on, if possible turn # city was conquered.

    What do I want to achieve with this? Presently there are no revolts. Yet history is full of examples of successful and unsuccessful revolutions and rebellions. Hopefully this mechanism would also model some of the difficulty of managing a large empire as fractious locals, and ambitious governors try to break away. I hope it would also increase the chance of a revolt/civil war during the anarchy period between governments - most periods of significant political change in history have been accompanied by some dreadful fratricide.

    Now I hope that this hasn't been discussed before, I've searched extensively and only found some changes to revolt settings, so I hope I'm not going over old ground.


    Is this concept possible to implement within the mod framework of CTPII?
    Is the city array I've described possible (or better, does it exist already!)? And does an array like this get stored in the save game file as it would have to exist through the whole game.
    Any suggested revolt modifiers...chances thereof etc etc
    And please add anything else.

    I look forward to your comments

  • #2
    im not exactly a Slic person but you could ask Skorpion59 or WesW for help. From what i've seen most of it should be posible.

    " mind over body "
    Destruction is a lot easier than construction. The guy who operates a wrecking ball has a easier time than the architect who has to rebuild the house from the pieces.--- Immortal Wombat.


    • #3
      Sure, most of that is possible. Here's a framework on how it might look in SLIC:
      (usual disclaimer: untested, probably has some bugs)

      HandleEvent(EndTurn) 'RevoltsFrame' pre {
      city_t	tmpCity;
      cit_t	capitolCity;
      int_t	i;
      int_t	chance;
      	for (i = 0; i < player[0].cities; i = i + 1) {		// cycle through all cities
      		GetCityByIndex(player[0], i, tmpCity);		// put city in tmpCity
      		chance = 50;		// default value
      			// capitol distance modifier
      		capitolCity = player[0].capital;
      		chance = chance + Distance(capitolCity.location, tmpCity.location);
      			// hapiness modifier
      		chance = chance + ((100 - tmpCity.happiness) / 10);
      			// government modifiers
      		// don't know how to check for current government, could be impossible to do
      			// conquered city modifier
      		// use array, ala militia code from MedMod
      		if (Random(10000) < chance) {	// chance of revolt is 'chance' : 10,000, or (chance/100)%
      						// FE chance is 200 -> 200 : 10,000 chance, or 200/100 = 2%
      			Event:AddHappyTimer(tmpCity, 1, -50, 0);
      			// adds -50 happiness for 1 turn, should make any city revolt
      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery