1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

City revolt (anarchy) after capture

Discussion in 'Bugs and Crashes' started by sp00n, Jan 31, 2013.

  1. sp00n

    sp00n Prince

    Joined:
    Jan 4, 2007
    Messages:
    347
    Yeah, I know that there a certain buildings (and wonders? not sure about that right now) that increase the time until a city is pacified after being captured. But isn't this a bit ... extreme?
    83 turns for their former capital (admittetly with a ton of wonders), and a whooping 96 turns for another city that was currently revolting itself as I took it over (and which doesn't have any wonders)?

    I'm playing on "normal" game speed, and according to the counter I've had just over 400 turns for the whole game so far. There're some serious issues with that, even on the slowest game speed 96 turns would be way too much.

    // Edit
    Game version was r4657.
     

    Attached Files:

  2. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,073
    Location:
    America
    I agree, that sounds a bit ridiculous. I'm not certain though how the revolt times are calculated.
     
  3. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,499
    Gender:
    Male
    Location:
    Las Vegas
    Yeah... huh... interesting that. I've never seen revolt numbers so high and like ls612, have no knowledge of how they are defined.
     
  4. sp00n

    sp00n Prince

    Joined:
    Jan 4, 2007
    Messages:
    347
    The time for the anarchy seems to be defined in CvPlayer.cpp, although not being familiar with the internal structure, I don't see any immediate problems in these pieces of code.
    It may be that iOccupationTimeModifier is being assigned some really high number, or that iTeamCulturePercent has some unexpected value (i.e. it becomes negative).
    Of course there also may be other locations where the turns are defined. I simply searched for a few possible combinations in the /Sources directory and those looked like the best candidates.

    Spoiler :
    PHP:
    void CvPlayer::acquireCity(CvCitypOldCitybool bConquestbool bTradebool bUpdatePlotGroups)
    {
        [...]

    /************************************************************************************************/
    /* Afforess                      Start         06/14/10                                               */
    /*                                                                                              */
    /*                                                                                              */
    /************************************************************************************************/
        
    int iOccupationTimeModifier 100;
        for (
    iI 0iI GC.getNumBuildingInfos(); iI++)
        {
            if (
    pOldCity->getNumRealBuilding((BuildingTypes)iI) > 0)
            {
                if (
    GC.getBuildingInfo((BuildingTypes)iI).getOccupationTimeModifier() != 0)
                {
                    
    iOccupationTimeModifier += GC.getBuildingInfo((BuildingTypes)iI).getOccupationTimeModifier();
                }
            }
        }
    /************************************************************************************************/
    /* Afforess                         END                                                            */
    /************************************************************************************************/

        
    [...]


    /************************************************************************************************/
    /* Afforess                      Start         07/14/10                                               */
    /*                                                                                              */
    /*                                                                                              */
    /************************************************************************************************/
    /*
                pNewCity->changeOccupationTimer(((GC.getDefineINT("BASE_OCCUPATION_TURNS") + ((pNewCity->getPopulation() * GC.getDefineINT("OCCUPATION_TURNS_POPULATION_PERCENT")) / 100)) * (100 - iTeamCulturePercent)) / 100);
    */
                
    int iOccupationTime GC.getDefineINT("BASE_OCCUPATION_TURNS");
                
    iOccupationTime += pNewCity->getPopulation() * GC.getDefineINT("OCCUPATION_TURNS_POPULATION_PERCENT") / 100;
                
    iOccupationTime *= (100 iTeamCulturePercent) / 100;
                
                
    iOccupationTime *= std::max(0,iOccupationTimeModifier);
                
    iOccupationTime /= 100;
                
                
    pNewCity->changeOccupationTimer(iOccupationTime);
    /************************************************************************************************/
    /* Afforess                         END                                                            */
    /************************************************************************************************/
    Which is called by
    CvUnit::setXY(...)
    GET_PLAYER(eNewOwner).acquireCity(pNewCity, true, false, true); // will delete the pointer
    in CvUnit.cpp?



    And by the way, the two cities I captured earlier from the same AI only had around 11-13 turns of anarchy, which is much more in line.
     
  5. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,380
    Gender:
    Male
    Location:
    Western IL. cornfields
    One thing in your screenies, you didn't show the Properties tab where Crime and Disease live on the right side of the screen. Nor on the left side, the right most tab, for the "hidden" bldgs that you get from increased Crime, Pollution, disease, etc.. That would've been some good info too.

    JosEPh
     
  6. sp00n

    sp00n Prince

    Joined:
    Jan 4, 2007
    Messages:
    347
    Not much to see there.
    According to the save game I've attached above:
    Crime is around 200 in Mayapan (83 turns, former capital), the highest value is 361 for water pollution. The special buildings are also pretty standard.
    For Cayuga (96 turns) it doesn't even show a crime rate yet, only flammability (which I believe is always the case right after capturing a city). Special buildings are even less than in in Mayapan.

    Also, the revolt time seems to fluctuate a bit more than I originally thought (all turn values are from the attached save game as well, so all except for #5 have been slightly higher after directly capturing the city):
    Captured city #1: 11 turns
    Captured city #2: 13 turns
    Captured city #3: 81 turns
    Captured city #4: 32 turns
    Captured city #5: 96 turns

    I can't remember having such high values before.
     
  7. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,499
    Gender:
    Male
    Location:
    Las Vegas
    I'd love to see that code block stopped under a debug run on your savegame as the city is captured so the values coming up there can be analyzed. That'd at least point to where the modifier causing the trouble is coming from. I had suspected it might be something to do with the higher populations in C2C but not at those numbers in those screenshots and a quick read of the posted code (thanks spoon!)

    One thing that's interesting... isn't there supposed to be a game speed modifier in that equation somewhere?
     
  8. sp00n

    sp00n Prince

    Joined:
    Jan 4, 2007
    Messages:
    347
    I just assumed that the BASE_OCCUPATION_TURNS constant was already modified to the game speed, but admittedly I didn't check for that.

    And I've now attached a save game immediatly before capturing Cayuga with its 96 turns (yeah, it happened again). You'll just have to destroy one damaged unit to capture it.
     

    Attached Files:

  9. LumenAngel

    LumenAngel King

    Joined:
    Apr 15, 2012
    Messages:
    669
    Location:
    Center of the World (France)
    Even in eon, i never see so big numbers... My max was 20 for a Renaissance capital with 3 world wonders
     
  10. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    And if we still had Story Tellers in the game you would have been able to quell the anarchy in one turn.:mischief:
     
  11. sp00n

    sp00n Prince

    Joined:
    Jan 4, 2007
    Messages:
    347
    Actually I was able to do that in one city with a treasure wagon I captured in another one. :crazyeye:

    But yeah, after noticing those turns I did take a good look if I could still build Story Tellers...
     
  12. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    Story Tellers will be back with a full upgrade line, but one by itself will not get rid of all the anarchy. Great Artists do and will continue to do so.
     
  13. Taxman66

    Taxman66 King

    Joined:
    Aug 3, 2012
    Messages:
    872
    Gender:
    Male
    Location:
    Columbia, Maryland USA
    Worst case work around...
    Wait 10-15 turns (whatever you think it should be) then WB (edit) in a Great Artist to get rid of the rest.
     

Share This Page