View Full Version : Help diagnosing CTD


ripple01
Mar 18, 2007, 07:13 PM
Hi all,

I have a mod I'm working on, and I'm having a hard CTD that I can't diagnose. I have checked that all my techs have valid paths and I've checked my unit upgrade paths and they all seem to be OK. I can't pin down an exact building, unit, or tech that causes the crash. The crash is consistently happening around the 14 - 1500's. I've checked all the techs around there and I don't see any problems.

Anyone have any suggestions to fix this?

Thanks,
ripple01

woodelf
Mar 18, 2007, 07:20 PM
Most hard CTDs that I've encountered are caused by a graphic that is trying to be used for the first time, whether it be building, unit, or other. Save your game right before the CTD and look in the WB to see what every city is about ready to complete. There's a good chance that someone is 1 turn away from completing something that is causing the crash.

ripple01
Mar 18, 2007, 07:23 PM
woodelf,

Thanks for the quick reply, I've done as you suggested prior to posting and I didn't see anything being built that was new to the map. I've simmed a few different games and I didn't see anything consistent between the games that pointed to any one building or unit.

cheers,
ripple01

asioasioasio
Mar 19, 2007, 06:54 AM
Try to remove new units' graphics from mode, and slowly add - using elmination method you can get wich unit makes trouble.

Using method of elimination you can check .xml files

ripple01
Mar 19, 2007, 04:58 PM
Is it possible for a unit to show up correctly in the Worldbuilder but still crash the game? I ask because I tried to add all of the units I've added in the Worldbuilder and everything seemed to work OK.

Also, the game saves a dump file when it crashes, but I can't open it. Would the dump file point to what the problem is?

Cheers,
ripple01

Mexico
Mar 19, 2007, 05:27 PM
Is it possible for a unit to show up correctly in the Worldbuilder but still crash the game? I ask because I tried to add all of the units I've added in the Worldbuilder and everything seemed to work OK.

Cheers,
ripple01

yes, it is possible - wrong definition of button, missing animation ...

ripple01
Mar 20, 2007, 07:42 AM
OK, well I've discovered that the crash is being caused by a Canoe unit that I added, whenever I select it to build from the city screen or the choice screen that comes up between turns, the game freezes.

Here's what I'm using for ArtDefines and Unit:

ArtDefines:

<UnitArtInfo>
<Type>ART_DEF_UNIT_CANOE</Type>
<fScale>0.22</fScale>
<fInterfaceScale>0.8</fInterfaceScale>
<NIF>Art/Units/Canoe/Canoe2.nif</NIF>
<KFM>Art/Units/Galley/Galley.kfm</KFM>
<SHADERNIF>Art/Units/Canoe/Canoe2.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/GalleyShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<iDamageStates>4</iDamageStates>
<TrailDefinition>
<Texture>Art/Shared/water_ship_wake.dds</Texture>
<fWidth>1</fWidth>
<fLength>180.0</fLength>
<fTaper>1</fTaper>
<fFadeStartTime>.2</fFadeStartTime>
<fFadeFalloff>0.35</fFadeFalloff>
</TrailDefinition>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bSmoothMove>1</bSmoothMove>
<fAngleInterpRate>720.0</fAngleInterpRate>
<fExchangeAngle>25.0</fExchangeAngle>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop>LOOPSTEP_OCEAN1</AudioRunTypeLoop>
<AudioRunTypeEnd>ENDSTEP_OCEAN1</AudioRunTypeEnd>
</AudioRunSounds>
<SelectionSound>AS3D_UN_OCEAN_END1</SelectionSound>
<ActionSound>AS3D_UN_OCEAN_END1</ActionSound>
</UnitArtInfo>

UnitInfos:

