Single Player bugs and crashes v38 plus (SVN) - After the 20th of February 2018

What factors go into revolution time for changing religions?

I'm currently turn 214 into a normal/large/emperor game, founded my first religion (ngaism). However, adopting this religion would cause 50! turns of anarchy. By comparison, adopting a selection of recent civics that I have been lazy about changing (chief->despot, subsistence->trade, native language->trade, community labor->skilled) accumulated still only 1 turn of anarchy. Education level in my capital is -150. Limited religions is on, there is no other religion in any of my cities.

It is the case that my population at the moment is ridiculously high. My capital is 36, plus 77 slaves of various types (raging barbarians combined with the production modifiers from size matters and the game speed resulted in some fairly large barbarian populations to capture). My 5 other cities range between 10 and 22.
 
What factors go into revolution time for changing religions?

I'm currently turn 214 into a normal/large/emperor game, founded my first religion (ngaism). However, adopting this religion would cause 50! turns of anarchy. By comparison, adopting a selection of recent civics that I have been lazy about changing (chief->despot, subsistence->trade, native language->trade, community labor->skilled) accumulated still only 1 turn of anarchy. Education level in my capital is -150. Limited religions is on, there is no other religion in any of my cities.

It is the case that my population at the moment is ridiculously high. My capital is 36, plus 77 slaves of various types (raging barbarians combined with the production modifiers from size matters and the game speed resulted in some fairly large barbarian populations to capture). My 5 other cities range between 10 and 22.

Not sure but this could be your problem source, Found in GlobalDefines.xml:

<Define>
<DefineName>MAX_ANARCHY_TURNS</DefineName>
<iDefineIntVal>999</iDefineIntVal>
</Define>

Was Never this high before, ever. Both Civ IV and BtS use 100 here.
 
Last edited:
What factors go into revolution time for changing religions?

I'm currently turn 214 into a normal/large/emperor game, founded my first religion (ngaism). However, adopting this religion would cause 50! turns of anarchy. By comparison, adopting a selection of recent civics that I have been lazy about changing (chief->despot, subsistence->trade, native language->trade, community labor->skilled) accumulated still only 1 turn of anarchy. Education level in my capital is -150. Limited religions is on, there is no other religion in any of my cities.

It is the case that my population at the moment is ridiculously high. My capital is 36, plus 77 slaves of various types (raging barbarians combined with the production modifiers from size matters and the game speed resulted in some fairly large barbarian populations to capture). My 5 other cities range between 10 and 22.
Something is definitely wrong there. I'll study the code to see what might be causing this.
 
@Thunderbrd regarding the change to food growth, I'd like to confirm this change (place and logic) before making it.
Current code:
Code:
int CvCity::growthThreshold() const
{
    int iThreshold = GET_PLAYER(getOwnerINLINE()).getGrowthThreshold(getPopulation());
   
    iThreshold *= (GET_PLAYER(getOwnerINLINE()).getPopulationgrowthratepercentage() + 100);
    iThreshold /= 100;
   
    iThreshold *= (getPopulationgrowthratepercentage() + 100);
    iThreshold /= 100;
   
    if (getNumCityPlots() == NUM_CITY_PLOTS)
    {
        iThreshold = iThreshold*(100+GC.getDefineINT("CITY_THIRD_RING_EXTRA_GROWTH_THRESHOLD_PERCENT"))/100;
    }

    if ( isHominid() )
    {
        iThreshold /= 2;    //    Those barbarians are just so damned fecund!
    }

    return std::max(1,iThreshold);

}
My changes:
Code:
int CvCity::growthThreshold() const
{
    int iThreshold = GET_PLAYER(getOwnerINLINE()).getGrowthThreshold(getPopulation());
    int iThresholdModifier= (GET_PLAYER(getOwnerINLINE()).getPopulationgrowthratepercentage() + 100);
    int iDivide = 100; //used to reduce possible rounding error, as it's assumed that we won't be near int overflow
   
    iThresholdModifier *= (getPopulationgrowthratepercentage() + 100);
    iDivide *= 100;
   
    if (getNumCityPlots() == NUM_CITY_PLOTS)
    {
    iThresholdModifier *= (100+GC.getDefineINT("CITY_THIRD_RING_EXTRA_GROWTH_THRESHOLD_PERCENT"));
    iDivide *= 100;
    }

    if ( isHominid() )
    {
       iDivide *= 2;    //    Those barbarians are just so damned fecund!
    }

iThresholdModifier/=iDivide;
if(iThresholdModifier<1){ //we got -food%
iThresholdModifier -=1; //we want "need -100%" to be -1, not 0
iThresholdModifier *=-1; //switch sign
iThreshold/=iThresholdModifier;
}
else{
iThreshold*=iThresholdModifier;
}

    return std::max(1,iThreshold);

}
 
