Python Performance and Interface Overhaul (PPIO)

PPIO v0.5.9.6.7.1
SVN rev.10213
  • Fix - Hitting escape right after modifying the work queue now always exit the city screen.
  • Fix - The work queue was supposed to have had my new tooltip for its entries for some time now, well, better late than never.
PPIO v0.5.9.6.7.2
SVN rev.10213
  • Tweaked tooltip a bit. It could sometimes get stuck, perhaps this is now fixed.
  • Fix - Blue frame over plot list icon that indicates that a unit can be promoted was quite misaligned.
 
Last edited:
@DC0 @Toffer90 here are a handful of examples.

Not representative of the majority mind you, as I use a ultra wide resolution, but it more or less represents how it looks for everyone.
 

Attachments

  • City screen with build list activated.jpg
    City screen with build list activated.jpg
    272.1 KB · Views: 173
  • Civic advisor.jpg
    Civic advisor.jpg
    433.5 KB · Views: 158
  • Finance advisor.jpg
    Finance advisor.jpg
    367.3 KB · Views: 139
  • Map screen.jpg
    Map screen.jpg
    833.4 KB · Views: 167
  • Pedia bonuses.jpg
    Pedia bonuses.jpg
    407.1 KB · Views: 146
  • Pedia buildings.jpg
    Pedia buildings.jpg
    474.8 KB · Views: 150
  • Pedia civs.jpg
    Pedia civs.jpg
    994.4 KB · Views: 137
  • Pedia technologies.jpg
    Pedia technologies.jpg
    561.7 KB · Views: 141
  • Pedia upgrades.jpg
    Pedia upgrades.jpg
    494.5 KB · Views: 142
@Toffer90 there is bug with "Hide Obsolete Worker Actions"
It hides some actions, that aren't obsoleted for example building tunnels.
Spoiler :

Civ4BeyondSword 2018-11-01 08-41-05-37.jpg
Civ4BeyondSword 2018-11-01 08-41-40-06.jpg

 
PPIO v0.5.9.6.7.2 (SVN 10228)

When founding a city:
Code:
Traceback (most recent call last):
  File "CvEventInterface", line 35, in applyEvent
  File "CvEventManager", line 178, in applyEvent
  File "CvDomesticAdvisor", line 1706, in renameApply
IndexError: list index out of range
ERR: Python function applyEvent failed, module CvEventInterface
When opening the domestic advisor.
Code:
Traceback (most recent call last):
  File "CvScreensInterface", line 1078, in handleInput
  File "CvMainInterface", line 5443, in handleInput
  File "CvScreensInterface", line 133, in showDomesticAdvisor
  File "CvDomesticAdvisor", line 532, in interfaceScreen
  File "CvDomesticAdvisor", line 572, in drawScreen
  File "CvDomesticAdvisor", line 1398, in drawContents
KeyError: 'cityName'
ERR: Python function handleInput failed, module CvScreensInterface
I've also deleted my old UserSettings custom domestic folder.
By the way, I suggest making it so that ESC closes the domestic advisor, at the moment you can only exit it by clicking Exit.
 
@Toffer90 there is bug with "Hide Obsolete Worker Actions"
It hides some actions, that aren't obsoleted for example building tunnels.
That stuff is handled by the dll, there's little I can do about it in python...
PPIO v0.5.9.6.7.2 (SVN 10228)

When founding a city:
Code:
Traceback (most recent call last):
  File "CvEventInterface", line 35, in applyEvent
  File "CvEventManager", line 178, in applyEvent
  File "CvDomesticAdvisor", line 1706, in renameApply
IndexError: list index out of range
ERR: Python function applyEvent failed, module CvEventInterface
When opening the domestic advisor.
Code:
Traceback (most recent call last):
  File "CvScreensInterface", line 1078, in handleInput
  File "CvMainInterface", line 5443, in handleInput
  File "CvScreensInterface", line 133, in showDomesticAdvisor
  File "CvDomesticAdvisor", line 532, in interfaceScreen
  File "CvDomesticAdvisor", line 572, in drawScreen
  File "CvDomesticAdvisor", line 1398, in drawContents
KeyError: 'cityName'
ERR: Python function handleInput failed, module CvScreensInterface
I've also deleted my old UserSettings custom domestic folder.
By the way, I suggest making it so that ESC closes the domestic advisor, at the moment you can only exit it by clicking Exit.
I believe the source of the error is on your side.
I cannot reproduce it.
Domestic advisor screen can close by hitting the escape key.
KeyError: 'cityName' suggest that there's an issue with your CustomDomAdv.txt file within UserSettings.
I'll keep looking in the code, if it's not on your side, then I'm not sure what could cause these errors.
 
Last edited:
@makotech222: I have a case for you to investigate if you are interested.

Neanderthal and barbarian NPC's have 0 gold and neither loose or gain any cash per turn. (As it should be)
The three animal teams have zero gold but loose a lot of cash every turn effectively putting them on "strike!" all the time (I believe some animals may be disbanded every turn because of it).

Would you look into whether the "strike!" effect actually affect them, and why they pay unit upkeep when the other NPC teams doesn't?

If I'm correct, and that is fixed, then we would be able to lower spawn frequency of animals quite a bit without suddenly reaching a tipping point where the frequency becomes too low to outweigh the disbanding effect from the "strike!" status.

It's just a theory, I may be wrong, but it's worth investigation imo.

@Thunderbrd : You may have some insight.
 
