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

I agree.


If that's the case, then in the games you're testing you're seeing inconsistent results because it wasn't a factor to begin with. I suspected it wasn't, to be honest. If they are doing fine with gold, that 40 or 50 on that global won't make any difference. There are other reasons for some civs to be more reluctant to expand, local threat assessments, war plans, property control, etc... and as stated, the potential for holdup in training enough escorts seems to be the last known reason, so it may depend on how good the production in their capital is more than anything.

I know Joseph was talking about faster gamespeeds not seeming to have the issue but I think his experience may be more non-SM based rather than based on a faster GS. In fact, it's probably more likely that a faster GS would experience AI expansion delay than a longer one, but both can see the issue. I was responding some time not so far back to some complaints about delays to grow that were coming from a Blitz speed game.
So what I observed was HUGE fluke:
Slower expansion of all civs than on average before I changed global to (no one had two cities even in 230th turn) 100 and faster than average expansion of all civs after I changed this global (everyone had founded city on 200th turn).
This effect disappeared when I tried Immortal/Gigantic/Normal.

Still I would like all civs to have built one or two cities when tech leader reaches Ancient era in 12000 BC.
This is should be result of Emperor game.

Can you see those minidumps that I posted earlier?
 
Last edited:
So what I observed was HUGE fluke:
Slower expansion of all civs than on average before I changed global to (no one had two cities even in 230th turn) 100 and faster than average expansion of all civs after I changed this global (everyone had founded city on 200th turn).
This effect disappeared when I tried Immortal/Gigantic/Normal.

Still I would like all civs to have built one or two cities when tech leader reaches Ancient era in 12000 BC.
This is should be result of Emperor game.
All I can say is that there are a lot of factors. If the AI is doing perfectly fine with gold and not having to lower the slider to stay in the positive, then the variable you were adjusting would have no effect. It only relieves reluctance to grow based on being forced to reduce investments on the slider into anything but gold so as to stay in positive income. If they are able to stay on 100% research then this global simply has no effect in the equation.

Can you see those minidumps that I posted earlier?
I had to work some extra hours this week and have some other obligations. I need to look at this and SO's hang bug. I guess the freeze should last at least another week and I'll try to address it over the next few days at some point.
 
If they are able to stay on 100% research then this global simply has no effect in the equation.
They weren't 100% on research - on Pangea probably all AIs met each other and they were spending 5% - 10% on espionage.
But that probably doesn't matter much, as it wasn't gold.
 
They weren't 100% on research - on Pangea probably all AIs met each other and they were spending 5% - 10% on espionage.
But that probably doesn't matter much, as it wasn't gold.
Espionage counts the same as research in this case. If they aren't having to put 60% or more into gold and thus more than 40% NOT on Non-Gold options on the slider, to stay in the positive income levels round by round, then this global has no effect.

At least when it's set to 40. At 100, they would have to be in strike before they'd have any reluctance to growing further. There are some other elements of reluctance this can create - it does affect more than growth, also some reluctance to train more military and so on.
 
Espionage counts the same as research in this case. If they aren't having to put 60% or more into gold and thus more than 40% NOT on Non-Gold options on the slider, to stay in the positive income levels round by round, then this global has no effect.

At least when it's set to 40. At 100, they would have to be in strike before they'd have any reluctance to growing further. There are some other elements of reluctance this can create - it does affect more than growth, also some reluctance to train more military and so on.
That thing is modified in code when something happens (so can be 20 or 70 depending on stuff happening).
Code:
{
        int iWarSuccessRatio = GET_TEAM(getTeam()).AI_getWarSuccessCapitulationRatio();
        if (iWarSuccessRatio < -30)
        {
            iSafePercent -= std::max(20, iWarSuccessRatio / 3);
        }

        if (AI_avoidScience())
        {
            iSafePercent -= 8;
        }

        // Afforess - AI has been made aware of financials in war planning, this is not needed here
        // if (GET_TEAM(getTeam()).getAnyWarPlanCount(true))
        // {
        //    iSafePercent -= 12;
        // }

        if (isCurrentResearchRepeat())
        {
            iSafePercent -= 10;
        }
    }

    return iSafePercent;

I found some code that may regulate early expansion - line 2220 and lower in cvcityai.cpp

Can be if part simply commented out?
Code:
bool CvPlayerAI::AI_isFinancialTrouble() const
{
..............................
    //if (getCommercePercent(COMMERCE_GOLD) > 50)
    {
        int iFundedPercent = AI_costAsPercentIncome();
        int iSafePercent = AI_safeCostAsPercentIncome();
       
        if (iFundedPercent < iSafePercent)
        {
            return true;
        }
    }

    return false;
}
 
