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 (PPIO)

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

  1. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    Now it works - build actions are now visible and they work too.
    I wonder if its exactly same issue as in core.

    Placeable resources depend on terrain/feature combo, I'm not sure if latitude counts here too.
    Resources are placed instantly by great farmers.

    There are no red crosses in civic screen by the way.
     
    Last edited: Jun 29, 2019
  2. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,230
    Location:
    Norway
    PPIO v0.6.2
    SVN rev.10613
    • Fixed Great Farmer.
    Latitude and all other requirements (terrain, flatland/hill, river, etc) defined for a bonus must be satisfied for the great farmer to place the bonus in the plot with PPIO.
    Without PPIO: the only requirement is that there is not another bonus in the plot already, otherwise the great farmer can place all bonuses in that plot.
    You got to have access to the bonus already, both with and without PPIO, to do this though.
     
    Last edited: Jul 10, 2019
    Harrier and raxo2222 like this.
  3. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    Ah so that's why any bonus could be placed on any tile without resource on it when I was testing stuff without PPIO.
    I was testing on Ultrafast and yeah probably that's why farmer instantly placed resource, but displayed turn timer was 2 or 3 turns as if something doesn't agree.


    By the way one line is needlessly reverted in global text (7670):
    [ICON_BULLET][COLOR_YELLOW]HELP: [COLOR_REVERT]Can remove non-state religions and associated buildings

    I intentionally added HELP: in yellow color so those could be distinguished easily from regular tags.
     
    Last edited: Jun 29, 2019
  4. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,230
    Location:
    Norway
    And I stated clearly that I didn't like it, hence why I never included that SVN change in PPIO.
     
    Last edited: Jun 29, 2019
  5. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    Looks like that line wasn't used anywhere anyway.
     
  6. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,609
    Gender:
    Male
    Location:
    Las Vegas
    Good Job Toffer! Thank you!
     
    Toffer90 likes this.
  7. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    @Toffer90

    PPIO freaks out if you pause game with pause key.

    That is while on pause clicking on city bar causes python errors.
     
    Last edited: Jun 30, 2019
  8. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    @Toffer90 is it possible to add improvement upgrade tree?
    Something like unit upgrades or building replacements.
     
  9. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,230
    Location:
    Norway
    PPIO v0.6.3
    SVN rev.10613
    • Did some work on the improvement pedia page.
     
    Last edited: Jul 5, 2019
    raxo2222 likes this.
  10. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    It happened in that save - there was error when I clicked on cities while game was paused.
     
  11. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    @Toffer90 I got this error when I clicked on Junta here.
    Spoiler :

    Civ4BeyondSword 2019-07-02 16-46-05-61.png

    This civic is separate here, as certain civics in same category are placed in different techs but in same column (or close enough for beelining to do this).

    By the way resource pages don't count buildings, that have Raw Vicinity tag.
     
    Last edited: Jul 2, 2019
  12. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    @Toffer90 there is graphical bug with Djene mosque in Python
    I'm not sure where it would be without PPIO, but with PPIO its in CvEventManager.Py

    CyInterface().addMessage(iPlayer,False,15,TRNSLTR.getText("TXT_KEY_DJENNE_PYTHON",()),'',0,'Art/Interface/Buttons/Buildings/Djenne.dds',ColorTypes(44), X, Y, True,True)

    must be converted to:

    CyInterface().addMessage(iPlayer,False,15,TRNSLTR.getText("TXT_KEY_DJENNE_PYTHON",()),'',0,'Art/Interface/Buttons/Great_Wonders/great_mosque_of_djenne.dds',ColorTypes(44), X, Y, True,True)
     
  13. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    Already fixed that one in SVN.
     
  14. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    It works now :D
     
  15. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,230
    Location:
    Norway
    PPIO v0.6.4
    SVN rev.10654
    • Fixed an issue with the simple civic screen.
     
    Last edited: Jul 7, 2019
    raxo2222 likes this.
  16. tmv

    tmv Emperor

    Joined:
    Nov 24, 2015
    Messages:
    1,255
    Gender:
    Male
    Location:
    Germany
    There is something wrong with the version number.
     
  17. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,230
    Location:
    Norway
    So there was. ^^

    v0.6.1.2 was supposed to be v0.6.2 as it was the version after v0.6.1.13, I guess things went a bit too fast that day.

    PPIO v0.6.4.1
    SVN rev.10654
    • Fixed NPC teams appearing in top civ ranking pop ups.
    • Made the intervals between each time the top civ ranking pops up a bit random, between 40-60 turns.
      • After loading a game it will always pop up at the first turn number that is a multiplication of 50 (turn: 50, 100, 150, 200, ..., n*50).
      • After that the randomness takes over.
    • Optimized some code here and there.
    PPIO v0.6.4.2
    SVN rev.10654
    • Removed the usage of player.getEffectiveGold() function calls, and replaced it with 1 000 000 * player.getGreaterGold() + player.getGold().
      • This should fix some strangeness, as getEffectiveGold could not return values greater than 1 000 000.
    PPIO v0.6.4.3
    SVN rev.10654
    • Managed to somehow mix "MToS-PPIO patch" python into PPIO by mistake sometime after v0.6.4. ▬ Fixed.
      • Caused issues with getting the tribal guardian unit when settling first city among other small issues.
      • This is what I get for modding two modmods, a patch between the two, as well as the svn at the same time.
      • Gotta keep it more separated from now on so it doesn't start spinning. ^^
    PPIO v0.6.4.4
    SVN rev.10654-10663
    • Brightened the color of very dark civs in the scoreboard to increase readability for some nations who have very dark colors.
      • The color in the scoreboard may not match exactly the color of cultural borders, but I tried to change hue as little as possible by adding the same amount of color to the red, blue and green as much as that was possible.
    Spoiler Quite the funky code for this :
    Code:
    iPlayerRed        = CyPlayer.getPlayerTextColorR()
    iPlayerGreen    = CyPlayer.getPlayerTextColorG()
    iPlayerBlue        = CyPlayer.getPlayerTextColorB()
    iSum = iPlayerRed + iPlayerGreen + iPlayerBlue
    if iSum < 360:
        iAddRed = iAddGreen = iAddBlue = iAdd = (360 - iSum)/3
    
        while True:
    
            if iPlayerRed + iAddRed > 255:
                iAdd = (iAddRed - (255 - iPlayerRed))/2
                if not iAdd:
                    iAdd = 1
                if not iAddGreen or not iAddBlue:
                    iAdd *= 2
                    if iAddGreen:
                        iAddGreen += iAdd
                    elif iAddBlue:
                        iAddBlue += iAdd
                else:
                    iAddGreen += iAdd
                    iAddBlue += iAdd
                iAddRed = 0
                iPlayerRed = 255
    
            elif iPlayerGreen + iAddGreen > 255:
                iAdd = (iAddGreen - (255 - iPlayerGreen))/2
                if not iAdd:
                    iAdd = 1
                if not iAddRed or not iAddBlue:
                    iAdd *= 2
                    if iAddRed:
                        iAddRed += iAdd
                    elif iAddBlue:
                        iAddBlue += iAdd
                else:
                    iAddRed += iAdd
                    iAddBlue += iAdd
                iAddGreen = 0
                iPlayerGreen = 255
    
            elif iPlayerBlue + iAddBlue > 255:
                iAdd = (iAddBlue - (255 - iPlayerBlue))/2
                if not iAdd:
                    iAdd = 1
                if not iAddRed or not iAddGreen:
                    iAdd *= 2
                    if iAddRed:
                        iAddRed += iAdd
                    elif iAddGreen:
                        iAddGreen += iAdd
                else:
                    iAddRed += iAdd
                    iAddGreen += iAdd
                iAddBlue = 0
                iPlayerBlue = 255
            else:
                break
    
        iPlayerRed += iAddRed
        iPlayerGreen += iAddGreen
        iPlayerBlue += iAddBlue
    
    
     
    Last edited: Jul 10, 2019
  18. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    Index page now loads almost instantly - that one with 13000 entries, its accessed on bottom left of pedia.
    Now I wonder if you or @alberts2 speeded it up somewhere in code :D
     
  19. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    Weird, I remember, that it took more time to open it for me before, like 5 - 10 seconds.
     
  20. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,618
    Location:
    Poland
    I guess I remembered wrongly when I opened it last time :lol:
     

Share This Page