Python Performance and Interface Overhaul (PPIO)

PPIO v0.5.9.6.2.3.1
  • Polished financial advisor screen a bit.
    • Moved building expenses from the middle panel over to the right panel.
Your naming of the 7z file is wrong, I'm afraid: PPIO v0.5.9.6.3.1 in a.7z (one "2" is missing).
 
Bug report for v0.5.9.6.2.3.1

Right clicking units and civics to try and get into their pedia gives this:
Code:
Traceback (most recent call last):
  File "CvScreensInterface", line 306, in pediaJumpToUnit
  File "PediaMain", line 624, in pediaJump
  File "PediaMain", line 652, in showContents
  File "PediaMain", line 1252, in deleteAllWidgets
AttributeError: PediaMain instance has no attribute 'aWidgetBucket'
ERR: Python function pediaJumpToUnit failed, module CvScreensInterface

Code:
AttributeError: PediaMain instance has no attribute 'aWidgetBucket'
ERR: Python function handleInput failed, module CvScreensInterface
Traceback (most recent call last):
  File "CvScreensInterface", line 1096, in handleInput
  File "CvCivicsScreen", line 592, in handleInput
  File "CvCivicsScreen", line 349, in CivicsButton
  File "CvScreensInterface", line 345, in pediaJumpToCivic
  File "PediaMain", line 624, in pediaJump
  File "PediaMain", line 652, in showContents
  File "PediaMain", line 1252, in deleteAllWidgets
AttributeError: PediaMain instance has no attribute 'aWidgetBucket'
ERR: Python function handleInput failed, module CvScreensInterface

EDIT: Actually it's access to the pedia.
 
Last edited:
Lot's of odd errors here, I think I know what's up.
One of files being not here?

Also global game text was updated by me, when I added Ultrafast speed and sorted speed related text - you need to update it.
 
One of files being not here?

Also global game text was updated by me, when I added Ultrafast speed and sorted speed related text - you need to update it.
Nah, I managed to delete the same variable two times in the onClose() method of the pedia screen object. This should have produced an error about the variable not existing when deleting it the second time, but...
There were no error message like that because the python file that calls the onClose method in all the different screen objects used a " try: except: " clause in case the screen object does not have a onClose method.
The " try: except: " clause is so that if anything in inside the try: statement fails no errors will be reported and the except: clause will run instead.

Since I don't like hiding potential errors, I generally don't like using the " try: except: " clause unless the content of try: is very small and obvious to get right when first written.
In this case there could be many different small code snippets in a multitude of python files that were placed within the " try: " clause depending on which screen is closed.

I replaced the " try: except " clause with a more reliable method that should also be faster to process for the game:
if hasattr(screen, "onClose") and isinstance(screen.onClose, types.MethodType):
screen.onClose()

I've fixed the pedia issue, now I will look into the CvEventManager errors you (Raxo) reported.

an update will be up probably within an hour.

About the multithreaded issue you reported, I honestly have no idea how or why there is an issue with multithreading with my modmod.
My python code is obviously doing something the multithreaded code in the dll is seriously not expecting python to do at the time it is done; and it is causing mischief in the dll code.
Only a good dll modder could help me figure out how to fix that issue, and honestly I don't think it's worth it due to multithreading being phased out of C2C sooner or later.
 
PPIO v0.5.9.6.3.2 ▬ Hotfix
  • Fixed most errors reported since last release.
@raxo2222 : I saw in your screenshot that the financial advisor was not in fullscreen, I find this strange as it is for me on all available resolution settings.
Could you check that it is the case with this version as well?​
8800_20180909181911_1.jpg
 
Last edited:
PPIO v0.5.9.6.3.2 ▬ Hotfix
  • Fixed most errors reported since last release.
@raxo2222 : I saw in your screenshot that the financial advisor was not in fullscreen, I find this strange as it is for me on all available resolution settings.
Could you check that it is the case with this version as well?​
View attachment 503406
Weird, I'm still getting error.

