Reasons for a mod to Crash

justinian66

Chieftain
Joined
Jul 22, 2010
Messages
70
Long time no see fanatics! Just reinstalled Civ4 on my new comp and am having some troubles with my old personal mod I used to play with. I've changed a few things here and there since I played it last (which was like over a year ago) and now I've come across a problem.

After an indeterminate amount of time, but almost always within the ancient or early classical eras, I get a CTD (crash to desktop) error and am unable to play past a certain turn. I've got a saved game just before the turn but I don't know how to tell for sure what happens in that turn, or rather the AI's turns, that is causing the crash.

Through process of elimination, however, I was able to narrow down the root of whatever is causing the crash down to two different cities of two differing civs. The first one causes the crash just as its about to finish constructing an archer. When I removed that city and placed it back in world builder it proceeds as normal and even goes on to build other archer units later on without any problems (yet...). I did the same for the second city which belonged to a different civ, was trying to build a scout, and actually causes the crash the turn just after the one before if I only "fixed" the first city that was building the archer. So after removing and then replacing the cities through worldbuilder the game has continued as normal, but I still dont know what was causing the problem :confused:. Now I find myself saving at the end of every single turn out of fear that the next time I press Enter I will have symbolically pressed the BIG RED BUTTON :bump: haha. As "fun" as it is being unsure this year (ie. turn) could be the world's last, the novelty of this style of play wears off verrrrry quickly, and I'm still at a loss as what caused the original problem for those two turns.

Any idea what would cause this kind of crash? Everything else runs fine in the game and there aren't any missing art files as far as I know. Anyone ever heard or experienced this kind of bizarre behavior before? Is there one common thing or another that sounds like is causing this problem?

ps. I'm sure you'd probably advise me to upload the mod along with the save game file to really narrow it down, but unfortunately I was a fool when I began making/modifying this mod and a lot of the art files are contained in a separate folder on my desktop. Which in turn, means the art_def files are full of paths that wont work on your end.
 
I don't really understand what is going on in your mod, but here are a few things that come to my mind:

If you have changed a few things here and there since you played it last, you should be able to find what you did wrong, no?

It is not always the same year/turn, right?

Did you play several games or is it just one that you tried?

Are you in an advanced game? (I guess not). It's a new computer so there should be no problems, or somehow is it with lower specs? Is it 64-bit operating system?

Do you have Python exceptions enabled? Did you change some Python?

Do you have a custom dll or do you play with the standard one?

If the problem persists, you might need to run a debug dll.
 
Yea, I figured I didn't do a very good job explaining the problem. Sorry about that.

Let me first address your questions:

If you have changed a few things here and there since you played it last, you should be able to find what you did wrong, no?
I made a lot of changes to the mod before I actually started a game that I intended to play through. I would make a change and then just merely start Civ4 w/mod to make sure it didn't crash while loading or to see if there were any XML error messages.

It is not always the same year/turn, right?
If i make no changes (ie. removing the city where the unit is being built) its always that same turn. But it also can happen irregularly throughout the game in later turns even after removing and replacing the city.

Did you play several games or is it just one that you tried?
Two different games. The first game I played I had no idea what seemed to be causing it so I didn't check to see if there were any "troublesome" cities that were causing the problem.

Are you in an advanced game? (I guess not). It's a new computer so there should be no problems, or somehow is it with lower specs? Is it 64-bit operating system?
Not in an advanced game, starting in ancient era like normal. Shouldn't be anything to do with graphics specs (lowered and rasied them back and forth to see if it made a difference). Running on Windows 7 HomePremium, 64bit. i5 Processor.

Do you have Python exceptions enabled? Did you change some Python?
Probably enabled...:confused:. I forgot to mention that the core of this mod is based on/is BobeBrown's Neoteric World mod. I've generally stayed away from Python editing since I'm not too familiar with it, but in this case I did modify the RebelTypes.py file to include the custom civilizations I added in. Don't think that would cause the problem as their aren't any signs of anyone experiencing and rebellion activity yet.