Civ4ScreenShot0063.JPG
Inflation is way too high now. Blitz (the old Normal) should never be above 18 in the GS file. Currently set to 22. Also all Offsets for inflation should keep inflation out of the game till at least the cloumn after tribalism. -50 is 25 turn too soon for Blitz.

In middle Ancient Era Inflation is already at 39% and worsening. City Maint costs are also too high. The Globals for Num Cities and Dist to Palace need set back to previous levels Or all Civics have their respective Num Cities and Dist Palace malus reduced or removed.

Inflation on Currency Civics; Metals and Coinage need removed.

Inflation is runaway train now. As is City Maint.
 
Last edited:
I get a reproducible CTD with this game. It only happens with the newest changes by alberts2 in SVN 9987, 9986 is OK (I also get CTDs with 9986 but they are not reproducible, reloading the last save and they won´t happen again for a while).

Recipe:
  • Run the attached save (warning: this will take long!)
  • Do a recalc (not sure if this is necessary)
  • Press the "w" (wait) button about 8 times.
  • After a short while windows gives a message that civ4 is not responding.
I also tried emptying the cache which didn´t help.

A fix for this CTD is on the way to the svn right now.

It seems it is possible for the movement cost calculation to return a value < 1 that's what caused this CTD. This isn't caused by my changes i just didn't think this would be possible so i have to investigate where such a low value comes from.
 
@Thunderbrd regarding the change to food growth, I'd like to confirm this change (place and logic) before making it.
Current code:
Code:
int CvCity::growthThreshold() const
{
    int iThreshold = GET_PLAYER(getOwnerINLINE()).getGrowthThreshold(getPopulation());
  
    iThreshold *= (GET_PLAYER(getOwnerINLINE()).getPopulationgrowthratepercentage() + 100);
    iThreshold /= 100;
  
    iThreshold *= (getPopulationgrowthratepercentage() + 100);
    iThreshold /= 100;
  
    if (getNumCityPlots() == NUM_CITY_PLOTS)
    {
        iThreshold = iThreshold*(100+GC.getDefineINT("CITY_THIRD_RING_EXTRA_GROWTH_THRESHOLD_PERCENT"))/100;
    }

    if ( isHominid() )
    {
        iThreshold /= 2;    //    Those barbarians are just so damned fecund!
    }

    return std::max(1,iThreshold);

}
My changes:
Code:
int CvCity::growthThreshold() const
{
    int iThreshold = GET_PLAYER(getOwnerINLINE()).getGrowthThreshold(getPopulation());
    int iThresholdModifier= (GET_PLAYER(getOwnerINLINE()).getPopulationgrowthratepercentage() + 100);
    int iDivide = 100; //used to reduce possible rounding error, as it's assumed that we won't be near int overflow
  
    iThresholdModifier *= (getPopulationgrowthratepercentage() + 100);
    iDivide *= 100;
  
    if (getNumCityPlots() == NUM_CITY_PLOTS)
    {
    iThresholdModifier *= (100+GC.getDefineINT("CITY_THIRD_RING_EXTRA_GROWTH_THRESHOLD_PERCENT"));
    iDivide *= 100;
    }

    if ( isHominid() )
    {
       iDivide *= 2;    //    Those barbarians are just so damned fecund!
    }

iThresholdModifier/=iDivide;
if(iThresholdModifier<1){ //we got -food%
iThresholdModifier -=1; //we want "need -100%" to be -1, not 0
iThresholdModifier *=-1; //switch sign
iThreshold/=iThresholdModifier;
}
else{
iThreshold*=iThresholdModifier;
}

    return std::max(1,iThreshold);

}
Looks good at first glance. I would prefer some different formatting of hard returns and tabs but I don't have time to display the difference at the moment. Otherwise, it looks good. @alberts2 & @Toffer90 : You guys are good at reading code math. I'm sure he's right but double check for me please.

