Python Performance and Interface Overhaul (PPIO)

Toffer90

C2C Modder
Joined
Oct 16, 2011
Messages
8,412
Location
Norway
SVN users do not need this modmod, it was merged with C2C at revision 10722 which was shortly after the official v39 release of C2C.

My main focus was initially to make all the pedia categories scale properly to screen resolution and improve pedia performance whenever I saw a way to do so.
The modmod eventually evolved to encompass python performance and all interface in general.

Works for all screen resolutions, though it works better for high resolutions than for the smallest ones..

Spoiler Notes :
♠ Pedia categories have been given sub-categories.
♠ A brand new type of pedia page has been added and can be found in the special category; it's called "Worker Builds".
♠ The pedia index now opens in a few seconds.
♠ Increased the quality of the pedia background picture. (used other places too)
♠ Tech quotes and wonder movies can be experienced in the pedia.
♠ Some performance improvements outside the pedia too.
♠ The promotions a unit have is now displayed a bit differently.
♠ Improved the demolish building interface inside the city screen.
▬▬▬▬▬▬▬▬
Overhauled screens:
♣ Civics screen
♣ Domestic advisor
♣ Intelligence advisor
♣ Finance advisor
♣ Victory screen (not the one that pops up when the game is over)
♣ Foreign advisor
♣ Most of the pedia.​
▬▬▬▬▬▬▬▬
These are the pedia pages I've not yet overhauled:
♦ Upgrade trees
♦ Specialists
♦ Religions
♦ Routes​
They use original C2C python code still.
▬▬▬▬▬▬▬▬
Spoiler BUG options that I've removed: (Redundant or otherwise unnecessary optionals) :
The entire Plot List option tab.
Gold rate warning (Now it always use color coding).
PLE unit plot list draw method.
Unit Stack interface related options, movement and promotion display.
Great general progress bar show/hide option (Always shown, no longer optional)
Show turns until Culture Growth on city culture bar. (Always shown, no longer optional)
Show turns until great person is born on city GP bar. (Always shown, no longer optional)
Mark the turn remaining for city construction that you have invested hammers in with Cyan color (Always shown, no longer optional).
City specialist display options. ( They didn't do anything )
Hotkey reminder for the BUG option screen.
Many more...
Spoiler To any1 who want to help me debug this modmod :
To get pop-ups about python errors in-game you can in your %USER%\Documents\My Games\Beyond the Sword\CivilizationIV.ini
change this setting from 1 to 0 .
HidePythonExceptions = 0
The pop-ups will tell you what the error was whenever something is written into the PythonErr.log.

In BUG options, under the system tab, you can find an option for the level of python logging to the pythonDbg.log file.
Set it to the "Debug" level.
The pythonDbg.log file can help me understand what happened in code at the time the error occured.
But it is important that you alt+tab out of the game whenever you get a python error message and secure the pythonDbg.log (make a copy of it) file before doing anything else in your game, that way the last lines in the pythonDbg.log file is what happened in code right before the error message popped up.

The screen logging level is not important, I have it set at "Info". It shows python debugging info in the message window right below your research bar.
To any1 who would like to support me financially, here's a LINK for that.
I like to mod C2C, but motivation can falter when it's financially tight.
I couldn't find any civfanatics rules against this, but if there is, I'll remove the link as soon as I learn about it.

For first-time installation and uninstallation of this modmod:


Delete the UserSettings folder completely before starting C2C!
Make a backup of your non-PPIO UserSettings in case you will stop using PPIO.

UserSetting files that are not generated by PPIO will not work with PPIO.
UserSetting files generated by PPIO will not work without PPIO installed.​

C2C will not load with this modmod unless the mod folder is named exactly "Caveman2Cosmos".
 

Attachments

  • PPIO - C2C v39 - v0.7 in a.7z
    1.7 MB · Views: 419
Last edited:
The only problem I am seeing with this is that the icons are not displayed on the index of units/buildings etc. That was how I would be able to quickly see if there was a problem with the icon without having to cause the game to crash.
 
Last edited:
Is it possible to implement this suggestion? https://forums.civfanatics.com/threads/suggestion-sort-civilopedia-content-by-era.614250/

Edit: Technology and some buiding lists loads very slowly, clicking buildings outside of list is slow too.
Also era names should be white - no needs for colors.

Can be eras added to buildings and units?
As I said elsewhere, it will take just as long because you will still have to load the whole file to be sure you get the bits you want. It is the reading in and making of the list that takes the time.
 
As I said elsewhere, it will take just as long because you will still have to load the whole file to be sure you get the bits you want. It is the reading in and making of the list that takes the time.
Ah so this list needs to be saved somewhere so it doesn't have regenerate it every time I click button somewhere.
 
Ah so this list needs to be saved somewhere so it doesn't have regenerate it every time I click button somewhere.
As I mentioned elsewhere, it may be possible to create a set of lists. They just need the id and a subset id eg the id for Writing and the id for Era for techs or the building, building group and era for buildings. To make it work best I would delete them at a start of game and create them again when that part of the pedia is accessed. Then use the list when if available from then on. Upgrade trees use different information and some pages don't need this.

Of course it still may take just as long as now because you now have to read this list. Making many lists might work eg one list each for Great Wonders (except Cultures), National Wonders, Cultures, and each set of buildings.
 
v0.1.1 - Hotfix
  • Fixed python errors that happened when opening the pedia by right clicking an icon in-game.
v0.2
  • Decent performance boost by splitting up categories.
  • I added a sub category list, so that you first select category, then a sub category, and lastly you can select a specific pedia entry.
  • Building, units and techs got split into eras
 
Last edited:
I've found a pretty major bug. When selecting a building in the Buildings section, the Sevopedia redirects to the Animalistic subcategory in the Special Buildings section. Special Buildings do not redirect to the Animalistic subcategory, only buildings in a different section of the Sevopedia do so.

Apart from this, your mod has hugely improved performance. Thank you so much!
 
There is a big problem in the pedia when the displayed text name for two objects is the same eg building Lighthouse and improvement Lighthouse, it goes to the wrong one if you want the improvement. That is why the improvement is now called "A Lighthouse". Jaguar was the previous one being both an animal and a warrior.
 
That's a very strange bug. Does the pedia look it up by the text rather than the key? I thought the whole point of having an XML file with textual values was to avoid this problem.
 
Does the pedia look it up by the text rather than the key?
A lot of things do in the pedia and linking, and we've had trouble with this in the past. You'd think it wouldn't work that way but the pedia designers made this critical fundamental mistake - but there may be a reason in this case that I don't know about - I believe it goes back to vanilla.
 
Right clicking on various item entries on technology popup doesn't always trigger sevopedia, same with building/units selection in cities
Also clicking on any building name in sevopedia automatically switches category to animalistic special buildings.
 
Last edited:
Top Bottom