1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Python Performance and Interface Overhaul

Discussion in 'C2C mod mods' started by Toffer90, Jul 7, 2017.

  1. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    4,833
    Location:
    Norway
    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 Notable modmod features :
    These pedia pages will scale properly right now:
    ♦ INDEX
    ♦ Concepts
    ♦ Technologies
    ♦ Buildings
    ♦ Promotions
    ♦ Civics
    ♦ Corporations
    ♦ Bonuses
    ♦ Features
    ♦ Improvements
    ♦ Worker Builds
    ♦ Civilizations
    ♦ Leaderheads
    ♦ Units
    ♦ Projects​

    ♠ 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.
    ♣ Domestic advisor
    ♣ Intelligence advisor
    ♣ Finance advisor
    ♣ Victory screen (not the one that pops up when the game is over)
    ♣ Foreign advisor​
    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.

    PPIO for C2C v38.5 will not be further developed, if you want the development version of PPIO you will need the development version of C2C found in the SVN repository.
    v0.5.9.6.8.8 or newer requires SVN rev. 10280 or newer.


    For first-time installation and uninstallation of this modmod:
    Delete the UserSettings folder completely before starting C2C!
    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".
     

    Attached Files:

    Last edited: Dec 9, 2018 at 6:32 AM
  2. GiuseppeIII

    GiuseppeIII The Third Giuseppe

    Joined:
    Jul 12, 2011
    Messages:
    639
    Location:
    Chicago IL
    Wow... this sounds pretty amazing, will be trying it out. Thanks for doing this!
     
  3. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    4,833
    Location:
    Norway
    v0.1
    • Some small performance and memory optimizations.
    • Default pedia category changed to concepts.
     
    Last edited: Aug 29, 2017
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    23,448
    Gender:
    Male
    Location:
    Las Vegas
    I'm not sure I relate to the problem that prompts this modification but if it's an improvement, why is it a modmod?
     
  5. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,603
    Gender:
    Male
    Location:
    Canberra, Australia
    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.
     
  6. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    3,608
    Location:
    Poland
    Last edited: Jul 8, 2017
  7. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,603
    Gender:
    Male
    Location:
    Canberra, Australia
    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.
     
  8. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    3,608
    Location:
    Poland
    Ah so this list needs to be saved somewhere so it doesn't have regenerate it every time I click button somewhere.
     
  9. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,603
    Gender:
    Male
    Location:
    Canberra, Australia
    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.
     
  10. Noriad2

    Noriad2 Chieftain

    Joined:
    Oct 23, 2014
    Messages:
    1,125
    Gender:
    Male
    Splitting the buildings into common buildings and special buildings (from the special tab) might be useful and intuitive too.
     
    Endless Rain and Thunderbrd like this.
  11. Faustmouse

    Faustmouse Chieftain

    Joined:
    Jan 31, 2012
    Messages:
    3,474
    Earthbound buildings and Spacebuildings might also come in handy...
     
  12. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    4,833
    Location:
    Norway
    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: Sep 2, 2017
  13. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    23,448
    Gender:
    Male
    Location:
    Las Vegas
  14. pepper2000

    pepper2000 Chieftain

    Joined:
    Apr 14, 2013
    Messages:
    835
    The slow Sevopedia has been a problem for a long time. This is excellent.
     
  15. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    3,608
    Location:
    Poland
    Good job :D
     
  16. Endless Rain

    Endless Rain Chieftain

    Joined:
    May 21, 2016
    Messages:
    17
    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!
     
  17. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,603
    Gender:
    Male
    Location:
    Canberra, Australia
    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.
     
  18. pepper2000

    pepper2000 Chieftain

    Joined:
    Apr 14, 2013
    Messages:
    835
    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.
     
  19. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    23,448
    Gender:
    Male
    Location:
    Las Vegas
    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.
     
  20. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    3,608
    Location:
    Poland
    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: Aug 3, 2017

Share This Page