Also, make SURE to update THEN compile so that the current code assets are included in the dlls committed. You probably know that already I'm sure but it's still worth being stated again.
 
Current SVN Commit :Reduce or Remove Inflation from Currency Civics; Metal, Coinage, and Bank Note. Also reduced Num City and Dist Palace maint Modifiers on Same Civics. This is to start to address the run away Inflation now in game.

Toffer will need to address GS files for above noted problems. If he does not I will.
 
Toffer will need to address GS files for above noted problems. If he does not I will.
I'll reduce inflation values in GS.
Feel free to change inflation parameters further after that, I personally want to remove inflation completely, so I'm too biased to really make fine adjustments to them.
@alberts2 & @Toffer90 : You guys are good at reading code math. I'm sure he's right but double check for me please.
I would have written it like so:
Code:
int CvCity::growthThreshold() const
{
    int iThreshold = GET_PLAYER(getOwnerINLINE()).getGrowthThreshold(getPopulation());
    int iDenominator = 1;

    iThreshold *= GET_PLAYER(getOwnerINLINE()).getPopulationgrowthratepercentage() + 100;
    iDenominator *= 100;

    iThreshold *= (getPopulationgrowthratepercentage() + 100);
    iDenominator *= 100;

    if (getNumCityPlots() == NUM_CITY_PLOTS)
    {
        iThreshold *= (GC.getDefineINT("CITY_THIRD_RING_EXTRA_GROWTH_THRESHOLD_PERCENT")+100);
        iDenominator *= 100;
    }

    if ( isHominid() )
    {
        iDenominator *= 2;    //    Those barbarians are just so damned fecund!
    }
    iThreshold /= iDenominator

    return std::max(1,iThreshold);
}
Am I missing some of your intention here Raledon?
Edit: I apparently missed the intention that reductions below -99% should not automatically set iThreshold to the minimum of 1 :food:. I made a new suggestion in a later post.
 
Last edited:
I'll reduce inflation values in GS.
Feel free to change inflation parameters further after that, I personally want to remove inflation completely, so I'm too biased to really make fine adjustments to them.
Previous Blitz infaltion:
<iInflationPercent>22</iInflationPercent>

Current Blitz inflation;
<iInflationPercent>20</iInflationPercent>

This is still too high for Blitz.

I had a 1000 turn GS have 18 and an 8000 turn game had 9. There were solid reasons for these numbers. And the spread in between for the former GS. But of course you all changed the iGoldmodiers around too, so now it's even more prominent a problem.

You take Normal (2000 turns) from 18 to 10, Long (4000) 18 to 6, Epic (6000) 16 to 5, Marathon (8000) 14 to 4, Snail (12,000) 12 to 3, Eons ( 16,000) 10 to 2, and Eternity (20,000) 9 down to 1.

I personally want to remove inflation completely,
Afforess tried that with AND2, and iirc with only limited success.
 
Last edited:
@Thunderbrd ,

Just entered Classical Era and now all Mil units have lost their base Combat 1 promo or for Rangers their base Woodsman1 promo and/or both.
Civ4ScreenShot0065.JPG


