View Full Version : civchecker - avoid crashes in your mod


davidlallen
May 25, 2008, 11:55 AM
When you are modding XML files, the game should check for all kinds of missing definitions when it loads your XML. It checks for some, but not all. If you have used a symbol but the definition is missing, the game may randomly crash, either at startup or during play. This checker tries to catch all kinds of missing definitions so your mod doesn't crash.

See the user documentation (http://jendaveallen.com/fury-road/civcheck.html) for full details.

I have submitted it to the forum download page, but it is in the "moderation queue".

You can download the latest version of the program from this link (http://jendaveallen.com/fury-road/civcheck-latest.zip).

PotterDK
May 26, 2008, 05:37 AM
What did you mean by: "Edit civcheck.config in your editor." My XML editor? I couldn't open it with that. Please advice.

davidlallen
May 26, 2008, 09:47 AM
In your text editor, like notepad. It is a plain text file.

Arian
Jul 01, 2008, 07:16 PM
Hi,

I tried to check my mod and all I got is this:

Edit D:/Games/Civilization 4/Beyond the Sword/CivCheck/civcheck.config and then use File=>Run


This is in the config:

# The installation path is probably right. Change it if you installed
# the game somewhere else.
set install_dir "d:/games/civilization 4"

# If you have files in your local CustomAssets you want checked,
# uncomment the next line and make sure the path is correct. For
# non-English language installations, you will need to change "my documents"
# to the right name also.
# add_directory custom "c:/documents and settings/jena/my documents/my games/beyond the sword/customassets"

# If you want to run this on a mod, uncomment the next line and make
# sure the path points to your mod.
add_directory HitM2 "$install_dir/beyond the sword/mods/History in the Making2/assets"
# add_directory fury "$install_dir/beyond the sword/mods/fury road/assets"

# If you don't have BTS or warlords, comment out the corresponding lines
add_directory bts "$install_dir/beyond the sword/assets"
add_directory warlords "$install_dir/warlords/assets"
add_directory vanilla "$install_dir/assets"

# Uncomment these lines to enable some more verbose reports
report_filenames
report_definitions
report_unused

....unchanged

My changes are in red

I'd appreciate your advice.

Regards, Arian

davidlallen
Jul 01, 2008, 09:28 PM
I tried to check my mod and all I got is this:

Edit D:/Games/Civilization 4/Beyond the Sword/CivCheck/civcheck.config and then use File=>Run

When you used the File=>Run menu choice in the window, did any output appear in the window? Afterwards, you should open your text editor on the civconfig.txt file it produces.

I have noticed that the 3.17 patch appears to generate more than a hundred undefined art references. As far as I can tell, these are real errors in the distribution files. In the 3.13 version there were only four undefined art references, which is ignorable. For over a hundred, I will have to add something to the checker so your own errors don't get buried among these Firaxis errors.

Arian
Jul 02, 2008, 12:41 AM
I haven't upgraded to 3.17 yet.
But I must be doing something wrong.

Running from the DOS-commandprompt:

D:\Games\Civilization 4\Beyond the Sword\CivCheck>CivCheck

I now get this message:

Edit ./civcheck.config and then use File=>Run


It beats me :confused:

davidlallen
Jul 02, 2008, 01:15 AM
I haven't upgraded to 3.17 yet.
But I must be doing something wrong.
Running from the DOS-commandprompt:

OK, let me stop you here. Instead of running this from the DOS prompt, please double click on the executable from the windows explorer. This will launch a *GUI* and you will see that there is a File=>Run menu.

I am kind of surprised it starts in a non-gui mode when run from a DOS prompt; I did not think anybody would do that.

Arian
Jul 02, 2008, 01:40 AM
OK, let me stop you here. Instead of running this from the DOS prompt, please double click on the executable from the windows explorer. This will launch a *GUI* and you will see that there is a File=>Run menu.

I am kind of surprised it starts in a non-gui mode when run from a DOS prompt; I did not think anybody would do that.

I did try to run it from the explorer and then got the first message. Later I tried to run it from the DOS-promptm and got the second message. The GUI just doesn't show up...

davidlallen
Jul 02, 2008, 09:09 AM
That is odd. Are you using a standard windows XP system? Several people besides myself have run it and gotten the GUI.

Arian
Jul 02, 2008, 01:19 PM
I'm running Vista Ultimate. Might that be the culprit??

davidlallen
Jul 02, 2008, 02:27 PM
I'm running Vista Ultimate. Might that be the culprit??

As far as I know nobody has tried civchecker on vista, and I don't have access to a vista machine. Do you have access to a windows xp machine? It doesn't have to have the game installed. But, if you could just install the small civchecker program and verify that it comes up for you on XP, then we would know it is a vista specific problem.

Arian
Jul 02, 2008, 03:29 PM
I'll try at work. Just don't tell the boss! ;)

[EDIT] Request to other Vista users to try this utility. Please report whether it runs or not...

General Tso
Jul 03, 2008, 08:20 AM
I have Vista Home Premium and civcheck works fine for me.

Arian
Jul 03, 2008, 03:13 PM
Still can't get it to work :(

The GUI doesn't show up. Tried to check the original game (no mod) but still get this message:

Edit D:/Games/Civilization 4/Beyond the Sword/CivCheck/civcheck.config and then use File=>Run

I've edited civcheck.config about a dozen times but it seems the program can't find the civcheck.config (all files are in the same folder) :confused:

Must be me, I guess :)