Do you have a custom dll or do you play with the standard one?
AFAIK, whatever BobeBrown's Neoteric World has. I didn't make any changes to that.

If the problem persists, you might need to run a debug dll.
Oh its persisting, alright. How do I go about running a dll debug though? Perhaps this will be the most helpful in finding out whats causing the crash.
 
You explained it fine, I just meant that I don't understand what is happening in your game to make it crash!

Let's try to make it step by step. First, you have to make sure that Python exceptions are enabled. Even if you think that you have not modified Python dramatically, Python errors can still give you indications on what is going wrong. So, locate the CivilizationIV.ini file that should be somewhere in your (My) Documents/My Games/BeyondtheSword folder (not in program files). Edit it with a simple text editor, find "Set to 1 for no python exception popups" and change the setting as follows: "HidePythonExceptions = 0". Then start your game and take note or take screenshots of errors if any.

One or two things: you said in your first post that there aren't any missing art files as far as you know. Wrong path, wrong ArtDefines files or simply wrong art files are a common source of crashes. Try to see if all Civs, Leaders, Units etc look fine in your Civilopedia.

About debug dll: you are playing with BobeBrown's Neoteric World Mod which has a specific dll meaning that only BobeBrown could provide you with a debug dll. But if you have not changed too much Python and if you haven't touched the SDK then it should not be the problem. Maybe post that RebelTypes.py file.
 
Let's try to make it step by step. First, you have to make sure that Python exceptions are enabled. Even if you think that you have not modified Python dramatically, Python errors can still give you indications on what is going wrong. So, locate the CivilizationIV.ini file that should be somewhere in your (My) Documents/My Games/BeyondtheSword folder (not in program files). Edit it with a simple text editor, find "Set to 1 for no python exception popups" and change the setting as follows: "HidePythonExceptions = 0". Then start your game and take note or take screenshots of errors if any.
Did as you said, but got no error messages or anything in start up. And when I tried ending my turn in that saved game it just crashes like usual and gives the typical "Sid Meier's Civilzation 4 has stopped working" yada yada yada...

One or two things: you said in your first post that there aren't any missing art files as far as you know. Wrong path, wrong ArtDefines files or simply wrong art files are a common source of crashes. Try to see if all Civs, Leaders, Units etc look fine in your Civilopedia.
I remember checking everything in the Civilopedia and the only things that had any errors that I can see are a resoruce (Olives) and a custom leaderhead. However, the Olive resource only has that problem in Civilopedia (just a red sphere in the preview instead of the tree) but appears normal in the game itself. And the only thing "wrong" with that leaderhead is that it doesn't have any animations. Dont think they're the problem :/


About debug dll: you are playing with BobeBrown's Neoteric World Mod which has a specific dll meaning that only BobeBrown could provide you with a debug dll. But if you have not changed too much Python and if you haven't touched the SDK then it should not be the problem. Maybe post that RebelTypes.py file.
Havent touched SDK or any other python files. Here's that RebelTypes.py file though. My custom civs are the bottom of each list. Also, while looking through it I noticed I included the RebelTypeList[iIndia] twice. Didn't notice that till now, but is something small like that enough to cause a crash like this?

Another thing I remember from that game now is that some of the time the cities causing the problems were cities I had strategically placed for the AI or had changed their name through worldbuilder. For example, I placed one of the AI player's early cities on the coast to ensure it would have a port early on, changed Berlin to London because it was on the coast (perfectionist here :P), and placed several Barbarian cities on a few islands throughout the map. I've never had a problem with worldbuilder before in the older mod, but I thought I'd mention this part in case it was relevant somehow.
 

Attachments

I went ahead and transferred all the art files that I mentioned were located on my desktop and put them into the mod folder. Wasn't nearly as hard as I thought it would be actually. Just a lot of copy and pasting :crazyeye:, and maybe I'm just imagining this but it seems like the mod loads faster too!

Here's a link to an upload of the mod if you're interested in seeing the problem firsthand. Wait a second, how do I upload a mod through the civfanatics site? Or should I just use a third party site to do it?