<UnitInfo>
<Class>UNITCLASS_CANOE</Class>
<Type>UNIT_CANOE</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_NAVAL</Combat>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_ASSAULT_SEA</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_CANOE</Description>
<Civilopedia>TXT_KEY_UNIT_CANOE_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_CANOE_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>0</bNoCapture>
<bRivalTerritory>0</bRivalTerritory>
<bMilitaryHappiness>0</bMilitaryHappiness>
<bMilitarySupport>1</bMilitarySupport>
<bMilitaryProduction>1</bMilitaryProduction>
<bPillage>1</bPillage>
<bSabotage>0</bSabotage>
<bDestroy>0</bDestroy>
<bStealPlans>0</bStealPlans>
<bInvestigate>0</bInvestigate>
<bCounterSpy>0</bCounterSpy>
<bFound>0</bFound>
<bGoldenAge>0</bGoldenAge>
<bInvisible>0</bInvisible>
<bFirstStrikeImmune>0</bFirstStrikeImmune>
<bNoDefensiveBonus>0</bNoDefensiveBonus>
<bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bFlatMovementCost>0</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>0</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>1</bMechanized>
<bRenderBelowWater>1</bRenderBelowWater>
<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_CARAVEL</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>
<UnitClassTargets/>
<UnitCombatTargets/>
<UnitClassDefenders/>
<UnitCombatDefenders/>
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_ASSAULT_SEA</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_SETTLER_SEA</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
</UnitAIs>
<NotUnitAIs/>
<Builds/>
<ReligionSpreads/>
<GreatPeoples/>
<Buildings/>
<ForceBuildings/>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqBuilding>NONE</PrereqBuilding>
<PrereqTech>TECH_FISHING</PrereqTech>
<TechTypes/>
<BonusType>NONE</BonusType>
<PrereqBonuses/>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>10</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iMinAreaSize>20</iMinAreaSize>
<iMoves>1</iMoves>
<iAirRange>0</iAirRange>
<iNukeRange>-1</iNukeRange>
<iWorkRate>0</iWorkRate>
<iBaseDiscover>0</iBaseDiscover>
<iDiscoverMultiplier>0</iDiscoverMultiplier>
<iBaseHurry>0</iBaseHurry>
<iHurryMultiplier>0</iHurryMultiplier>
<iBaseTrade>0</iBaseTrade>
<iTradeMultiplier>0</iTradeMultiplier>
<iGreatWorkCulture>0</iGreatWorkCulture>
<TerrainImpassables>
<TerrainImpassable>
<TerrainType>TERRAIN_OCEAN</TerrainType>
<bTerrainImpassable>1</bTerrainImpassable>
</TerrainImpassable>
</TerrainImpassables>
<FeatureImpassables/>
<iCombat>1</iCombat>
<iAirCombat>0</iAirCombat>
<iAirCombatLimit>0</iAirCombatLimit>
<iXPValueAttack>4</iXPValueAttack>
<iXPValueDefense>2</iXPValueDefense>
<iFirstStrikes>0</iFirstStrikes>
<iChanceFirstStrikes>0</iChanceFirstStrikes>
<iInterceptionProbability>0</iInterceptionProbability>
<iEvasionProbability>0</iEvasionProbability>
<iWithdrawalProb>0</iWithdrawalProb>
<iCollateralDamage>0</iCollateralDamage>
<iCollateralDamageLimit>0</iCollateralDamageLimit>
<iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iAnimalCombat>0</iAnimalCombat>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<TerrainNatives/>
<FeatureNatives/>
<TerrainDefenses/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods/>
<UnitCombatCollateralImmunes/>
<DomainMods/>
<BonusProductionModifiers/>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>SPECIALUNIT_PEOPLE</SpecialCargo>
<DomainCargo>DOMAIN_LAND</DomainCargo>
<iCargo>1</iCargo>
<iConscription>0</iConscription>
<iCultureGarrison>0</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>1</iAsset>
<iPower>2</iPower>
<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>2.25</fMaxSpeed>
<iMeleeWaveSize>1</iMeleeWaveSize>
<iRangedWaveSize>1</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_CANOE</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>,Art/Interface/Buttons/Units/Canoe.dds</Button>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions/>
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
</UnitInfo>

ripple01
Mar 21, 2007, 05:23 PM
This has really got me stumped, the unit works fine if I place it in the worldbuilder and go back to the game, the only place it crashes is when I select it to be built....

Anyone have any suggestions on why this particular unit would be crashing my game?

Cheers,
ripple01

woodelf
Mar 21, 2007, 05:33 PM
What happens if you simply swap the canoe for an existing unit to simply test the unit in game? Not a permanent change, but have it be a galley and make sure the graphic end is fine via WB and from the build option.

strategyonly
Mar 21, 2007, 05:37 PM
Is this Vanilla or Warlords??

ripple01
Mar 21, 2007, 06:37 PM
I tried what woodelf suggested, and it leads me to believe there is something wrong with the code.

First, I put the galley artwork in the ART_DEF for the canoe, and started a new game. Tried to build the canoe and got a CTD. I then switched them around and tried the canoe artwork on the galley ART_DEF. I was able to build the galley and the canoe artwork displayed fine.

I also tried to remove the upgrade in UnitInfos thinking it could be a problem with the upgrades, but that didn't solve the problem either.

This is frustrating...

ripple01

ripple01
Mar 21, 2007, 06:37 PM
BTW, the mod is for Warlords...

strategyonly
Mar 21, 2007, 06:52 PM
Try taking the , out?

<Button>,Art/Interface/Buttons/Units/Canoe.dds</Button>
<Button>Art/Interface/Buttons/Units/Canoe.dds</Button>

woodelf
Mar 21, 2007, 07:10 PM
I'm not sure about the ",", but I'd try that too. It has caused numerous issues in the past. :(

ww2commander
Mar 21, 2007, 07:12 PM
I agree with strategyonly. I learnt to add units last night and the "," before the button path will cause a CTD if you click on the unit in the city build screen.

If the unit crashes when placing it on the map via the world builder then more than likely it is the Artdefine or unit XML files. It took a lot of trial and error to figure out the crashes but you will get there in the end.

ripple01
Mar 21, 2007, 07:28 PM
Wow, that totally fixed the problem, thanks everybody.

You learn something new every day doing this!

Cheers,
ripple01

ww2commander
Mar 21, 2007, 07:35 PM
Not specifically relating to your problem but could be useful for those that stumble on this thread...if you get a red dot instead of the unit graphics on the map then it more than likely means you made an error when specifying the directory path to the nif/klm files. Also I found out the hardway that the XML is case sensative with the filenames so take note of exact spelling people use.

Hope this helps others. :)