Python Performance and Interface Overhaul (PPIO)

Here's the compiled .dll if you want to test with that.
Scores in the score list become zero and stay there with this dll both with and without PPIO installed.

The python code is processed and the correct value is returned both with and without PPIO installed.

Could you post the calc. score source code you wrote for that last dll?
Spoiler I guess it should look something like this :

Code:
int CvPlayer::calculateScore(bool bFinal, bool bVictory) const
{
    PROFILE_FUNC();

    if (!isAlive())
    {
        return 0;
    }

    if (GET_TEAM(getTeam()).getNumMembers() == 0)
    {
        return 0;
    }

    long lScore = 0;

    CyArgsList argsList;
    argsList.add((int) getID());
    argsList.add(bFinal);
    argsList.add(bVictory);
    PYTHON_CALL_FUNCTION(__FUNCTION__, PYGameModule, "calculateScore", argsList.makeFunctionArgs(), &lScore);

    return ((int)lScore);
}
 
Last edited:
Sure thing. Don't forget to recalculate if you are using the same map while switching between vanilla and PPIO.
Code:
int CvPlayer::calculateScore(bool bFinal, bool bVictory) const
{
    PROFILE_FUNC();

    if (!isAlive())
    {
        return 0;
    }
    if (GET_TEAM(getTeam()).getNumMembers() == 0)
    {
        return 0;
    }

    long lScore = 0;

    CyArgsList argsList;
    argsList.add((int) getID());
    argsList.add(bFinal);
    argsList.add(bVictory);
    PYTHON_CALL_FUNCTION(__FUNCTION__, PYGameModule, "calculateScore", argsList.makeFunctionArgs(), &lScore);

    return ((int)lScore);

// A python clean-up by Toffer90 made the above code as fast as the hardcoded solution that's below.
// I'll keep this commented out in the case we ever need it again, however unlikely that is. - KaTiON

/*
    int iPopulationScore = getScoreComponent(getPopScore(), GC.getGameINLINE().getInitPopulation(), GC.getGameINLINE().getMaxPopulation(), GC.getSCORE_POPULATION_FACTOR(), true, bFinal, bVictory);
 
    int iLandScore = getScoreComponent(getLandScore(), GC.getGameINLINE().getInitLand(), GC.getGameINLINE().getMaxLand(), GC.getSCORE_LAND_FACTOR(), true, bFinal, bVictory);
 
    int iTechScore = getScoreComponent(getTechScore(), GC.getGameINLINE().getInitTech(), GC.getGameINLINE().getMaxTech(), GC.getSCORE_TECH_FACTOR(), true, bFinal, bVictory);
 
    int iWondersScore = getScoreComponent(getWondersScore(), GC.getGameINLINE().getInitWonders(), GC.getGameINLINE().getMaxWonders(), GC.getSCORE_WONDER_FACTOR(), false, bFinal, bVictory);
 
    return iPopulationScore + iLandScore + iTechScore + iWondersScore;
*/
}
 
Hmm, a small thing I notice is that:

PYTHON_CALL_FUNCTION is never used anywhere else in the dll where a result is expected back.
PYTHON_CALL_FUNCTION4 is always used for all other python calls of this kind.

I looked at how it was in vanilla BtS, but there were only one type of python call method there, while C2C have 3 different kinds.
PYTHON_CALL_FUNCTION
PYTHON_CALL_FUNCTION2
PYTHON_CALL_FUNCTION4

Maybe PYTHON_CALL_FUNCTION doesn't handle the lScore variable the way we want it to. Maybe it simply doesn't care what the python returns from the call.
 
Last edited:
Not sure if it is intentional feature or bug, but it keeps showing unconstructable buildings every time I load a new game. I keep telling it not to but it keeps showing up.

Edit: Forgot to mention, running unkown SVN revision plus this modmod before your most recent fix.
 
You're welcome.
 
OK, trying this again, but where is the "research/gold"/etc that used to be here?? ie, if i only want research in the build area?? etc/ / /

also pic 2, how come it stays green when i have NO more moves, shouldnt it be red??
 

Attachments

  • research.JPG
    research.JPG
    273.2 KB · Views: 148
  • no more moves.JPG
    no more moves.JPG
    259.7 KB · Views: 137
Last edited:
OK, trying this again, but where is the "research/gold"/etc that used to be here?? ie, if i only want research in the build area?? etc/ / /

also pic 2, how come it stays green when i have NO more moves, shouldnt it be red??

also getting these???

Traceback (most recent call last):
File "BugConfig", line 101, in unknown_endtag
File "BugConfig", line 325, in endChild
File "BugConfig", line 328, in end
File "BugConfig", line 309, in process
File "BugConfig", line 508, in handle
File "BugUtil", line 473, in callFunction
File "CvEnhancedTechConquestEventManager", line 14, in __init__
File "EnhancedTechConquest", line 39, in loadConfigurationData
File "e:/main/civilization4/warlords/assets/python/system\ConfigParser.py", line 520, in get
NoOptionError: No option 'check prereq' in section: 'Enhanced Tech Conquest'
Traceback (most recent call last):
File "BugEventManager", line 313, in _handleDefaultEvent
File "CvEnhancedTechConquestEventManager", line 22, in onWindowActivation
File "EnhancedTechConquest", line 39, in loadConfigurationData
File "e:/main/civilization4/warlords/assets/python/system\ConfigParser.py", line 520, in get
NoOptionError: No option 'check prereq' in section: 'Enhanced Tech Conquest'
You have to delete User Settings folder after installing PPIO - back up it if you are only testing PPIO.

You need replace ALL files including one directly in Caveman2Cosmos folder.

Research, gold and others will appear after you research appriorate techs in pic 1.

As for pic 2 green/red button was switched around.
That is RED - turn is being processed processed and GREEN means its your turn.
 
Last edited:
You have to delete User Settings folder after installing PPIO - back up it if you are only testing PPIO.

You need replace ALL files including one directly in Caveman2Cosmos folder.
I did that, per instructions on 1st page. . . do i need both PPIO's or just the most recent one listed there, only has Assets and Resource there??
 
I did that, per instructions on 1st page. . .
Is Caveman2Cosmos Config replaced? With PPIO its content should look like this:

Code:
[Enhanced Tech Conquest]

# If this is set to False, then you can get beakers towards techs you don't have the prerequisites for.
Check Prereq = True

# Base percentage of a tech that is transferred upon conquest - Range(-infinity, 100)
# Using negative value here won't cause you to loose tech progress, but it will act as an offset to the population percent.
Base Percent = 0

# Tech Percentage per population point - Range(1, 100)
Population Percent = 10
 
ok that cleared up the errors, but still where is the research build and stuff at all i see is the IDLE??

also i Unchecked the FoV and its still there also??
Research process and others will appear after you research certain techs.
Does mod without PPIO always display processes?

Window with units has chess pieces.
Buildings - building icon.
Wonders - star.
 
Back
Top Bottom