Game Development Community

Certain missions crash the release build

by Daniel Buckmaster · in Torque Game Engine · 12/21/2008 (7:01 am) · 7 replies

I've just made some modifications to the Player class to get stances working. However, now my Release build crashes after objects have been loaded.
But this crash only happens on the Barebones and Content Pack Demo 1 levels. I am able to load other missions as normal and walk around with my Player. This makes it seem like nothing's wrong with the Player class. But for some reason, on specific missions, my changes are interfering with something that makes the engine crash.
The crash doesn't happen in debug builds. The last thing in the console:
*** Phase 3: Mission Lighting
 Successfully loaded mission lighting file: 'starter.fps/data/missions/barebones_b66cc104.ml'
Mission lighting done
Mapping string: MissionStartPhase3Ack to index: 2
Mapping string: MissionStart to index: 11
Mapping string: SyncClock to index: 12
Could not locate texture: starter.fps/data/shapes/player/crossbow
Could not locate texture: starter.fps/data/shapes/player/clip
Could not locate texture: starter.fps/data/shapes/player/crossbow
That was when loading Barebones. When the other mission was loaded, the last line was 'Mission lighting done'.

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
12/27/2008 (2:00 am)
Well, I found the problem. Apparently, I had forgotten to initialised a member in the Player class. According to a thread, some compilers cushion that by initialising veriables for you in the debug mode, but leave you to take the heat in release builds. But according to the same thread, VS2005, which I am using, doesn't do that :P. Well, apparently it does... I wonder if I can turn that off. Well, now I know what to watch for.
#2
12/27/2008 (6:49 am)
/RTCu sets the compiler to initialize for you. Unset it.
#3
12/27/2008 (9:55 am)
Thanks! ...
...given than I'm a code newbie, where do I unset it? ;P I can find /RTCsu set as one of the 'basic runtime checks'...
#4
12/27/2008 (10:20 am)
That's the one! Setting "Basic Runtime Checks" to default should disable both checks (stack bounds and initialising variables). Unless you haven't found it already, the simplest way is to do it via Right-Clicking your project (not the solution).

In there you will find a "C/C++" tab, which has a "Code Generation" tab inside. Then set Basic Runtime Checks to default.

VS2005 doesn't control if this happens or not, the project settings does. So you should be good to go.
#5
12/27/2008 (10:24 am)
You would think Basic Runtime Checks would mean it would help you out by warning you about uninitialized variables and such that it has corrected for you, but instead it appears to make matters worse by not telling you. Gee thanks Microsoft....
#6
12/27/2008 (12:57 pm)
Thanks Stefan :)

Nathan - yep, that's Windows...
#7
12/27/2008 (7:57 pm)
Yeah, Microsoft are so special and evil. Go check out GCC (which, isn't made by Microsoft *hint*) and you'll notice quite a few quirks about their initialization warnings, which for instance are unrealiable when optimizations are turned off.

Guess when you turn optimizations off? In debug builds. But yeah, good try. :)