Crash to desktop when an ai city builds a unit

euskingc

Chieftain
Joined
Oct 22, 2008
Messages
72
I'm having a CTD when an ai city builds a new unit (not always), but the crash always occurs when I hit end turn when they are about to construct a unit, especially if they are building a non-combat unit, and especially if there is a combat unit already in their city square. If this last scenario is the case (this is most frequent, but occasionally the crash will occur if they have no units in the city), if I erase their combat unit in the editor (or destroy their city, for that matter), the game goes on without crashing.

Does civ have a log file of some sort that i can enable that tells you what exactly the game was doing when it crashed (like total war?)?
Or is there some sort of debugger I can run?

The files I've changed since the problem started occurring are these ones:
The colours of the menu in the theme files,
the opening menu screen itself
since i removed all civilizations and added 13 new ones, all the teamcolour and leaderhead art files (could it one of the flags or buttons?)
Civ4artdefines_civilization.xml
civ4artdefines_leaderhead.xml
civ4mainmenus.xml
civ4civilizationsinfos.xml
civ4leaderheadinfos.xml
civ4diplomacyinfos.xml


Edit:
Well, the good news is all these files are in proper working order.

The bad news is that the modder is a moron. I ran into the problem with a recent version of my mod, so jumped back to yesterdays version to see if the problems were still there. They seemed to be, but I forgot that the mod was still drawing its information from the newest folder, even if I was opening it from the backup folder...
Since yesterday I've gutted the units (left only a few basic units and unit types), events(left no events at all), buildings(left only the palace), and religions files, and I had only reassembled the religion files (but down to two religions)when I noticed the problem. If no one has any glaring ideas, I'm going to keep putting the others back together and see if the issue persists once it is all whole again.
 
Are you sure you did not add a unit or a building? Because your crash looks like an art definition of something a city can build is wrong, usually a button. It is not necessarily the unit built, it could be what the AI intends to build next.

If you have such added units/buildings, check your Civilopedia if they look allright. Check the path of their buttons as well. A common issue is the comma left at the beginning of a path, which is only needed when you point to an atlas of buttons. This leads to crashes in game.
 
Hello isenchine =)
Correct me if I'm wrong, but I seem to remember you being confronted with a similar sounding issue somewhere else in this forum =)

Are you sure you did not add a unit or a building? Because your crash looks like an art definition of something a city can build is wrong, usually a button. It is not necessarily the unit built, it could be what the AI intends to build next.

If you have such added units/buildings, check your Civilopedia if they look allright. Check the path of their buttons as well. A common issue is the comma left at the beginning of a path, which is only needed when you point to an atlas of buttons. This leads to crashes in game.

As for what the AI intends to build next, I really had not thought of that possibility... I'll have to keep that in mind if I can't correct it.

As for adding buildings or units, no, nothing has been added... was just stripping it all down, hadn't got to putting anything back in except the religions. There was only a handful of basic units (and great people) left, and only the palace was left for buildings. I was sort of taking it all apart recklessly. I've tested in isolation/redone a lot of yesterdays work, much more carefully this time, and left some more things in... about 20 buildings or so this time, that I do plan on using. I was just coming back to the forums to report, I just managed to isolate the problem to the units... the unit files are the only ones left I have to test/redo.

EDIT *I didn't consider... it really could have been the old buildings files too... I'll have to do a little more isolation testing to rule it out completely.

I'll have another quick look at the unit files, see if I can't catch something obvious now that I've narrowed it down... maybe I accidentally removed one of those commas, as you mentioned. Even if I CAN remake the file in such a fashion that it does work... I'd still like to know what exactly was causing this issue, so I'll know what it possibly means if I find myself facing these symptoms again.

And thanks, eh =)
 
Ruled out the buildings files in an isolation test. Looked through the unit files, and I noticed a discrepancy... there were several civ4unitclassinfo entries that had no corresponding civ4unitinfos entries... e.g. many classes had no actual units belonging to them. Could that have done it? Does the AI per chance choose its next unit based on the unitclasses first then select a unit that falls in that category secondly?

