Single Player bugs and crashes v40 plus (SVN) - After Oct 2019

REpeatable crash . . . . . . . .
@MattCA I think this crash may be caused by some of your recent parallel map specific changes.

This code:
Code:
CvUnit* CvPlayer::addUnit()
{
#ifdef PARALLEL_MAPS
    return m_units[GC.getGame().getCurrentMap()]->add();
#else
    return m_units.add();
#endif
}
Can now return NULL, this never happened before afaik.

Edit: {
This is just a 5 minutes initial assessment. haven't used the VS debugger, just seen that this assert happen right before the CTD : ↓
CvPlayer::initUnit(....)
CvUnit* pUnit = addUnit();
FAssertMsg(pUnit != NULL, "Unit is not assigned a valid value");
And then this one right after (just a continuation of the above issue) : ↓
CvUnit::upgrade(...)
pUpgradeUnit = GET_PLAYER(getOwner()).initUnit(...)
FAssertMsg(pUpgradeUnit != NULL, "UpgradeUnit is not assigned a valid value");​
}
EditEdit:
I can't spot any errors in your change there though... Perhaps the error is caused by something unrelated.
Next step is to figure out why "T* FFreeListTrashArray<T>::add()" may return NULL; or to run the save in VS debugger and perhaps add some extra logging related to max unit counts and so on.
Maybe the array is full?
 
Last edited:
started new game and i get this after about 15 turns and then it completely stalls .. . . .

Traceback (most recent call last):
File "C2C_Tectonics", line 183, in addRivers
File "MapScriptTools", line 2177, in buildBigBogs
File "MapScriptTools", line 3145, in deleteNonBogPlots
NameError: global name 'p1' is not defined
ERR: Python function addRivers failed, module C2C_Tectonics
Traceback (most recent call last):
File "CvScreensInterface", line 514, in forceScreenRedraw
File "CvMainInterface", line 1383, in redraw
File "CvMainInterface", line 4942, in updatePlotHelp
RuntimeError: unidentifiable C++ exception



Now no matter what autosave i go to it says "You have been defeated"
 
Last edited:
started new game and i get this after about 15 turns and then it completely stalls .. . . .

Traceback (most recent call last):
File "C2C_Tectonics", line 183, in addRivers
File "MapScriptTools", line 2177, in buildBigBogs
File "MapScriptTools", line 3145, in deleteNonBogPlots
NameError: global name 'p1' is not defined"
Ok, this one was easy fix, was just a typo where pl was written as p1 in one spot.

Untitled-1.png

Not easy to spot the typo, the left one is p1 and the right one is pl. ^^
 
EditEdit: I can't spot any errors in your change there though... Perhaps the error is caused by something unrelated.
Next step is to figure out why "T* FFreeListTrashArray<T>::add()" may return NULL; or to run the save in VS debugger and perhaps add some extra logging related to max unit counts and so on.
Maybe the array is full?
That change is turned off on regular dll.
Looks like there may be a max but its hard to read.

#define FLTA_ID_SHIFT (13)
#define FLTA_MAX_BUCKETS (1 << FLTA_ID_SHIFT)
#define FLTA_INDEX_MASK (FLTA_MAX_BUCKETS - 1)
#define FLTA_ID_MASK (~(FLTA_INDEX_MASK))
#define FLTA_GROWTH_FACTOR (2)

if ((m_iNumSlots * FLTA_GROWTH_FACTOR) > FLTA_MAX_BUCKETS)
{
return NULL;
}

what does (1 << 13) mean?
 
Jeez, can't say I understand that, but that would mean the line from FFreeListTrashArray<T>::add() says:
if ((m_iNumSlots * 2) > 8192)
{
return NULL;
}

only a max of 4100 assuming 1 unit takes 1 slot. Does that sound possible? Seems low.
 
Jeez, can't say I understand tha
It's about binary math and the way numbers are stored in binary form. It's... ugly stuff.
 
It's about binary math and the way numbers are stored in binary form. It's... ugly stuff.

No - binary is lovely, used it a lot in the early 70s. :lol::crazyeye::thumbsup: :mischief::mischief::mischief:
.
 
Am I supposed to have d3dx9.dll somewhere in my civ files or is that a windows thing? I don't think I'll get a chance to see if I'm right tonight. I can make a branch if someone else wants to check. Then if I'm right I'll need to know if you guys want the max raised.
 