Spoiler :

Civ4BeyondSword 2018-09-09 18-36-57-04.jpg


Maybe I need to start new game?
 
I was hoping that one was caused by one of the other errors that I fixed, not sure what to make of that error yet.
I'll investigate it further.
New game works, but Financial Advisor isn't full screen.
Spoiler :

Civ4BeyondSword 2018-09-09 18-44-00-61.jpg


I play on windowed mode, so tabbing out works quickly.
 
Could I get the save file for the game with the error, so I can debug a reproduction of the error.

Try changing your resolution and see if that affect the size of the screen.
I started new test game so autosaves are gone, but here is one from yesterday.

It is Medieval Era.
 
I play on windowed mode, so tabbing out works quickly.
That may be the reason for the resolution issue, I think I'm only asking the engine for the fullscreen resolution in use, not what the windowed resolution is.
Should be possible to fix, with a check for isWindowedMode and if so look at another setting instead.
 
The save you provided helped me fix the error message. ^^

Now I have to figure out the fullscreen issue you have and how to best solve it.

Edit: I tried windowed mode, and regardless of what resolution I used, the financial advisor was properly fullscreen within the game window.
Something else must be amiss....
 
Last edited:
The save you provided helped me fix the error message. ^^

Now I have to figure out the fullscreen issue you have and how to best solve it.

Edit: I tried windowed mode, and regardless of what resolution I used, the financial advisor was properly fullscreen within the game window.
Something else must be amiss....
My windowed resolution isn't exactly standard one as to fit window perfectly, otherwise some text stretching/compression is visible (this game is 14 year old after all).
Its 1280x972.
 
My windowed resolution isn't exactly standard one as to fit window perfectly, otherwise some text stretching/compression is visible (this game is 14 year old after all).
Its 1280x972.
So I take it the game doesn't even store the resolution you use in the " Users\UserName\AppData\Local\My Games\beyond the sword\Profiles\profileName.pfl " file.
That the game doesn't naively offer the resolution you want, and that you get that resolution through a launch parameter in your game shortcut; correct?
 
So I take it the game doesn't even store the resolution you use in the " Users\UserName\AppData\Local\My Games\beyond the sword\Profiles\profileName.pfl " file.
That the game doesn't naively offer the resolution you want, and that you get that resolution through a launch parameter in your game shortcut; correct?
Oh I never knew, that there is other folder.
Instead I can set custom resolution in
C:\Users\<USERNAME>\Documents\My Games\Beyond the Sword\CivilizationIV.ini
 
Instead I can set custom resolution in
C:\Users\<USERNAME>\Documents\My Games\Beyond the Sword\CivilizationIV.ini
It should be possible to read the content of CivilizationIV.ini through python....
I may just give up on trying to have the current resolution stored in a dedicated python file; and rather ask the exe every time python needs to know the resolution.
 
PPIO v0.5.9.6.3.3 ▬ Hotfix
  • Fixed financial advisor screen error that raxo got.
PPIO v0.5.9.6.3.4 ▬ Hotfix & Technical update
  • Fixed fullscreen issues when having a custom resolution set in the main .ini file that the game doesn't natively offer in vanilla option screen.
  • Fixed braindead abandon/demolish screen.
  • Lot's of new files included and modified, let's hope I included them all in the modmod zip, and that the modmod is overall stable.
  • The game will now create the UserSettings folder if it is not present in the C2C root folder.
  • Edit: Removed the BUG option hotkey reminder option.
    • The hotkey is shown in the tooltip when mouse is over the BUG option button.
A clean modmod install is necessary for this version.
Simply overwriting a preinstalled old version of this modmod will cause errors.
 
Last edited:
I got this at game start:

Traceback (most recent call last):
File "BugEventManager", line 313, in _handleDefaultEvent
File "CvEventManager", line 189, in onInit
AttributeError: 'module' object has no attribute 'init'
 
Back
Top Bottom