davidlallen
Jul 03, 2008, 03:31 PM
Still can't get it to work :(

The GUI doesn't show up. Tried to check the original game (no mod) but still get this message:

The problem is that the GUI isn't showing up. There is no way I can think of, where that should even happen. It does not matter what is in the config file or the directories you are checking. Something is different about your computer, where it works on mine and others. The message you are seeing is supposed to be printed into the GUI log window. I don't understand why the GUI is failing to be created on your computer.

Have you had a chance to try it on your windows XP computer? The game doesn't even need to be installed, I just want to know if the GUI comes up. This is what it should look like:

http://forums.civfanatics.com/attachment.php?attachmentid=181931&d=1215117018

Arian
Jul 03, 2008, 03:48 PM
I feel really stupid now! It's been there all the time!! Disregard all my previous posts. I apologize for the hassle, shame on me...

davidlallen
Jul 03, 2008, 05:22 PM
I feel really stupid now! It's been there all the time!! Disregard all my previous posts. I apologize for the hassle, shame on me...

Glad to know it is working.

Omathaar
Aug 11, 2008, 09:24 PM
Hey, I've been having a problem with my mod, but the civchecker says I have no problem files except for undefined text strings. Could those make it ctd?

There's something like 13 civs in the game, and if I play any of the first 4 civs, the game works fine...until I go to the next turn, then ctd. I suspected something was happening with one of the fifth-thirteenth civs, so I tried playing one turn as any of them, and as soon as the game loads, ctd. It could be a prob with just the 5th civ, but I don't know what it could be yet... Does this sound like something an undefined text string could cause?

davidlallen
Aug 11, 2008, 10:56 PM
Just to be sure, when you say "undefined text string", do you mean that you get messages like an undefined reference for TXT_KEY_something? If those are the only undefined references, it is unlikely to cause a CTD. The most common crash I have seen is a unitclass given as a possible upgrade, but the unitclass isn't defined.

Are you running the 3.17 patch or something earlier? I ask because 3.17 itself, without any mods, causes a large number of undefined references, and it is possible to miss one of yours among a large number of theirs.

I wasn't quite sure what you meant by playing one turn as any of the civs. Are you using a SDK mod such as autoplay which allows you to switch players? I don't know anything about those, but I suppose they are widely used and unlikely to cause a crash.

Commander Bello
Aug 11, 2008, 11:41 PM
@ davidlallen:
Thanks for your effort and great work.

I just checked and it seems to work as you have described.:goodjob:

As I was checking the RoM mod, which comes with some fpk files, I assume that the >1000 missing art definitions might be due to the fact that these definitions should be in those files?

Anyway, that is something for me to check...

Thanks for your little program, I assume it will become very helpful for my own modding attempts :)

davidlallen
Aug 12, 2008, 12:19 AM
That is right, civchecker has no capability to look inside fpk files. I have made a list of the contents of the "standard" BTS fpk files and that is automatically used within civchecker. If you are a mod author and you have created an fpk file, the easiest thing is to run civchecker on the original files without the fpk. If you are not the author of a mod, but still you feel a need to check the files, you can use pakbuild to unpack them all.

Nemesys
Aug 27, 2008, 03:26 PM
tx for the program very useful

I tried it on Rise of Mankind mod (as you may know many of us are getting crazy to try to get a fix for the mod's continuos CTDs) and the results were similar to what Commander bello reported. Now the question is, once the program has shown me the errors, what am I supposed to do? No instructions are given on which stepto take next....

davidlallen
Aug 27, 2008, 06:44 PM
I am sure you have read the documentation that comes with it. The key report from the tool is like "symbol XYZ is used on line 123 of file abc.xml". If you are not familiar with the mod code, you may not know how to proceed. But either, the place where the symbol is used, should be removed, or in some other place, a definition of the symbol should be added. Unless you understand about the civ XML in general, and the mod code in particular, you may not be able to use the results to actually fix anything.

I'm not familiar with RoM in particular. Is it actively maintained? Perhaps if the original developer or somebody else familiar with the code, were to look through the civcheck.txt file, they might learn something. I don't think an outsider could do too much.

wotan321
Sep 14, 2008, 09:51 AM
The file Terrain_Peak.dds, a button mentioned in the Civ4TerrainInfos.xml file.... does it exist somewhere or has it ever existed?

davidlallen
Sep 14, 2008, 10:10 AM
Good question. Sadly, in the 3.17 patch, there are bunch of files mentioned which don't exist. I guess Firaxis should use civchecker!

ripple01
Sep 15, 2008, 09:26 AM
davidallen, while using civchecker I noticed that it does not play well with extra characters in directory names, for instance, I have a directory that is Art/Units/[naval] for naval art. civchecker reports the files as missing although they are there and in the proper directories.

Other than this small error, this program is a huge time saver. Thanks for your work put into it!!!

Cheers,
ripple01

davidlallen
Sep 15, 2008, 06:30 PM
Please help me to understand what you mean by "extra" characters. Do you mean that the directory name is aaa/[bbb]/ccc but in the xml file you have aaa/bbb/ccc ? Or do you mean that both the directory name and the name in the xml are aaa/[bbb]/ccc but it seems civchecker does not like square brackets?

ripple01
Sep 16, 2008, 08:18 AM
do you mean that both the directory name and the name in the xml are aaa/[bbb]/ccc but it seems civchecker does not like square brackets?

Yes, this is what I meant. It says the files are missing, but they are there. I surmise that somehow the brackets are throwing it off.

Cheers,
ripple01