Here you see one of my rangers, it already has Woodsman II but now I can select I or III. This unit also Had Combat 1 but it was removed and is now offered as a "New" selection too. I only got to pick 1 promo so I took the Wood III. But clearly this is not working as intended, I hope. Lost my wood ! and Combat 1 to get a Wood III.

I have saved this game in the middle of this turn. If you want it I will upload it.
 
You take Normal (2000 turns) from 18 to 10, Long (4000) 18 to 6, Epic (6000) 16 to 5, Marathon (8000) 14 to 4, Snail (12,000) 12 to 3, Eons ( 16,000) 10 to 2, and Eternity (20,000) 9 down to 1.
Feel free to adjust them further.
Afforess tried that with AND2, and iirc with only limited success.
I set the percent to 0% in the "my take on stuff" modmod and have yet to notice the downside to it.
 
Last edited:
I set the percent to 0% in the "my take on stuff" modmod and have yet to notice the downside to it.
I think he tried to Remove all inflation coding and modifiers. But that was 4 years or more ago.

So how did you compensate on Gold and Commerce in the game with out Inflation?
 
So how did you compensate on Gold and Commerce in the game with out Inflation?
I compensate the lack of inflation expenses with increased city maintenance expenses. I haven't gotten it perfect in my modmod yet but in theory it should be possible to balance city maintenance in such a manner that too much gold becomes a rare event.
If inflation is currently imperative in the fight against the "too much gold syndrome", then it won't be a quick job to change maintenance to do that job just like that, so any thoughts in that direction should in any case wait until after v38 "Proper" is released.

Inflation is a pretty bad system that cannot be adjusted equally for different gamespeeds the way it currently work.
It is possible to set the inflation value so that all gamespeeds accumulate the same expense from inflation at one specific percentage of total turns played, but the amount before and after that turn count will be unequal for all gamespeeds no matter what values you may set in the gamespeed XML. One would have to change the xml values for that tag between every turn to get all gamespeeds to be balanced equally throughout a game.
Inflation never stops so it basically sets a max amount of turns that can ever be played in a game because sooner or later your inflation will get so high that it's impossible to continue the save.

I'm thinking about the hypothetical scenario e.g a Blitz game that has been played let's say for 3000 turns and the player is still having fun with the save, it's at a point where all players have all techs.
That would be an impossible scenario because all players would be completely bankrupt at that point due to the never ending inflation.

"Never ending" games (those that seemingly go on for much longer than what was ever intended) was a possibility in, I think it was, Civ III; it's a shame that we have a inflation system that makes the entire concept of a "never ending" game impossible.
Inflation as a system could work for a game like this if it were counterbalanced by a deflation system.
 
Last edited:
@Thunderbrd ,

Just entered Classical Era and now all Mil units have lost their base Combat 1 promo or for Rangers their base Woodsman1 promo and/or both.
View attachment 491280

Here you see one of my rangers, it already has Woodsman II but now I can select I or III. This unit also Had Combat 1 but it was removed and is now offered as a "New" selection too. I only got to pick 1 promo so I took the Wood III. But clearly this is not working as intended, I hope. Lost my wood ! and Combat 1 to get a Wood III.

I have saved this game in the middle of this turn. If you want it I will upload it.
Don't think a save will help here but holy cow how can you handle having that many animals on the map at once?
 
Don't think a save will help here but holy cow how can you handle having that many animals on the map at once?
With extreme prejudice and care. That's What Peace Among NPCs gives you now.

It was Worse.

My exile or hunter unit kills an animal and moves into that square , heals for a turn or 2 then looks for another tile with 1 animal to kill it and then move to that square. Exploration is very very slow.

And that brings up the Exile. I can give the Exile the subdued animal promo. But it can not Subdue an animal. If it would have had a successful subdue action it just shows in green letters that the Exile Destroyed x animal. Other wise a normal kill gives the food and/or hammer that a normal kill gives.
 
Back
Top Bottom