That thing is modified in code when something happens (so can be 20 or 70 depending on stuff happening).
Code:
{
        int iWarSuccessRatio = GET_TEAM(getTeam()).AI_getWarSuccessCapitulationRatio();
        if (iWarSuccessRatio < -30)
        {
            iSafePercent -= std::max(20, iWarSuccessRatio / 3);
        }

        if (AI_avoidScience())
        {
            iSafePercent -= 8;
        }

        // Afforess - AI has been made aware of financials in war planning, this is not needed here
        // if (GET_TEAM(getTeam()).getAnyWarPlanCount(true))
        // {
        //    iSafePercent -= 12;
        // }

        if (isCurrentResearchRepeat())
        {
            iSafePercent -= 10;
        }
    }

    return iSafePercent;

I found some code that may regulate early expansion - line 2220 and lower in cvcityai.cpp

Can be if part simply commented out?
Code:
bool CvPlayerAI::AI_isFinancialTrouble() const
{
..............................
    //if (getCommercePercent(COMMERCE_GOLD) > 50)
    {
        int iFundedPercent = AI_costAsPercentIncome();
        int iSafePercent = AI_safeCostAsPercentIncome();
      
        if (iFundedPercent < iSafePercent)
        {
            return true;
        }
    }

    return false;
}
Why would you want to take away the defense against overspending?
 
I know Joseph was talking about faster gamespeeds not seeming to have the issue but I think his experience may be more non-SM based
Oh it definitely is Non SM based. And I don't but once in a great while test on any GS longer than Marathon. I have played Pit's Scenario. But it just distorts everything to me.

And as for raxo's test scenario... can't say that I consider it a good base either. Nor do I think that running autoplay for 100's of turns give any kind of real game play sense. It just gives "snapshots" of the game at set intervals. Giving no real sense of AI interaction to the game.
 
So what I observed was HUGE fluke:
Slower expansion of all civs than on average before I changed global to (no one had two cities even in 230th turn) 100 and faster than average expansion of all civs after I changed this global (everyone had founded city on 200th turn).
This effect disappeared when I tried Immortal/Gigantic/Normal.
Did you run an in game test 100 times with the global at 40 and then 100 times with the global at 100?
The test would have to be done on the same map with exactly the same starting civs and options in use from dawn of time to the beginning of ancient era to be of any value.

That is what you would have needed to do to get statistically significant information in this case about the effect of changing the global.
If you had only changed it to 41 you would probably have to do the test 1000 times for each value, and run the test far longer than up to Ancient era to see any reliable statistical trends from the change.

My point here is, since we currently are in a freeze, that you have to restrain yourself from making significant untested changes to systems that you don't properly understand.
 
Last edited:
Why would you want to take away the defense against overspending?
I don't want to take away defense, I just wanted to make sure if everything is okay here.

And as for raxo's test scenario... can't say that I consider it a good base either. Nor do I think that running autoplay for 100's of turns give any kind of real game play sense. It just gives "snapshots" of the game at set intervals. Giving no real sense of AI interaction to the game.
You misunderstood purpose of my test mod scenario:
It is for checking if unit/building requirements (techs/buildings/resources), replacements and obsoletions are done properly.
For example to check if building/resource prereqs aren't unlocked later than building or unit itself.
Or to make sure, that wonders are buildable until they obsolete (now they do as long as you diligently build replacements of original wonder requirements).

That is checking dependency issues of buildings and units.
I wasn't using that in test of that global.

It is nice to check for artstyle issues too.

Did you run an in game test 100 times with the global at 40 and then 100 times with the global at 100?
The test would have to be done on the same map with exactly the same starting civs and options in use from dawn of time to the beginning of ancient era to be of any value.
I did that as my first test - first at 40, then 75 and finally 100.
In each test more AIs expanded before 200th turn.
But I didn't use same map (same size and options though). I guess those results were VERY misleading (at 40 no expansion before 230th turn and at 100 almost everyone built one or two cities by 200th turn).

I guess there is setting in individual leaders, that dictates expansion rate and I got two vastly different sets here.

This global is back at 40 now.
 
Last edited:
I did that as my first test - first at 40, then 75 and finally 100.
Three tests does not give a reliable statistical data set.
200 different games, or 300 since you tested three values, through prehistoric would have been adequate to draw a conclusion from the results.

Doing 5 to 10 tests per value could also yield information of value if the result show a strong trend without aberrations, if the difference in results from the different values are very noticeable and consistently so.
 
Last edited:
Most recent SVN patch. All descriptions below are according to Sevopedia.

Scavenging Camp yields 10 gold on average if pillaged. Upgrades to Nomadic Herd if Megafauna Domestication is researched.

Nomadic Herd requires Canine Domestication. Yields 5 gold on average if pillaged.

