1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    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,503
    Location:
    Norway
    I'm working on improving the user interface 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 all interface in general.

    Works for all screen resolutions.

    These pedia pages will scale properly right now:
    ♦ INDEX
    ♦ Concepts
    ♦ Technologies
    ♦ Buildings
    ♦ Promotions
    ♦ Civics
    ♦ Corporations
    ♦ Bonuses
    ♦ Features
    ♦ Improvements
    ♦ Worker Builds
    ♦ Civilizations
    ♦ Leaderheads
    ♦ Units
    ♦ Projects​

    ♠ 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 Index now opens in a few seconds.
    ♠ Increased the quality of the pedia background picture.
    ♠ 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.

    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.
    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.
    SVN rev. 10153 or newer is required for v0.5.9.6.1.5 or newer.
    SVN compatibility broken at rev. ??? (please report when this happens for you)

    If you've played C2C without this modmod, or want to uninstall this modmod:
    Then you should delete the BUG Main Interface.ini and the CustomDomAdv folder within your UserSettings folder.
    C2C will not load with this modmod unless the mod folder is named exactly "Caveman2Cosmos".

    PPIO requires the installation of Linux Libertine G fonttype.
     

    Attached Files:

    Last edited: Oct 16, 2018 at 7:37 PM
  2. GiuseppeIII

    GiuseppeIII The Third Giuseppe

    Joined:
    Jul 12, 2011
    Messages:
    629
    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,503
    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,045
    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,475
    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 Chieftain

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

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,475
    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 Chieftain

    Joined:
    Jun 10, 2011
    Messages:
    3,011
    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,475
    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,115
    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,503
    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,045
    Gender:
    Male
    Location:
    Las Vegas
  14. pepper2000

    pepper2000 Chieftain

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

    raxo2222 Chieftain

    Joined:
    Jun 10, 2011
    Messages:
    3,011
    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,475
    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:
    823
    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,045
    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 Chieftain

    Joined:
    Jun 10, 2011
    Messages:
    3,011
    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

Ebates: Get Paid to Shop