Last edited:
Code for this faulty Hide Obsolete Option is in CvPlayer.cpp at line 11114
Code:
if (isModderOption(MODDEROPTION_HIDE_OBSOLETE_BUILDS))
    {
        if (kBuild.getRoute() != NO_ROUTE)
        {
            for (int iI = 0; iI < GC.getNumRouteInfos(); iI++)
            {
                if (GC.getRouteInfo((RouteTypes)iI).getMovementCost() < GC.getRouteInfo((RouteTypes)kBuild.getRoute()).getMovementCost())
                {
                    for (int iJ = 0; iJ < GC.getNumBuildInfos(); iJ++)
                    {
                        if (GC.getBuildInfo((BuildTypes)iJ).getRoute() == iI)
                        {
                            if (!GC.getRouteInfo((RouteTypes)GC.getBuildInfo((BuildTypes)iJ).getRoute()).isSeaTunnel())
                            {
                                if (!GC.getBuildInfo((BuildTypes)iJ).isHideObsoleteExempt())
                                {
                                    if (canBuild(pPlot, (BuildTypes)iJ, false))
                                    {
                                        return false;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (kBuild.getImprovement() != NO_IMPROVEMENT)
        {
            for (int iI = 0; iI < GC.getNumImprovementInfos(); iI++)
            {
                if (GC.getImprovementInfo((ImprovementTypes)kBuild.getImprovement()).getImprovementUpgrade() == iI)
                {
                    for (int iJ = 0; iJ < GC.getNumBuildInfos(); iJ++)
                    {
                        if (GC.getBuildInfo((BuildTypes)iJ).getImprovement() == iI)
                        {
                            if (!GC.getBuildInfo((BuildTypes)iJ).isHideObsoleteExempt())
                            {
                                if (canBuild(pPlot, (BuildTypes)iJ, false))
                                {
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Posting it here, so thunderbrd can find it later.

It assumes routes upgrade linearly, but it isn't such case.
Exception for tunnels isn't working, also there is plenty of space terrain routes.

Kation, cleanup Python folder.
 
Last edited:
done a clean install of clean CIV 4, BTS and Caveman2Cosmos and the issue persists.
Have you tried deleting the entire UserSettings folder?
I know it's a pain to do so, but I did remove a BUG option in the last update, the ini file that stores that option value is: RoMSettings.ini. (Try deleting that one first)
Could you post your debug log file for me to look at?
I'll look at SVN changes after revision 10213 (which I'm using atm) to see if there is an explanation there. Edit: Nothing in the SVN that could explain it.
 
Last edited:
Have you tried deleting the entire UserSettings folder?
That worked! I believe I know what is happening:

If you do a fresh reinstall of C2C and then immediately install PPIO before starting it for the first time (as in, before UserSettings get generated) this bug happens.
 
@Thunderbrd : You may have some insight.
I could look into it but NPC players should not apply to any kind of strike rules. I don't think they do. There could still be some code I haven't found, as I've found some and disabled some, that is meant to erase some units in some cases. I'm almost 100% sure I've seen where NPCs are exempt from Strike status though. If it's ultra concerning, I'll make sure to look into it at some point.

Posting it here, so thunderbrd can find it later.

It assumes routes upgrade linearly, but it isn't such case.
Exception for tunnels isn't working, also there is plenty of space terrain routes.

Kation, cleanup Python folder.
If you understand what's written there, you'll understand how difficult it is to figure out another way to make the option work while allowing non-linear route development. Will probably require a new dedicated tag to create an alternative and XML programmable set of rules for establishing if a route is to be considered obsolete for this filter. For now, the trick is simple - don't use the filter in play. You CAN, but it should be made somehow more posted somewhere that when tunnels come into play, you need to turn that hiding obsolete worker actions off. Known bug/inconvenience for a long time.
 
If you understand what's written there, you'll understand how difficult it is to figure out another way to make the option work while allowing non-linear route development. Will probably require a new dedicated tag to create an alternative and XML programmable set of rules for establishing if a route is to be considered obsolete for this filter. For now, the trick is simple - don't use the filter in play. You CAN, but it should be made somehow more posted somewhere that when tunnels come into play, you need to turn that hiding obsolete worker actions off. Known bug/inconvenience for a long time.
I'll add message telling, that it doesn't work properly with some routes like tunnels and space routes to this option hover.

Tunnels are buildable by Modern Workboats too, and they are unlocked in late Industrial era.

I'll check ALL workboats, as I noticed neanderthal workboats can build things, that are way beyond their reach.
They merge with Medieval Workboat or Modern Workboat in case of cultural workboat unit.
 
Last edited:
I'm almost 100% sure I've seen where NPCs are exempt from Strike status though. If it's ultra concerning, I'll make sure to look into it at some point.
It's not that concerning if it doesn't affect the team at all to be in the state of having zero cash and loosing money each turn due to unit upkeep (which is currently the case with the animal teams).
 
It's not that concerning if it doesn't affect the team at all to be in the state of having zero cash and loosing money each turn due to unit upkeep (which is currently the case with the animal teams).
That's a situation that leads to strike which leads to unit loss. If strike is effectively impossible for all NPCs, which it should be, then the gold means nothing right? How they got gold to lose is a little odd to begin with.
 
No, they don't got any gold to begin with, but they have a negative income per turn, which must mean that unit upkeep is calculated for them, and probably some other unnecessary coding is processed for them each turn.
Probably true and something to add to the list.
 
SVN 10226 and last PPIO mod.

If you press F1 again while in Domestic advisor screen (which I did by error), you get A LOT of this error and need to close program and restart:

Traceback (most recent call last):

File "CvScreensInterface", line 1097, in update

File "CvDomesticAdvisor", line 1733, in update

AttributeError: CvDomesticAdvisor instance has no attribute 'bLockedTT'
ERR: Python function update failed, module CvScreensInterface
 
Back
Top Bottom