If that is indeed the case, I could see it getting a little temperamental if it starts looking for something that isn't there... I'll run a test with the files corrected and see the results...
 
That seems to have done it. It usually crashes by about 2200 bc or so on marathon setting... but I ran it straight through to 10 ad with no crash after fixing the civ4unitclassinfo.xml file.
I'm pretty confident that has resolved the issue...

But I did notice something unusual when I was following your advice too... when I opened the civilopedia from the opening menu (before I even started the game), this was what was displayed for some of the entries... seemingly at random, however only the first time I opened that entry, if I'd reclick on it, it'd display entirely properly until I'd close the civilopedia and reopen it again.

Now I've never noticed it doing this before... then again I've never speed clicked through the entries before either to check them all. Thoughts?
 

Attachments

  • civpedia.jpg
    civpedia.jpg
    61.4 KB · Views: 65
About your Civilopedia issue, I never ran into this kind of problem myself, so I don't know exactly. You might have tired your computer a bit too much!... :D
 
About your Civilopedia issue, I never ran into this kind of problem myself, so I don't know exactly. You might have tired your computer a bit too much!... :D

I hope that's all and it isn't something that's going to bite me later =)
 
I've been seeing a lot of that advice... I'm really going to have to put figuring out why it's helpful on my homework list... anything you can point me to for information on it?
 
It all depends what you have done so far in your mod.

There are three basic components in the programming of stuff in BtS (and here I'm obviously not talking at all about graphic/design stuff which can be a BIG part of your mod): Python, SDK, XML (just in alphabetical order).

Python: Many of the interface is done through it, plus, thanks to Platyping: so much more!:cool: Besides, Civilopedia is part of the interface job, so that's why he advised you to enable Python exceptions. To help you further, we would have to know if you have done any modification to the Python files, added BUG to your mod, etc.

SDK: very important if you're talking about AI behaviour, but you will need to be able to compile a DLL.

XML: the easiest part, just a bunch of variables that you are allowed to change easily... except that of course, this is all part of a very complex architecture!
 
My friend, I know just enough to be dangerous :D

I'm about two weeks old in Civ4 modding... and I'm just... ever more amazed at what can be done with it.

I've only been tinkering with the xml values so far... the function (and potential) of sdk and python are only slowly growing in my understanding. I haven't really touched them... yet. Once I get through most of the xml related tutorials... and have a good feel for how that part of the architecture functions... I intend to move on... both with learning and modding =)
But I think at least half of the work I have ahead of me is homework.
 
T
But I did notice something unusual when I was following your advice too... when I opened the civilopedia from the opening menu (before I even started the game), this was what was displayed for some of the entries... seemingly at random, however only the first time I opened that entry, if I'd reclick on it, it'd display entirely properly until I'd close the civilopedia and reopen it again.

Now I've never noticed it doing this before... then again I've never speed clicked through the entries before either to check them all. Thoughts?

This means that the name of the .nif file doesn't match to the name of the .kfm file.
This regularly happens with user created units. Renaming the .nif to what is expected (and the related XML entries) should fix the problem (the .nif name is hardcoded in the .kfm file, therefore this can cause problems).

Another possiblity: The assigned .kfm file actually doesn't have the right animation for the unit/is just the wrong .kfm. In that case this could also be the cause of the crash, because units with absolutely not fitting animations (in contrast to just distorted animations) will also crash the game.
 
I have not added any units yet... just taken most of them away
I will keep that in mind for when I do though... should be within a few days. One less thing I'll have to learn the hard way =)
 
Ahh... I hadn't touched that file... could that be why?
I mean... I removed all the excess units (basically everything beyond the medieval age) everywhere else they were referenced, but forgot to remove them from the civ4artdefines_unit.xml ... would that do it?
 
Don't think it matters, sorry!...
 
I'm not super concerned about the reason why (seems fairly benign)... but am open to learning =)
 
Why, I can't say, it's just from experience. I have left several ART_DEF in that file without the units. The game never complains.
 
Back
Top Bottom