Python Performance and Interface Overhaul (PPIO)

I'm going to be making some changes to the dll for some new features. I'd like to merge my python changes to master. I think i only touch the updateSelectionButtons method. Do you think it will be safe to do?
You would have to be more specific if you want me to comment on the safety of it.

I would be okay with you moving most of the "selection button" code into the dll, and have CvMainInterface.updateSelectionButtons(...) initiate when the dll will execute that code.
 
Last edited:
Nah I won't be moving any python code to dll. Just adding new features like a 'build-all' button. I was just wondering if you touched the updateSelectionButtons method at all in your mod.
 
I was just wondering if you touched the updateSelectionButtons method at all in your mod.
Only minor stuff related to the positioning of the buttons depending on resolution used.

PPIO v0.5.9.5.4.1
  • Added the new tooltip to stuff within Worker Builds pedia pages.
  • Worker builds pages now load noticeably faster.
  • Clicking lef/right arrow or "A"/"D" keys is now the same as clicking the "Back" and "Forward" button in the pedia.
PPIO v0.5.9.5.4.2
  • Added the new tooltip to promotion pedia pages.
 
Last edited:
@raxo2222: Could you test makotech222 latest modification?

See if it has any bugs, shortcomings or any other things you would like to point out about it.
I'm kinda delegating the task of in-game "quality control" to you. I don't have too much time to check it out atm.

Keep in mind that makotech only made changes to the bottom mid panel where you select what to build/train within the city screen.
Just let his CvMainInterface.py file overwrite mine.
 
@raxo2222: Could you test makotech222 latest modification?

See if it has any bugs, shortcomings or any other things you would like to point out about it.
I'm kinda delegating the task of in-game "quality control" to you. I don't have too much time to check it out atm.

Keep in mind that makotech only made changes to the bottom mid panel where you select what to build/train within the city screen.
Just let his CvMainInterface.py file overwrite mine.
He also did DLL changes, that weren't compiled too.

-----
When adding buildings/units to queue they just swap places when holding shift or ctrl keys.
They should be added to beginning/end of queue.
This happens frequently.

I noticed, that you can now rightclick unbuildable items too.

Horizontal bar is unnedeed. Also scaling could be used, so you can see four row of items completely.

Spoiler :
Civ4BeyondSword 2018-08-14 16-42-09-42.jpg
 
Last edited:
Don't worry about that, it is somewhat irrelevant to what I'm asking you to test, which is found attached to this post: Link (only 1 python file)
Scrolling now is smoother now.

Also those unit/building/wonder button right at those icons now don't jump across list.
Just bar over icons changes making wonder button useless.

Filters is bit slow and building queue slows down when adding more entries.
 
PPIO v0.5.9.5.4.2
  • Rewrote the City Queue HUD.
    • Jump to pedia right click functionality.
    • New tooltip implemented.
    • Should be more performance friendly than what was before.
  • Don't think there is anything else to note...
    • Old version still available in case of major bugs.
@makotech222, you may want to test your modification with the latest change, I made changes to CvMainInterface, nothing that should crash with yours but it is quite related.
 
Sure will do. Is the City Queue the thing on the bottom left?

Edit: also, i've been meaning to push my changes to master, just haven't gotten around to it because my files are a mess right now :p
 
Regarding City Queue: Seems quite a bit faster when adding buildings to it. But i would suggest fixing the flickering when redrawing every time it changes. I haven't looked at the code for it, but if you look at my changes, I only create the main panel once, and save that information in a self variable.

Edit: I'm actually getting a bug with your new changes. Sometimes my bottom panel of available buildings/units doesn't show! Not exactly sure what the issue is yet. Haven't tried to debug.

Edit2: Heres a merged file with my changes (One thing commented out that needs dll change). If you start a new game in the information age, it seems easy to reproduce. I also had it happen when i loaded a save game (which i lost).
 

Attachments

  • CvMainInterface.rar
    40.4 KB · Views: 121
Last edited:
Regarding City Queue: Seems quite a bit faster when adding buildings to it. But i would suggest fixing the flickering when redrawing every time it changes. I haven't looked at the code for it, but if you look at my changes, I only create the main panel once, and save that information in a self variable.

Edit: I'm actually getting a bug with your new changes. Sometimes my bottom panel of available buildings/units doesn't show! Not exactly sure what the issue is yet. Haven't tried to debug.

Edit2: Heres a merged file with my changes (One thing commented out that needs dll change). If you start a new game in the information age, it seems easy to reproduce. I also had it happen when i loaded a save game (which i lost).
While you're looking at this, I would like you to consider the strong potential for out of synch errors from manipulation of this stuff. There's already one lurking there that I know about and have yet to debug. It happens when one player on the same team as the other selects a wonder to build and the other player, with his list still cached according to the last known situation, then goes in and selects the same wonder to build in one of his own cities. Soon as it's selected, there's a massive rule disagreement since only one city among both players on the same team can have that wonder in their queue and blammo an out of synch takes place which luckily can be resolved in the same round by the players if one player takes the wonder out of their city's queue.

