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

When all is said and done, we are usually on the same page. ^^
I'm still considering removing the effect entirely for buildings and units though. Mostly this is due to considering what it does to city development. Pondering... pondering... It's on the table.
 
In V38 9916 AI seems to know how to build proper city defence units now as excess number of LEs are absent but almost all AI cities have green and red faces on them so it seems that AI has troubles keeping it's cities happy and clean. Quite unbalanced production values or 'prices' of the buildings are also an issue, as well as some early building seem to require too much hammers.
 
The game option "More XP to level" is bugged. It needs to adjust the values of ANIMAL_MAX_XP_VALUE and BARBARIAN_MAX_XP_VALUE by the same amount. That is when they are used in game not in the XML file.
 
Industrial era has <iCreatePercent>80</iCreatePercent> and Nanotech era has <iCreatePercent>60</iCreatePercent>.
All other CreatePercent tags are set at 100.
@Thunderbrd
 
There is an issue with these buttons.
 

Attachments

  • Buttons.jpg
    Buttons.jpg
    3.1 KB · Views: 157
The game option "More XP to level" is bugged. It needs to adjust the values of ANIMAL_MAX_XP_VALUE and BARBARIAN_MAX_XP_VALUE by the same amount. That is when they are used in game not in the XML file.
I wouldn't call it a 'bug' per se but I see the point of such an adjustment.
 
Battlefield medicine tech claims that it now obsoletes field hospital but modern health care that comes much later is required to build it?? It used to be that battlefield medicine enabled or 'opened' the field hospital. How did this mess happen?
 
Started a new game on latest SVN. Units' construction cost is bugged.
*This seem to affect brute and stone thrower, the other units got what seem to be an allright hammer cost.
Epic, NM, and Large (i think?).

Spoiler :
upload_2018-2-27_15-7-11.png
 
Hawaiian Surfboard Carver has a "TXT_KEY_BUILDING_SURFBOARD_HELP" in its description.
Battlefield medicine tech claims that it now obsoletes field hospital but modern health care that comes much later is required to build it?? It used to be that battlefield medicine enabled or 'opened' the field hospital. How did this mess happen?
Tiny mistake: There is "Heidelburg University" but the name of the city is Heidelberg.
I'll fix these.
I guess "field hospital" should require "battlefield medicine", and obsolete at "modern health care"; not the other way around? (@Thunderbrd )
Started a new game on latest SVN. Units' construction cost is bugged.
*This seem to affect brute and stone thrower, the other units got what seem to be an allright hammer cost.
Epic, NM, and Large (i think?).

Strange bug, I'll investigate it.
 
Strange bug, I'll investigate it.
It's probably caused by this line { in CvPlayer.cpp - getProductionNeeded() } :
iModifier = GC.getEraInfo((EraTypes)GC.getUnitInfo(eUnit).getEraInfo()).getTrainPercent();

GC.getUnitInfo(eUnit).getEraInfo() returns NO_ERA instead of ERA_PREHISTORIC for the "Brute" and "Stone Thrower", so it returns a -1 when it should return a 0
NO_ERA = -1
ERA_PREHISTORIC = 0
ERA_ANCIENT = 1
etc.

Spoiler CvUnit.cpp :
Code:
int CvUnitInfo::getEraInfo() const
{
    if (getPrereqAndTech() != NO_TECH)
    {
        return GC.getTechInfo((TechTypes)getPrereqAndTech()).getEra();
    }
    else
    {
        TechTypes eHighestTech = NO_TECH;
        for ( int i = 0; i < GC.getNUM_UNIT_AND_TECH_PREREQS(); i++)
        {
            if ( getPrereqAndTechs(i) != NO_TECH )
            {
                if (eHighestTech == NO_TECH)
                {
                    eHighestTech = (TechTypes)getPrereqAndTechs(i);
                }
                else if ((int)GC.getTechInfo((TechTypes)getPrereqAndTechs(i)).getEra() > (int)GC.getTechInfo(eHighestTech).getEra())
                {
                    eHighestTech = (TechTypes)getPrereqAndTechs(i);
                }
            }
        }
        if (eHighestTech != NO_TECH)
        {
            return GC.getTechInfo(eHighestTech).getEra();
        }
    }
    return NO_ERA;
}
So what does GC.getEraInfo(NO_ERA).getTrainPercent(); return?
Or rather, what does NULL.getTrainPercent(); return? It returns a problem I'm sure.
 
Last edited:
I guess "field hospital" should require "battlefield medicine", and obsolete at "modern health care"; not the other way around? (@Thunderbrd )
Would've been an easy mistake to make. I'm sure you're right about the analysis.

It's probably caused by this line { in CvPlayer.cpp - getProductionNeeded() } :
iModifier = GC.getEraInfo((EraTypes)GC.getUnitInfo(eUnit).getEraInfo()).getTrainPercent();

GC.getUnitInfo(eUnit).getEraInfo() returns NO_ERA instead of ERA_PREHISTORIC for the "Brute" and "Stone Thrower", so it returns a -1 when it should return a 0
NO_ERA = -1
ERA_PREHISTORIC = 0
ERA_ANCIENT = 1
etc.

Spoiler CvUnit.cpp :
Code:
int CvUnitInfo::getEraInfo() const
{
    if (getPrereqAndTech() != NO_TECH)
    {
        return GC.getTechInfo((TechTypes)getPrereqAndTech()).getEra();
    }
    else
    {
        TechTypes eHighestTech = NO_TECH;
        for ( int i = 0; i < GC.getNUM_UNIT_AND_TECH_PREREQS(); i++)
        {
            if ( getPrereqAndTechs(i) != NO_TECH )
            {
                if (eHighestTech == NO_TECH)
                {
                    eHighestTech = (TechTypes)getPrereqAndTechs(i);
                }
                else if ((int)GC.getTechInfo((TechTypes)getPrereqAndTechs(i)).getEra() > (int)GC.getTechInfo(eHighestTech).getEra())
                {
                    eHighestTech = (TechTypes)getPrereqAndTechs(i);
                }
            }
        }
        if (eHighestTech != NO_TECH)
        {
            return GC.getTechInfo(eHighestTech).getEra();
        }
    }
    return NO_ERA;
}
So what does GC.getEraInfo(NO_ERA).getTrainPercent(); return?
Or rather, what does NULL.getTrainPercent(); return? It returns a problem I'm sure.
Ah... damn... forgot you would get units without tech prereqs. I'll have to resolve that tonight.
 
When you try to construct a "Myth - Seaturtle" (from a subdued seaturtle) you get a "TEXT_KEY_BUILDING_SEATURTLE_MYTH_EFFECT".
The same happened to Tradition - Aesthetics and Tradition - Work Ethic
@Dancing Hoskuld, you are more familiar with this content than me.
I'll let you evaluate whether the techprereq and obsolete techs are swapped for those buildings.
 
Last edited:
It seems the grand festivals construction cost is a bit on the high side.
Normal buildings on that column cost 100 production or so, while they cost 650. I expected it should be around the 400.
 
It seems the grand festivals construction cost is a bit on the high side.
Normal buildings on that column cost 100 production or so, while they cost 650. I expected it should be around the 400.
Recosting oopsie by @Thunderbrd
 
Back
Top Bottom