The games I've played only included the custom civs and in this order (dont know if that matters):

Player: Archonia w/Alexander Kol
Asia w/The Glorious Leader
Arabian Brotherhood w/Saladin
Aztlan w/Montezuma
Europa w/His Excellency
India w/Ghandi
Israel w/Ben Gurion
Nimbuksa w/Zara Yaqob
Russia w/Peter
USNA w/Reagan

Oh wait, Ill just attach a savegame file along with this post.
 

Attachments

BobeBrown is mentionning a Patch, did you install it? (Although it looks like it deals only with Future Era).

I can't do a thing with your savegame without all the mod. Yes, you should use a third party because it's probably too big.

At least, zip your xml folder + modules, I can take a look then.

I'm thinking of Leaders or Civs added from pre-BtS, with a different file structure (not exactly the same tags) or an outdated Schema file in a module.
 
Here's that RebelTypes.py file though. My custom civs are the bottom of each list. Also, while looking through it I noticed I included the RebelTypeList[iIndia] twice. Didn't notice that till now, but is something small like that enough to cause a crash like this?

Same for Russia, included twice. No, this can't be a source of crash, the second instance is just overwriting the first one.
 
I'm sorry but I won't be able to help you it seems.

I don't understand a thing with the mod as most of the texts have disappeared in my interface. I can't go in the World Builder and see who are the players, all names are blank. I changed the <Description> tags for the leaders to have a better clarity, then, in your game, Roosevelt became the leader of the Arabian Brotherhood and Fidel Castro took the lead in the Israelian Empire!

All production, units, buildings, technologies: blank. I can't try to guess all the time what is happening.

The combination of Revolutions/BUG/etc makes it undecipherable for me!

I experienced just one crash, otherwise I could "play" until turn 135. At which turn does it crash (Map 1)?

Maybe you made too many changes at once without testing them. Loading the game is totally insufficient to test additions to a mod. Many stuff give problems only when encountered in the game.

I hope for you that somebody will be able to provide assistance. Otherwise, start again from a fresh installation of BtS + the mod and try to add things very progressively.
 
Bugger :(. Thanks for trying though. I'll keep looking through the files to see if there are any glaring errors that might cause it. Reeeeally hoping I dont have to start from scratch again as that was what primarily caused me to stop playing Civ4 last time (MOD stopped working and I coudln't figure out what was causing it to not work).
 
:bump:

Anyone else have any guess or willing to give it a look? I'm at a loss here still, and though I reeeeally dont want to, I'm about to scrap the entire mod and start from scratch.
 
You can try removing all SDK and python files and see if it is due to the art defines crashing I guess.
Unless the SDK adds new XML tags, it should be pretty simple to simply delete it.
As for python, just delete the whole python folder.

Play around and see if those archers still crash the game.
If they do, you know why now.
If not, then add back either the SDK or python bit by bit and see how it goes.

Not the best method but pretty easy to try method lol
 
The mod does not load without its dll and crashes without Python folder.

I'm playing in English now and the interface is back :).

I'm pretty sure it is a unit causing the crash. I can continue the game if I delete the two unit files and play with BtS ones.

I'll continue tomorrow.
 
The mod does not load without its dll and crashes without Python folder.

I'm playing in English now and the interface is back :).

I'm pretty sure it is a unit causing the crash. I can continue the game if I delete the two unit files and play with BtS ones.

I'll continue tomorrow.

You need a DLL, just not potentially the modded one. Deleting the Python folder too will also cause a crash, you just need to remove or revert changes to any modifierd Python files.
 
@ ls612: not exactly true. We are talking about a mod. If you delete the dll or the Python folder of a mod, it reverts to the BtS ones. There are mods with only XML changes who do not have a dll or Python files. I know, it's hardly the case of C2C... ;)
 
isenchine, you are a saint. Thank you so much for your help! :thanx:

I'll continue to troubleshoot on my end, but Im still unable to figure out whats causing it. However,

