challenge for total conversion gurus

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
This has nothing to do directly with FFH, but there are more mod experts here than any other sub-forum.

I have spent about a month working on a total conversion and I am about to give up. I am not making any SDK or python changes, only XML, and the game crashes when I make simple modifications. I have written a preprocessor to catch missing references which should be caught by the game engine but are not. Still, I get a reproducible crash after changing only 8 XML files, which goes away if I change back one of the files.

Can anybody suggest a debugging technique to solve this problem? The details including a zipfile with the changes and a crashing savegame are in this post, details obviously in the rest of its thread.
 
Which files have you changed? It would be easier to know what is wrong if we had some more info.

There are some things firaxis hardcoded in the the game. For example, you need to have a barbarian state and a barbarian leader.
 
All the details are in the other thread which I linked. Basically I have deleted all but a dozen of the units and all but a dozen of the buildings, and then changed about six other files to clean up the references like removing all the UU and UB from civilizations, for example.

Please see that thread for the details and the example files.

Are there other threads which list the hardcoded requirements?
 
All the details are in the other thread which I linked. Basically I have deleted all but a dozen of the units and all but a dozen of the buildings, and then changed about six other files to clean up the references like removing all the UU and UB from civilizations, for example.

Please see that thread for the details and the example files.

Are there other threads which list the hardcoded requirements?

By the looks of the file you've posted, you're implementing the changes as "CustomAssets" rather than a mod? If you're making a lot of changes, it might help to make it an actual mod - simply to keep things neat (it's possible for CustomAssets to interfere with other mods etc - depends on how you have it setup but that can make debugging a nightmare).

In anycase, you mentioned that you can "change one file back to stop the crashes" - if you know which of the files you can revert to prevent the crash issue, then revert that file and then re-add your changes one at a time until the crash reoccurs. Normally with this approach you'll notice the mistake when you re-add it - doesn't generally get as far as the crashing.
 
Thanks for the suggestion. In order to make my example as easy to reproduce as possible, I put it into customassets instead of a new mod directory. Also, the 8th file I changed was unitinfos, and the change was to remove about 100 units. I spent some time adding back 50, seeing if it crashes, then removing 25, it didn't crash, putting them back, and so on. However, after several hours of these tedious experiments, I was no closer to understanding what was actually wrong. I was hoping there is a better way.
 
Could you provide a zip as just a plain mod? I haven't ever touched the customassets, so I don't know if the rules are precisely the same. I know that for a mod it'll often look for data from the base game if you haven't specifically overwritten it, or turned that function off. Your folders are so bare that I am assuming you are keeping most of base Civ, but the way you explain yourself it sounds like you MEAN to have the game be sparse. So exactly how trimmed down is it supposed to be at this point?

Anyway, I was going to run a few tests myself since I am needing a break from my own work, but it would seem that I overwrote Firaxis's DLL sometime in the past with one of my own, and thus the base game will not load unless I turn it into FfH (ie - impossible for me to load you mod). There is a new patch coming sometime soon, so I'll just wait for that to fix my DLL, but it obviously means I cannot help you quite directly.


My approach would be pretty simple though. I assume that the non-crashing UnitInfos is either all of the Units in normal Civ, or a ton of them. First shot I would take is to delete all of the Civ Specific UUs (like the Fast Worker, anything that isn't the default of the UnitClass). See if that works for you. You were smart enough to replace all of the Art Styles with settler only information, but there could be another place that the alternative units are referenced, and that might lead to a crash.
 
@ Xienwolf: thanks for the interest. I have cut down the number of files so that there are as few changes as possible to show the problem. Please download the zip. You can easily unpack the existing files into a new mod directory like "CrashTest" so you don't need to use customassets. If you load my crashing game, you will see it autopilot to a crash in a few seconds. If you start any game using my files, it may crash in the first hundred turns, you may need to try as many as five games before you see the crash.

What I have basically done is to delete all but twelve units and all but twelve buildings. I will build up from there; but since the game crashes at this point, I assume it will only get worse as I add in actual changed units. So, I have not added or changed anything, just deleted bunch of units and buildings. In order for the game to compile, I have deleted the corresponding references in other files. For example, I have deleted all the references to UU and UB occuring in the civilizationinfos file; otherwise the game would not even start up.

Also, I have written a program which checks for missing references, and I have run that on the files in the zipfile. So I am pretty sure there are no missing references. You can see more about the checker in this thread.

Although I would like to understand what is wrong with these files, my main interest is to find a more efficient way to debug this type of crash. Any suggestions?
 
As I stated, it is quite impossible for me to play your mod right now, because I am lacking the proper DLL :) Otherwise I would have run a testgame before having posted.

One thing you aren't clear on what talking about your testing program for missing references is if it only checks your mod and mod folders, or if it also compares the un-replaced base files from Civ BTS. It is the references back to there which will probably be causing you issues.

Anyhow, as for methods of uncovering crashes which are tied to the UnitInfos, my suggestion from the last post stands. Delete the UU versions of each unitclass first, and see if you run smoothly like that. Once you have all of the UUs out of the file it is much slimmer and discovering which precise unit is giving you issues will be simplified.



Since the crash is coming later in your game, and not consistently, my first hunch would be that the python or DLL is attempting to spawn some specific Barbarian Unit which you have removed the tag for.
 
Anyway, I was going to run a few tests myself since I am needing a break from my own work, but it would seem that I overwrote Firaxis's DLL sometime in the past with one of my own,

Have you still got the DLL source for the original? Should be in the BeyondTheSword directory if you wanted to rebuild it...

Failing that - let me know and I'll post a copy.
 
@ Xienwolf: What I did was remove all the units except 12, and then remove all the references to all the units I removed. So all the references to UU and UB are already gone.

Regarding barbarians, I think the barbarian information in civilizationinfos works the other way around from what you have described: in the barbarian section, you list the unitclasses which should *not* be spawned. Even if there were unresolved references to unitclasses there, which there are not, the barbarian code could not be trying to spawn a non-existing unit.

Regarding my checker, you can read the full documentation here. By default it scans the directories in the proper order: custom assets, your mod assets, BTS, Warlords, and vanilla. Once it finds a file in one of the directories, it won't load a file with the same name from any of the later directories. Without this capability, it would not be very helpful to flag unresolved references.
 
Top Bottom