Assert Debugging

stolenrays

Deity
Joined
Aug 2, 2009
Messages
2,063
I'm getting tons of Assert failures when debugging my SDK of my IIW Mod. Each type triggers like 50 times each.

The one I think is most critical happens right before a CTD. It says that I have more than 42 options. However, I can't find the xml entry to change the max amount. Anybody know what to do? Either I find it or delete some options I guess.

I have two other asserts that are annoying. One seems to do with constructing buildings and the other is from the Commander mod. I've attached the screenshots in the hopes people might know more about it. The last one I think just means there is some commenting in the XML?

The CTD usually happen on the 2nd or 3rd turn after pressing turn button.

The plot Assert happens when a tanker, which can be captured, is attacked/destroyed.
 

Attachments

  • Assert.jpg
    Assert.jpg
    91.2 KB · Views: 70
  • commanders.jpg
    commanders.jpg
    87.8 KB · Views: 114
  • Untitled.jpeg
    Untitled.jpeg
    436.3 KB · Views: 68
  • ctd3a.jpeg
    ctd3a.jpeg
    433.8 KB · Views: 52
  • CTD3b.jpeg
    CTD3b.jpeg
    464.5 KB · Views: 64
I think so. I haven't checked it out yet, but there are no NONE's in BuildingInfos other than specialbuilding.

In addition, I get the dreaded exceeded compiler limit error with 2008 express so I have to fix that before I try it out (deleting stuff just messes my release dll up).
 
I think the commander error is because it is expecting a xml tag entry with at least 0, but there is no tag in some entries?

Anyhow here are some more assert failures I have. Some are from BBTSAI. Maybe somebody has a clue:

Spoiler :
Assert Failed

File: CvUnit.cpp
Line: 12862
Expression: !at(iX, iY)
Message:

Assert Failed (From TLO Promotions Tags)

File: CvUnit.cpp
Line: 13374
Expression: pOldPlot != pNewPlot
Message:

----------------------------------------------------------

FAssert(iParatrooperCount > 0); (From TLO Promotions Tags)

Assert Failed (From Advanced Cargo)

File: CvUnitAI.cpp
Line: 21093
Expression: totalCargoSpace() > 0
Message:

----------------------------------------------------------

Assert Failed

File: CvUnitAI.cpp
Line: 11943
Expression: canDefend()
Message:


bool CvUnitAI::AI_airDefensiveCity()
{
//PROFILE_FUNC();

CvCity* pCity;
CvCity* pLoopCity;
CvPlot* pBestPlot;
int iValue;
int iBestValue;
int iLoop;

FAssert(getDomainType() == DOMAIN_AIR);
FAssert(canAirDefend());

----------------------------------------------------------


Assert Failed

File: CvUnitAI.cpp
Line: 11942
Expression: getDomainType() == DOMAIN_LAND
Message:

----------------------------------------------------------

bool CvUnitAI::AI_guardCity(bool bLeave, bool bSearch, int iMaxPath)
{
PROFILE_FUNC();

CLLNode<IDInfo>* pUnitNode;
CvCity* pCity;
CvCity* pLoopCity;
CvUnit* pLoopUnit;
CvPlot* pPlot;
CvPlot* pBestPlot;
CvPlot* pBestGuardPlot;
bool bDefend;
int iExtra;
int iCount;
int iPathTurns;
int iValue;
int iBestValue;
int iLoop;

FAssert(getDomainType() == DOMAIN_LAND);


Assert Failed (From TLO Tags)

File: CvUnit.cpp
Line: 13374
Expression: pOldPlot != pNewPlot
Message:

----------------------------------------------------------
 
I updated where some of the asserts are coming from. Some comre from TLO Promotions & 1 from advanced Cargo.

The onslaught comes from Commanders and the best soln so far from the creator was to remove the tag.

Cybah also suggested to just remove the Paradrop tag.
 
More Asserts I found:
Spoiler :
File: CvPlayer.cpp
Line: 6602
Expression: GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(eUnitClass) == eUnit
Message:

Assert Failed

File: CvInitCore.cpp
Line: 1118
Expression: eIndex < NUM_GAMEOPTION_TYPES
Message: Index in CvInitCore::getOption expected to be < 42

----------------------------------------------------------

Assert Failed

File: CvGlobals.cpp
Line: 1475
Expression: eUnitNum > -1
Message:

----------------------------------------------------------

Assert Failed

File: CvUnit.cpp
Line: 12862
Expression: !at(iX, iY)
Message:


I figured out another way around the paratrooper assert. I believe that the code is written so the promotion is only available to units using the PARADROP AI. If you take that check out for paratroopers and then Give all paratroopers a dummy prereq promotion that is not available elsewise, you can circumvent the problems and still have the promo.

My CTD, which happens upon city conquest:

Spoiler :
CvSting.h

const CvWString& operator=( const CvWString& w) { assign(w.c_str()); return *this; }
 

Attachments

  • CTD.jpg
    CTD.jpg
    134.7 KB · Views: 38
Back
Top Bottom