• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Single Player bugs and crashes v39 plus (SVN) - After the 20th of July 2019

I fixed it so it won't crash, but it doesn't answer why I have never seen it before now. That might be indicative of another problem.
 
I fixed it so it won't crash, but it doesn't answer why I have never seen it before now. That might be indicative of another problem.
Nah, iCivType will most often be -1 in the early game where there's still unused player slots to pick from.
A bit later in the game when all player slots have been alive in the game at least once, then that code will start to recycle dead players, reincarnating them so to speak, and then iCivType will be > -1 and the error happens.

Another thin is that the code won't run at all if there's 25 or more players currently alive, so at that point a player needs to die off before e.g. slot 27 is filled, then another needs to die before player slot 28 gets filled etc. So it is quite rare to reach the point where all player slots have been alive player in the game at some point. There also needs to be enough barbarian cities around for the code ro create new players... etc. A lot of factors making that bug rare.
 
Last edited:
There is no limit to wonders, if you play with unlimited wonders.
This wonder count display always is here though.
<Define>
<DefineName>MAX_WORLD_WONDERS_PER_CITY</DefineName>
<iDefineIntVal>14</iDefineIntVal>
</Define>
 
Last I saw, if you Do Not have Unlimited Wonders On, you get 4 per city. Has this changed?
 
@LumenAngel
/edit
Okay I had a look again, you are just running out of memory. I can crash your game just be scrolling around the whole map. I am going to start working on memory usage straight away, but I can guarantee any time scale.

Exactly what happend this morning... Was searching for a resssource on the map -> crash when scrolling.
Even with graphism on low
 
Last I saw, if you Do Not have Unlimited Wonders On, you get 4 per city. Has this changed?
This depends on culture level - look at bottom of each culture level entry in culture level infos xml (its in gameinfo folder).
4 National Wonders is for Poor culture, and 4 World Wonder limit is for Refined culture.
You can see those values ingame even if you play with unlimited wonders on.
 
@Toffer90 is it possible to hide this wonder limit display, if playing with unlimited wonders on?
Civ4BeyondSword 2019-09-09 09-18-35-41.png
Civ4BeyondSword 2019-09-09 09-18-43-70.png

Or at least numbers, that denote current limit could be hidden.
 
Last edited:
Exactly what happend this morning... Was searching for a resssource on the map -> crash when scrolling.
Even with graphism on low
You have pushed the limits and now the piper has come asking for his pay. ;) Your game will most likely Not recover.
 
Your game will most likely Not recover.
Don't be premature, I didn't really start to look at it yet. I have so far determined that only 500MB or so of usage is allocated through the DLL (250MB of it is just arrays of ints!), such that even if we can shave off ALL allocation from the mod itself it would not be satisfactory. Instead I think we need to concentrate on improving the behaviour of the paging. Currently it appears to not be aggressive enough in freeing memory (it doesn't seem to do it at all in fact). The first thing I'm going to look at is this, I am also going to add warnings about low memory, and force the paging to free memory when it is low if such a thing is possible (I didn't look at the paging code at all yet).
 
@Toffer90 I got this python error, when I loaded one of saves.
Code:
Traceback (most recent call last):

  File "CvWBInterface", line 230, in writeDesc

  File "CvWBDesc", line 1545, in write

  File "CvWBDesc", line 1193, in write

  File "CvWBDesc", line 809, in write

UnicodeEncodeError: 'latin-1' codec can't encode character u'\u01eb' in position 17: ordinal not in range(256)
ERR: Python function writeDesc failed, module CvWBInterface
 
Don't be premature, I didn't really start to look at it yet. I have so far determined that only 500MB or so of usage is allocated through the DLL (250MB of it is just arrays of ints!), such that even if we can shave off ALL allocation from the mod itself it would not be satisfactory. Instead I think we need to concentrate on improving the behaviour of the paging. Currently it appears to not be aggressive enough in freeing memory (it doesn't seem to do it at all in fact). The first thing I'm going to look at is this, I am also going to add warnings about low memory, and force the paging to free memory when it is low if such a thing is possible (I didn't look at the paging code at all yet).
Your Magic notwithstanding, And based on history of the past performances of this Mod, his game is basically over.

We ALL await you Magic act here in this regard. If you can make the game start using the paging file memory, then the cap that has haunted us for 10+ years will be lifted off and will finally set us Free! I sincerely Hope you have success here! :please:
 
Don't be premature, I didn't really start to look at it yet. I have so far determined that only 500MB or so of usage is allocated through the DLL (250MB of it is just arrays of ints!), such that even if we can shave off ALL allocation from the mod itself it would not be satisfactory. Instead I think we need to concentrate on improving the behaviour of the paging. Currently it appears to not be aggressive enough in freeing memory (it doesn't seem to do it at all in fact). The first thing I'm going to look at is this, I am also going to add warnings about low memory, and force the paging to free memory when it is low if such a thing is possible (I didn't look at the paging code at all yet).

When playing on big maps the Viewports feature should be enabled to reduce the memory usage.

The paging can't do more then it already does because it simply hides plots from the exe. But once the exe saw a plot because of moving around on the map it loads the full graphics for that plot into it's memory. There's no way to tell the exe to clear it's memory from no longer needed textures or models and such things.
 
About saving memory.
There are some broken unused Features in C2C like the
GAMEOPTION_STRENGTH_IN_NUMBERS. That option alone uses ~140 byte per unit without ever beeing used.
 
About saving memory.
There are some broken unused Features in C2C like the
GAMEOPTION_STRENGTH_IN_NUMBERS. That option alone uses ~140 byte per unit without ever beeing used.
@Thunderbrd left options like this one, as those are his work in progress.
I guess he didn't knew, that options always use memory.

You can take look at ecological animals option for example, as this one is unused.
 
When playing on big maps the Viewports feature should be enabled to reduce the memory usage.
I will check out this feature. If it is required for large maps we should enable it automatically for these maps I guess?

There's no way to tell the exe to clear it's memory from no longer needed textures or models and such things.
Well we can call directly the function the exe is using when it deallocates these things (I guess it does this at exit at least). Of course if they aren't exposed via the DLL interface this is more difficult, but the exe code isn't changing again so function offsets and parameters are fixed. Probably this specifically will be very difficult, I need to look into the code to see what is happening before I can comment further really.

That option alone uses ~140 byte per unit without ever beeing used.
Based on the memory tracking I added (not committed yet) we haven't got much scope for solving this problem with our own data. It has to be a systemic fix to over allocating graphics memory it looks like. If that is viewports then great, we just need to make sure they work and make sure they are used. Otherwise I will be looking into other more esoteric fixes as indicated above!
 
Another thing that helps a bit is this ini setting it should be set to 1 to save some memory.
Code:
Disable PAK memory mapping (May affect performance)
DisablePAKMemoryMapping = 1
 
K, I know what's wrong and how to fix it. May have time for it today.
@Toffer90 ,

Is the removal of the arrows in City screen City Name bar to move to next city intentional? How do you while in City Screen move to next city now?
 
Back
Top Bottom