// Max number of barbarian units in existence for a spawn of a new one to be allowed
// This allows a 'space' for 'real' barbarians to be built before we use up the entire
// simultaneous unit space of 8191 for any one player
#define MAX_BARB_UNITS_FOR_SPAWNING 7000
 
new SVN didnt change the crash, it still crashes . .
Yes, I know. It looks like you have reached a maximum limit for number of units a player can have before the game CTD's.
Your save is kinda fried, but maybe you can salvage it by deleting 1 or 2 thousand units from the map, take more from the players that have the most.

We might be able to fix the root problem, but it will take more than 1 day.
There are two ways to respond to this CTD, one is to raise the max limits if possible, the other is to write AI code to delete or stop training units more appropriately so that AI's manage their unit counts more reasonably.
The latter approach is more complex and will take longer time.
 
Yes, I know. It looks like you have reached a maximum limit for number of units a player can have before the game CTD's.
Your save is kinda fried, but maybe you can salvage it by deleting 1 or 2 thousand units from the map, take more from the players that have the most.

We might be able to fix the root problem, but it will take more than 1 day.
There are two ways to respond to this CTD, one is to raise the max limits if possible, the other is to write AI code to delete or stop training units more appropriately so that AI's manage their unit counts more reasonably.
The latter approach is more complex and will take longer time.
Yeppers , deleted a whole civ and a few of the biggest pop cities and it worked then, so u r correct then. . . thx . .


EDIT: but then after the first turn after deleting them, it crashed again??
 

Attachments

  • US.zip
    4.1 MB · Views: 39
In game version v40.1.2555 I had wondered why my resources where not connected over the ocean despite having the necessary tech to trade over ocean and my cities have trade routes that go over the ocean.
Today I updated to the newest SVN and made the recalculation and suddenly the 2 city on the isle that are only connected trough the ocean have all the resources available there as well.
If there was a fix on this issue then forget about this report otherwise you might want to check if there is a issue on the turn updates with trade over the ocean.
(Note for my self: I updated after the AD 851 save in case the team need a save)
 
In game version v40.1.2555 I had wondered why my resources where not connected over the ocean despite having the necessary tech to trade over ocean and my cities have trade routes that go over the ocean.
Today I updated to the newest SVN and made the recalculation and suddenly the 2 city on the isle that are only connected trough the ocean have all the resources available there as well.
If there was a fix on this issue then forget about this report otherwise you might want to check if there is a issue on the turn updates with trade over the ocean.
(Note for my self: I updated after the AD 851 save in case the team need a save)

You really need to do what this link shows on how to set up and use the SVN to keep your copy of Caveman2Cosmos up to date and current with bug fixes applied. https://forums.civfanatics.com/threads/c2c-svn-changelog.429816/

You version is 240 iterations Old now. Many fixes and changes have happened since v40.1.2555.
 
I decided that I get the newest version when I start a game but then only update when I encounter some really troublesome bugs. The reason is that when keeping the game on the newest svn it changed the game to much in my past games when it takes me months to play a single one. (i.e. Units got stronger / weaker, important buildings / unit complete changed where they are in the tech tree and so on). Also didn't the team recently made a change that where broken to the point where it was told to not update the games to the current svn for a time?
 
The Toxic Waste Dump national wonder doesn't seem to do anything positive... did someone forget a stat or two? I am not going to build it in its current state. I am not sure what kind of waste values exist but it should probably nationally lower city waste (unhealthy values), bio-hazardous waste, and nuclear waste for the negatives that it gives. If you want me to fix it I can (and perhaps will anyway since right now I have a significant unhealthy issue.)
 
The Toxic Waste Dump national wonder doesn't seem to do anything positive... did someone forget a stat or two? I am not going to build it in its current state. I am not sure what kind of waste values exist but it should probably nationally lower city waste (unhealthy values), bio-hazardous waste, and nuclear waste for the negatives that it gives. If you want me to fix it I can (and perhaps will anyway since right now I have a significant unhealthy issue.)
I'm pretty sure it is meant to enable positive buildings to be built in all other cities once you've built that somewhere. It's a 'NIMBY' building (Not In My Back Yard) that is meant to suck for the city you place it in but give benefits to everywhere else. If those benefits aren't obvious, it's probably due to the buildings it enables not being mentioned except in those buildings.
 
Top Bottom