Tech Screen debugging

phungus420

Deity
Joined
Mar 1, 2003
Messages
6,296
I've created some strange bug. Not really sure how I did it. The behavior is that sometimes when I start or load a game, I get a python exception pop up, displaying a bunch of stuff about CvTechChooser, and a C++ exception. When this occurs I see the tech screen displayed, but I can't interact with it, and there are no connecting arrows. When I press escape to get out of the tech tree screen, I may, or may not loose my interface. If I don't loose my interface, if I click on the tech tree, I get a shorter list of python exceptions in a pop up, and cannot interact with the tech tree screen. This seems to occur more frequently the more players I set up for in the map, ie on a duel map, this bug has yet to occur, on a large map it always will. I have no idea what could be causing this. Here is what the autolog has to say:

Spoiler :
Traceback (most recent call last):

File "CvAppInterface", line 75, in preGameStart

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 193, in interfaceScreen

File "CvTechChooser", line 205, in ConstructTabs

File "CvTechChooser", line 251, in DrawTechChooser

File "CvTechChooser", line 332, in placeTechs

File "CvTechChooser", line 355, in addIconsToTechPanel

RuntimeError: unidentifiable C++ exception
ERR: Python function preGameStart failed, module CvAppInterface
Traceback (most recent call last):

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 193, in interfaceScreen

File "CvTechChooser", line 205, in ConstructTabs

File "CvTechChooser", line 251, in DrawTechChooser

File "CvTechChooser", line 332, in placeTechs

File "CvTechChooser", line 355, in addIconsToTechPanel

RuntimeError: unidentifiable C++ exception
ERR: Python function showTechChooser failed, module CvScreensInterface
Traceback (most recent call last):

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 106, in interfaceScreen

File "CvTechChooser", line 816, in updateTechRecords

IndexError: list index out of range
ERR: Python function showTechChooser failed, module CvScreensInterface
Traceback (most recent call last):

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 106, in interfaceScreen

File "CvTechChooser", line 816, in updateTechRecords

IndexError: list index out of range
ERR: Python function showTechChooser failed, module CvScreensInterface
Traceback (most recent call last):

File "CvAppInterface", line 75, in preGameStart

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 193, in interfaceScreen

File "CvTechChooser", line 205, in ConstructTabs

File "CvTechChooser", line 251, in DrawTechChooser

File "CvTechChooser", line 332, in placeTechs

File "CvTechChooser", line 355, in addIconsToTechPanel

RuntimeError: unidentifiable C++ exception
ERR: Python function preGameStart failed, module CvAppInterface
Traceback (most recent call last):

File "CvAppInterface", line 75, in preGameStart

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 193, in interfaceScreen

File "CvTechChooser", line 205, in ConstructTabs

File "CvTechChooser", line 251, in DrawTechChooser

File "CvTechChooser", line 332, in placeTechs

File "CvTechChooser", line 355, in addIconsToTechPanel

RuntimeError: unidentifiable C++ exception
ERR: Python function preGameStart failed, module CvAppInterface
Traceback (most recent call last):

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 106, in interfaceScreen

File "CvTechChooser", line 816, in updateTechRecords

IndexError: list index out of range
ERR: Python function showTechChooser failed, module CvScreensInterface
Traceback (most recent call last):

File "CvScreensInterface", line 83, in showTechChooser

File "CvTechChooser", line 106, in interfaceScreen

File "CvTechChooser", line 816, in updateTechRecords

IndexError: list index out of range
ERR: Python function showTechChooser failed, module CvScreensInterface


Any ideas on how to debug this?
 
Is this stock BUG 3.6 or a merged mod? If the latter, I suspect an XML problem with one of the civs/units such that you only see it if you are of a borked civ type. Total guess, but BUG doesn't change much on the tech chooser, and not that part, so I doubt it's BUG or a normal Python problem.

Unidentifiable C++ exception typically means that an index is out of bounds or an expected value was not found. You can sometimes catch these by compiling a DLL with asserts turned on.
 
Is this stock BUG 3.6 or a merged mod? If the latter, I suspect an XML problem with one of the civs/units such that you only see it if you are of a borked civ type. Total guess, but BUG doesn't change much on the tech chooser, and not that part, so I doubt it's BUG or a normal Python problem.
Yep. Wish the exception had told me a borked prereque caused it. With no information whatever, I was at a loss (I guess I should save and playtest more frequently, lol). But that was it.

Unidentifiable C++ exception typically means that an index is out of bounds or an expected value was not found. You can sometimes catch these by compiling a DLL with asserts turned on.
How do I do this? I can easily compile a new gamecore, where is the assert option? Or do you need to write the assert code (if so is there an example laying around somewhere)?
 
Look in FAssert.h I believe for lines like these:

Code:
#ifdef _DEBUG
#define ASSERT ...
#else
...
#endif

Then you need to add a define (/D_DEBUG I think, look in the makefile) to the compiler flags and recompile the whole thing. Perhaps the debug version has this done already, but I forget.
 
This error, in my experience, is caused by a non-valid entry in UnitArtStyleInfos.xml. I would double check this file carefully and see if any of the ArtDefines in there are borked.

Cheers,
ripple01

I'm assuming you mean that there is no art defines entry for a type specified in the unique unit art? Hmm, it's possible. The issue went away when I noticed that I had ANIMAL_MASONRY as a prereque tech, lol. But it's possible I just didn't hit the lottery with the effected civ in the games I tried after adjusting that. I suppose the best thing to do in this case would be to start a game with all civs and see if the issue pops up again, if so, just try to isolate it through trial and error of different civs. What would be nice if if the debugging loggers would actually say something like 'UNIT_CIVNAME_UNITNAME is invalid!', or give a line number for the invalid string in the unique unit art file, or something along these lines. That way modders would just know the cause right away, like for most XML errors. Any plans of implimenting something like this to the BULL dll?
 
Any plans of implimenting something like this to the BULL dll?

Wow, that would be a whole lot of code I really wouldn't want to write. :( I think I'd rather watch paint dry. :lol:

I'm surprised it doesn't crash while loading the XML in the beginning when it found the incorrect tech key.
 
Hehe, well it doesn't hurt to ask, and maybe one day you'll feel like watching paint dry, and instead code some awesome debugging-log-dump-fu and all modders shall rejoice :woohoo:
 
I'm assuming you mean that there is no art defines entry for a type specified in the unique unit art? Hmm, it's possible.

Yes, this is what I am referring to.

I suppose the best thing to do in this case would be to start a game with all civs and see if the issue pops up again, if so, just try to isolate it through trial and error of different civs.

This is how I have fixed the problem in the past. A little annoying, but it works.

Cheers,
ripple01
 
Back
Top Bottom