Help finding a crash in a mod when launching a custom game

chriscisco

Chieftain
Joined
Oct 2, 2014
Messages
13
Hey,

I am working on a mod, but for some reason the game is crashing when I try and launch the scenario today. There are no crash logs or errors in any the game logs that I can find. The game just stops responding after clicking the start button.

I believe it has something to do with the French civilization I have added today, but I cannot find the cause. (Being it is the only thing I added today, other than refactoring the localization files, and creating a better file structure for the mod.) I have copy and pasted in from a working new civ the United Kingdom and changed all the relevant data.

Link to Mod

I think I covered everything so far, if you have any questions I will be happy to answer them.

Any help would be great.

Thanks in advance.


So I decided to debug this issue, I compiled the DLL's and replaced the CvGameCore_Expansion2.dll with my compiled version and transferred the pdb file to the same directory. Then I ran the game and caused the crash again and it seems to be crashing here:

Spoiler :

int CvUnitClassInfo::getMaxTeamInstances() const
{
return m_iMaxTeamInstances;
}


The top of the call stack is this:

Spoiler :

> CvGameCore_Expansion2.dll!CvPlayerColorInfo::GetColorTypeSecondary() Line 1666 C++
CvGameCore_Expansion2.dll!CvPlot::seeFromLevel(TeamTypes eTeam=19) Line 1297 + 0x16 bytes C++
CvGameCore_Expansion2.dll!CvPlot::changeAdjacentSight(TeamTypes eTeam=19, int iRange=2, bool bIncrement=true, InvisibleTypes eSeeInvisible=-1, DirectionTypes eFacingDirection=-1, bool bBasedOnUnit=true) Line 1396 C++
CvGameCore_Expansion2.dll!CvUnit::setXY(int iX=46, int iY=39, bool bGroup=false, bool bUpdate=false, bool bShow=false, bool bCheckPlotVisible=false, bool bNoMove=false) Line 12955 C++
CvGameCore_Expansion2.dll!CvUnit::initWithNameOffset(int iID=8192, UnitTypes eUnit=143, int iNameOffset=-1, UnitAITypes eUnitAI=UNITAI_MERCHANT, PlayerTypes eOwner=16, int iX=46, int iY=39, DirectionTypes eFacingDirection=-1, bool bNoMove=false, bool bSetupGraphical=true, int iMapLayer=0, int iNumGoodyHutsPopped=0) Line 403 C++
CvGameCore_Expansion2.dll!CvUnit::init(int iID=8192, UnitTypes eUnit=143, UnitAITypes eUnitAI=UNITAI_MERCHANT, PlayerTypes eOwner=16, int iX=46, int iY=39, DirectionTypes eFacingDirection=-1, bool bNoMove=false, bool bSetupGraphical=true, int iMapLayer=0, int iNumGoodyHutsPopped=0) Line 347 C++
CvGameCore_Expansion2.dll!CvPlayer::initUnit(UnitTypes eUnit=143, int iX=46, int iY=39, UnitAITypes eUnitAI=UNITAI_MERCHANT, DirectionTypes eFacingDirection=-1, bool bNoMove=false, bool bSetupGraphical=true, int iMapLayer=0, int iNumGoodyHutsPopped=0) Line 3245 C++
CvGameCore_Expansion2.dll!CvPlayer::addFreeUnit(UnitTypes eUnit=143, UnitAITypes eUnitAI=UNITAI_MERCHANT) Line 1608 + 0x24 bytes C++
CvGameCore_Expansion2.dll!CvTeam::processTech(TechTypes eTech=12, int iChange=1) Line 6157 C++
CvGameCore_Expansion2.dll!CvTeam::setHasTech(TechTypes eIndex=12, bool bNewValue=true, PlayerTypes ePlayer=16, bool bFirst=false, bool bAnnounce=false) Line 5238 C++
CvGameCore_Expansion2.dll!SetPlayerInitialItems(CvPlayer & kGameplayPlayer={...}, const CvWorldBuilderMap::player & kSavedPlayer={...}) Line 527 + 0x14 bytes C++
CvGameCore_Expansion2.dll!CvWorldBuilderMapLoader::SetInitialItems(bool bFirstCall=true) Line 558 + 0x25 bytes C++
CvGameCore_Expansion2.dll!CvWorldBuilderMapLoader::InitMap() Line 1021 C++
CvGameCore_Expansion2.dll!CvGame::InitMap(CvGameInitialItemsOverrides & kGameInitialItemsOverrides={...}) Line 449 C++
CvGameCore_Expansion2.dll!CvGame::init2() Line 388 + 0x14 bytes C++
CvGameCore_Expansion2.dll!CvDllGame::Init2() Line 306 C++


My best guess would be something to do starting the map and maybe to many teams? I am not sure how exactly.


Edit: Actually I think the line the application break's on is not correct the call stack seems to suggest an issue with player color.

I think this call stack is kinda useless actually, maybe not.

CvPlayerColorInfo::GetColorTypeSecondary() is on line 6616 of CvInfos and not line 1666 which was the code above this. And both of the lines that come up are just Getters which would be unlikely to crash the game as they are just returning a value.

I removed the french civilization since it was after that the problem occured and it still occurs now, my only guess left is there is something wrong with the map. However it does not crash the editor.


[SOLVED]

I deleted the cache and it is working now.

[NOT SOLVED]

Did not actually work. It loaded an old version.

Edit:

I am reasonable sure that it is a map issue and not the mod files.


[SOLVED] For real this time :)

so I was going back through the mini dump and I noticed that it was crashing on placing a merchant, I guess I had set Romania to be Venice, changed that and it seems to load every time now. Back to development finally.
 
Top Bottom