In my current game Scavenging Camps are auto-upgraded after 100 turns into Nomadic Herds (I have Canine Domestication researched). But my Gatherers cannot upgrade Scavenging Camp (I don't have Megafauna Domestication researched).

I guess Nomadic Herd should yield more gold on average if pillaged.
 
Did you know the Resources tab of the Foreign Advisor has been broken since 2015 or so? If PPIO has a fix for that, please port it to core right away.
 
Most recent SVN patch. All descriptions below are according to Sevopedia.

Scavenging Camp yields 10 gold on average if pillaged. Upgrades to Nomadic Herd if Megafauna Domestication is researched.

Nomadic Herd requires Canine Domestication. Yields 5 gold on average if pillaged.

In my current game Scavenging Camps are auto-upgraded after 100 turns into Nomadic Herds (I have Canine Domestication researched). But my Gatherers cannot upgrade Scavenging Camp (I don't have Megafauna Domestication researched).

I guess Nomadic Herd should yield more gold on average if pillaged.
Megafauna Domestication shouldn't be upgrade unlock tech as its dead end tech - probably you meant Canine Domestication.

By the way it looks like no one was trying to balance pillage gold when it came to improvement upgrades.
 
I don't understand why giving non-zero cargo volumes to units such as ships is not being done.

I've got an even clearer example now. A Modern APC's Unit Cargo Volume is zero. Which means it can fill up with 4 units of troops or 1200 animals or whatever (it's a merged one)...
and then load onto an ambulance (or an APC lol)! And every other Modern APC can load onto the same ambulance. Is it really so hard to give non-zero UCVs to these units?
 
I don't understand why giving non-zero cargo volumes to units such as ships is not being done.

I've got an even clearer example now. A Modern APC's Unit Cargo Volume is zero. Which means it can fill up with 4 units of troops or 1200 animals or whatever (it's a merged one)...
and then load onto an ambulance (or an APC lol)! And every other Modern APC can load onto the same ambulance. Is it really so hard to give non-zero UCVs to these units?
Looks like it was unfinished feature - @Thunderbrd needs to look at it.

Why this line: [LINK=%s1_ImpType]%s2_ImpName[\LINK] don't work when used in TXT_KEY_PLOT_IMP_ALTERNATIVE_UPGRADE (displays alternative upgrases for improvements) but does work in TXT_KEY_IMPROVEMENT_EVOLVES?

It would be nice if you could click in alternative improvement upgrade names (like Becomes X or Y or Z in ... turns.).
 
Last edited:
Megafauna Domestication shouldn't be upgrade unlock tech as its dead end tech - probably you meant Canine Domestication.
But I specifically indicated that descriptions are from game's internal Sevopedia. And considering the fact that Canine Domestication doesn't allow Gatherer to upgrade Scavenging Camp...
 
But I specifically indicated that descriptions are from game's internal Sevopedia. And considering the fact that Canine Domestication doesn't allow Gatherer to upgrade Scavenging Camp...
Sounds like bug somewhere.

Can you screenshot that Megafauna Domestication is needed to upgrade? I cant find it.
 
I don't understand why giving non-zero cargo volumes to units such as ships is not being done.

I've got an even clearer example now. A Modern APC's Unit Cargo Volume is zero. Which means it can fill up with 4 units of troops or 1200 animals or whatever (it's a merged one)...
and then load onto an ambulance (or an APC lol)! And every other Modern APC can load onto the same ambulance. Is it really so hard to give non-zero UCVs to these units?
I'm not sure why they have 0 Unit Cargo Volume, perhaps a conflict of old and new rules where the old rule was that nothing that carries another unit can be carried. It seems to me that a unit should never be able to transport its own unit type at least.

Yes, changes to this stuff is hard because it ripples all throughout the AI coding and it really has become quite a bit of spaghetti coding where one rule must be enforced in who knows how many places. It all needs a major rewrite to fix all the issues with it.
 
I'm not sure why they have 0 Unit Cargo Volume, perhaps a conflict of old and new rules where the old rule was that nothing that carries another unit can be carried. It seems to me that a unit should never be able to transport its own unit type at least.

Yes, changes to this stuff is hard because it ripples all throughout the AI coding and it really has become quite a bit of spaghetti coding where one rule must be enforced in who knows how many places. It all needs a major rewrite to fix all the issues with it.
They have zero UCV (I presume) because they were never assigned one, and zero is the default. Where do units with non-zero UCVs get them? I thought for sure it must be unit xml, but I failed to find it there.

Wherever it is, it should come as no surprise that a wide variety of units were not assigned one. Is it possible to change the default to, say, 99999, so that units by default cannot be carried?

And yes it would be a step in the right direction if no unit could carry another of its own type. So is that easy to add to the code?

Also, should there be a rule that no unit should be carryable if it's carrying anything? (Then again there's nothing wrong with an ambulance carrying wounded embarking on a transport for evacuation... if the code can handle it).

You're right that a major overhaul is needed, and it is understandable that such things get put in the too-hard basket, especially if the rest of the team expect you to do it all. But perhaps some of these much smaller steps can address a substantial fraction of the issues.
 
Back
Top Bottom