Mod Crashes at unit XML Uncache

Apple111111

Warlord
Joined
Sep 14, 2024
Messages
117
I’ve been banging my head against a brick wall with this one, since there’s no error message, even on debug mode.

It’s a massive pain. Presumably something’s wrong, but ironically, all I was editing between when I last ran Civ4 and when I got this error was DLL, Python and text files…

Maybe there was one or two XML files I edited, that caused the problem???

Has anyone had this issue before? Any clue what causes it?
 
BTW init.log says this:

[1085.187] DBG: CIV Init
[1085.187] VERSION: App: C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\beyond the sword\Civ4BeyondSword.exe
[1085.187] VERSION: Build: Thu May 29 03:28:49 2014
[1085.187] VERSION: 3.1.9.0 (128100)
[1100.843] VERSION: Mod Loaded: Mods\RFC Dawn of Civilization\
[1100.843] DBG: FILE Cat Init
 
When the game crashes with no error, you essentially have two options. One is to guess blindly and the other is to attach the debugger to catch while line in the DLL is crashing. Neither option is trivial. Your first issue is steam anti-cheat will intentionally crash the game so if you want to use it, you first need to remove the anti-cheat. Not sure how the forum views explaining how to defeat such restrictions, but there are tools to do so.

I will say vanilla is horrible at silently crashing if xml is set up in a way vanilla doesn't expect, so it's likely that the cause is xml. Also it's highly unlikely to be caused by anything in python.
 
When the game crashes with no error, you essentially have two options. One is to guess blindly and the other is to attach the debugger to catch while line in the DLL is crashing. Neither option is trivial. Your first issue is steam anti-cheat will intentionally crash the game so if you want to use it, you first need to remove the anti-cheat. Not sure how the forum views explaining how to defeat such restrictions, but there are tools to do so.

I will say vanilla is horrible at silently crashing if xml is set up in a way vanilla doesn't expect, so it's likely that the cause is xml. Also it's highly unlikely to be caused by anything in python.
I assume it’s impossible that a text file could’ve caused this?
 
I assume it’s impossible that a text file could’ve caused this?
The crash is in C++, but it can be caused by using data from elsewhere without ensuring that it is valid data. Say for instance a mod has 100 UnitClasses and 150 Units. If you enter UNIT_DRONE instead of UNITCLASS_DRONE, vanilla will quite happily use the index of the unit as a UnitClass. If it's unit 120, it will read the data for UnitClass 120, but since there are only 100, it will crash due to reading out of bounds data.

I have an ongoing project in We The People where the DLL will throw error messages if the wrong xml file is used. Takes forever to implement because it requires updating everywhere xml data is read and there is a lot of it.
 
I’ve made some progress in figuring it out, since I used the DLL on an older save I have of the mod, and it loaded without crashing, so the DLL changes I made can’t be causing it.

That means there’s something wrong with either the XML or Python. (Probably XML)
 
I managed to figured it out by chucking files into an earlier save until I found the files that actually caused the crash.

Turned out it was actually a text file, so uh, yeah.
 
Top Bottom