Single Player bugs and crashes v39 plus (SVN) - After the 20th of July 2019

Game now CTDs during Re-Calc after this mornings SVN Update 10795

Load game, when asks for re-Calc select yes. Just a few seconds after 3 minute mark of Re-calc processing it will CTD.

EDIT: over past 4 days I have been timing Re-Calc processing time. 2:32 or 2:33 has been norm. Today it went past 3 minute + mark and then the CTD.
 

Attachments

Last edited:
It also CTD more often on loading saves too. About 1 in 10.
Also seen the AIAutoplay hang (freeze game completely) quite frequently now. (May be a timing issue that has arisen from all the end turn speed improvements made lately, as I tested this on a duel size map with only one AI in early prehistoric era.)
 
I Reverted to SVN 10793 and R-Calc processed with No CTD. Process time was 2:45 an increase of 13 seconds over past 4 days avg of 2:32.

EDIT: Turn processing has dropped to 2:09 from yesterday's 3:08. Significant change for my game.
 
Last edited:
It also CTD more often on loading saves too. About 1 in 10.
Also seen the AIAutoplay hang (freeze game completely) quite frequently now. (May be a timing issue that has arisen from all the end turn speed improvements made lately, as I tested this on a duel size map with only one AI in early prehistoric era.)

I'am noticed some issues when i started to do some performance profiling last week before making any code changes but i through it was caused by me overclocking my cpu. But this isn't the case because it crashes without overclock as well.

However it seems that some new issues start to show up now and i apologize if my performance tweaking caused these. I tested some of these changes for months without any issues.
 
I'am noticed some issues when i started to do some performance profiling last week before making any code changes but i through it was caused by me overclocking my cpu. But this isn't the case because it crashes without overclock as well.

However it seems that some new issues start to show up now and i apologize if my performance tweaking caused these. I tested some of these changes for months without any issues.
Right now with SVN 10793 I can play, do a Re-Calc, and have faster EoT waits. almost a full minute shaved off of EoT wit time.
 
I'am noticed some issues when i started to do some performance profiling last week before making any code changes but i through it was caused by me overclocking my cpu. But this isn't the case because it crashes without overclock as well.

However it seems that some new issues start to show up now and i apologize if my performance tweaking caused these. I tested some of these changes for months without any issues.
Who knows what it could be that causes it, could even be from the PPIO merge for all I know.
 
Repeatable CTD at end turn, latest SVN 10795
Just end the turn. There are some ships that will not save their orders, but just ignore them.

Since @Anq has reported that he has introduced some crash-causing bugs that he can't fix yet, that might be the first place to look.
Could be the same issue i'am having.
No this crash is at another place.
crash2.PNG
 
@Anq probably broke game with SVN 10794/5.
Maybe, he is working on a CTD fix, that he know he caused, as we speak.
There may be several issues introduced lately in different revisions, so no point in doing the blame game.
Important and complex work is being done from all sides since v39 release, so some instability is to be expected and thus somewhat tolerated.
 
@Anq
You changed the data storage of some tags to vectors without changing the way those tags are used.
Example:
Code:
bool CvUnitInfo::isPrereqOrCivics(int i) const   
{
    FAssertMsg(i < GC.getNumCivicInfos(), "Index out of bounds");
    FAssertMsg(i > -1, "Index out of bounds");
    return std::find(m_pbPrereqOrCivics.begin(), m_pbPrereqOrCivics.end(), i) != m_pbPrereqOrCivics.end();
}
used here
Code:
    bool bValid = false;
    bool bNoReqCivic = true;
    int numNumCivicInfos = GC.getNumCivicInfos();
    if (!bPropertySpawn)
    {
        for (iI = 0; iI < numNumCivicInfos; iI++)
        {
            if (kUnit.isPrereqOrCivics(iI))
            {
                bNoReqCivic = false;
                if (isCivic(CivicTypes(iI)))
                {
                    bValid = true;
                    break;
                }
            }
        }
        if (!bNoReqCivic && !bValid)
        {
            return false;
        }
    }
Looping through numNumCivicInfos and using std::find to search through the vector is definitely slower as the previous array based implementation.
 
Thanks for making the alert signal!

10797
  • Tentative fix by restoring calls to GC.removeDelayedResolution() in object destructors to make sure no wild pointers are left on the delayed resolution map.
  • Moved CvBuildingClassInfo methods except getDefaultBuildingIndex to CvBuildingInfo; Moved CvGameCoreUtil global-scope isSomeWonder methods into BuildingInfo; Updated Python code to match.
Was about to start checking your python changes when the first thing I saw in the first file I checked (C2C_Full_of_Resources_3_00.py) was an error. ^^

Bold is new:
iBuilding = barbarianCivXML.getCivilizationBuildings(iBuildingClass)
if iBuilding == -1 : continue
buildingXML = gc.getBuildingInfo(iBuilding)

if iBuilding.isWorldWonder() : continue
if iBuilding.isNationalWonder() : continue

iBuilding is an integer that does not have a isSomethingWonder() method.

I'll fix it and look through the rest of your python changes.
 
After update to 10798 i do not have any Buildings and no Wonders in the City-Build-Menue:
 

Attachments

  • Civ4ScreenShot0032.JPG
    Civ4ScreenShot0032.JPG
    161.8 KB · Views: 23
  • Civ4ScreenShot0031.JPG
    Civ4ScreenShot0031.JPG
    168.4 KB · Views: 22
WARNING DO NOT UPDATE PAST SVN 10793! Game will CTD During Re-Calc process!
 
Now I know where I made the error: (basketweaver has 1 of 5 bonus requirements copied)
std::find(it1, it2, val) should end at it2 when nothing found, so my algorithm is wrong
Code:
int iSizeOrig = (int)target.size();
        target.reserve(iSizeOrig + (int)source.size());
        while (source.size())
        {
            T& Val = source.back();
            if (find(target.begin(), target.begin()+iSizeOrig, Val) == target.end()) // should be == target.begin()+iSizeOrig
            {
                target.push_back(Val);
            }
            source.pop_back();
        }
 
Back
Top Bottom