Anyhow, that's some food for thought as to how OOS errors can pop up. In fact, if you can think of a way to fix that scenario that would be pretty awesome too. Just try not to make it impossible for multiplayer games to not experience OOS errors due to some changes here. Some laborious and time consuming methods that were originally employed MAY be due to the need to enforce synchronization.
 
Regarding City Queue: Seems quite a bit faster when adding buildings to it. But i would suggest fixing the flickering when redrawing every time it changes. I haven't looked at the code for it, but if you look at my changes, I only create the main panel once, and save that information in a self variable.
It's on my ToDo list.
Edit: I'm actually getting a bug with your new changes. Sometimes my bottom panel of available buildings/units doesn't show! Not exactly sure what the issue is yet. Haven't tried to debug.
Strange...
 
While you're looking at this, I would like you to consider the strong potential for out of synch errors from manipulation of this stuff. There's already one lurking there that I know about and have yet to debug. It happens when one player on the same team as the other selects a wonder to build and the other player, with his list still cached according to the last known situation, then goes in and selects the same wonder to build in one of his own cities. Soon as it's selected, there's a massive rule disagreement since only one city among both players on the same team can have that wonder in their queue and blammo an out of synch takes place which luckily can be resolved in the same round by the players if one player takes the wonder out of their city's queue.

Anyhow, that's some food for thought as to how OOS errors can pop up. In fact, if you can think of a way to fix that scenario that would be pretty awesome too. Just try not to make it impossible for multiplayer games to not experience OOS errors due to some changes here. Some laborious and time consuming methods that were originally employed MAY be due to the need to enforce synchronization.

That would probably need to be handled on the dll side. I think the last time i checked, there was no call to CanBuild once the button is clicked, which i thought was a bit weird. Maybe just adding that function call as a double check can fix that issue.
 
@Toffer90 I just realized that I can't easily merge my changes to master, since you've already done an extensive refactor on the CVMainInterface file that I built off of. So would it be too much hassle to at the minimum merge my changes into your mod? I want to start working on some other things but i've got all these changes checked out :p

Also, any idea why by build screen gets hidden some times?
 
@Toffer90 I just realized that I can't easily merge my changes to master, since you've already done an extensive refactor on the CVMainInterface file that I built off of. So would it be too much hassle to at the minimum merge my changes into your mod? I want to start working on some other things but i've got all these changes checked out :p
I can merge your code, but I may rewrite it extensively very soon. All this discussion about City Screen performance made me think and work on some improvements parallel with you. And I've seen several things I want to change about the selection buttons to get them to mesh better with my changes to the City Work Queue and the general framework of the CvMainInterface I've set up.
Also, any idea why by build screen gets hidden some times?
I do, and I'm working on it. It's related to the entire framework of the python file, and some interesting restructure is needed.
 
Hah, well go right on ahead. I'm definitely not good at python so some of my stuff is definitely suboptimal. Just FYI in my python file, i have an extra button to Build All, which hooks into a new dll function. If you plan on using any of my code, you can leave that commented out or something.
 
Hah, well go right on ahead. I'm definitely not good at python so some of my stuff is definitely suboptimal. Just FYI in my python file, i have an extra button to Build All, which hooks into a new dll function. If you plan on using any of my code, you can leave that commented out or something.
Ok, cool. ^^
 
So, I'm playing around with the city screen a bit. I want to have three buttons in the selection area that opens up a unique panel in the middle of the city screen listing units, buildings or Wonders available for acquisition in the city.
The dark background in the buttons brighten up a bit when the mouse is above them and brightens even more if it is clicked.
Spoiler Picture :
CityScreen.jpg
What do you think about the icons I made for the buttons?
Do you think it's a good idea to have to click a button to be able to see what the city can acquire within the given category of Units, buildings or wonders. Keep in mind that it will be good for performance to compartmentalize this stuff.
 
I think they look great. My opinion is, if you are going to need to click a button to see available stuff, you should also go ahead and do some sort of grouping/sorting functionality too. Like if I click units, I should see workers grouped, melee grouped, navy grouped, etc..

If you are going to simply display the icons like before, the way i'm currently doing it, then its probably not necessary, since performance is pretty instantaneous now.
 
I think they look great. My opinion is, if you are going to need to click a button to see available stuff, you should also go ahead and do some sort of grouping/sorting functionality too. Like if I click units, I should see workers grouped, melee grouped, navy grouped, etc..

If you are going to simply display the icons like before, the way i'm currently doing it, then its probably not necessary, since performance is pretty instantaneous now.
Space units grouped would be nice too.

There is no use of space shuttle or magnetic sail on map without space part.
Also it would be easier to find them.
 
Top Bottom