I'm pretty sure it is a unit causing the crash.
I too thought this was the cuplrit, and I'll try removing the archer unit files like you mentioned earlier, but I've been noticing in some games that there isnt even a unit about to be finished and it still crashes at times. I got fed up at one point trying to remove individual cities that I thought were causing the crash and just eliminated ALL the rival civs on the map. Oddly enough, I was able to proceed to the next round but (obviously) the game ended for me. Could there be a problem with one of the custom civs I made per chance?
 
I went through the same process and realized that the game was stable only with India and Asia left. I might have played not enough turns though.

My test with the BtS units: I could play 50 turns thereafter so no, the Civilizations are not the obvious culprits. If you wonder how I did it: loaded Map1 game, entered World Builder, saved it as a scenario. Exit. Replaced units. Loaded scenario from the mod, selected your favourite leader and played. Otherwise, you can't load a save game if you have deleted or added units.

My most recent test is entering World Builder and added to your Civ every single unit possible. I could access them all and play with them one turn before the game crashes in between turns. Very frustating but at least, it does not seem that it has to do with Art. Possibly a path for upgrade or a Tech prereq or?...

Since I'm at it, here are some observations (not causing the crash):

In the Techs file, look for FUTURE_TECH. Why is there a second minimalist entry for it? I would delete all Techs from Next War module as they are incorporated in the main file. You might be loading them twice. The button for Tech_MAGLEVS still refer to your desktop.

In the BuildingClass file, the building type for Corp 13 is 11.

In the UnitClass file, at the end, UnitClass Heavy_Transport & Future_infantry are there for the second time in the file.

In the Civ file, I would adjust the English Redcoat-Rifleman for England now that you have reviewed it. Actually, I would suppress all Civs that I'm not playing with but it is not mandatory of course.

City Qom has no text file.

More later.
 
Now I'm totally fed up with your Mod! :D but I've been able to play without a crash until 1900 BC! :)

I found several things and I will throw them like that. Some are important, some not and some are primordial! As I said, I'm too fed up now to see what is the exact culprit of the crash, maybe there are several suspects. Each time I thought that I got it but of course if it was a combination of some...

Three Units (Future Infantry, Attack Submarine & Global Hawk) require 4 Techs. Your GlobalDefines.xml says at NUM_UNIT_AND_TECH_PREREQS: 3. So, either you drop one or you change your GlobalDefines.

For NUM_UNIT_PREREQ_OR_BONUSES, it says 4. I'm so hyper cautious that I deleted all the fith ones with NONE! :D

Your Heavy Lift Heli and ISSCV Dropship are Land units and have UNITAIs like: UNITAI_SETTLER_SEA, UNITAI_ASSAULT_SEA & UNITAI_PARADROP: to be changed absolutely!

Your Frigate upgrades to a Dreadnought1 which does not exist.

In the UnitClassInfos, you have a CLASS_MODERN_CRUISER which does not exist. Although if you delete it, you will have to change the CIV4EventInfos.xml file (line 33344).

Your button for BUILD_GRAVTUBE in the BuildInfos still refer to your desktop.

Your Religion Utopism has a reference to CustomAssets/New Folder which does not exist. There again you have unnecessary xml files (OK they are not loaded).

Apart from that, there are unused references here and there. I guess your mod requires some cleaning up: it would load a bit faster. One that I remember: CIV4ArtDefines_Leaderhead still has Curtin, Menzies, Nasser, all leaders not available. I didn't even venture into the CIV4ArtDefines_Unit one. Hey, hopefully nobody will look into my file! :D

I sincerely hope that it works for you. :eekdance:

As from now on, small changes then testing! ;)
 
Now I'm totally fed up with your Mod! :D

Me too.

facepalm.jpg


Thank you again for all your help again. I'll try a couple more things I thought of along with all the suggestions you gave me, but if those dont work (which it probably wont :badcomp:) I'm gonna just bite the bullet and begin working on making/modding another mod to my liking. If I do ever find out what caused it, i'll let you know though.
 
Back
Top Bottom