Game Development Community

Crash W/O Relight

by Richard_H · in Torque Game Engine · 12/20/2006 (4:55 pm) · 9 replies

Hi,

It seems my game crashes every time I try to load a mission without relighting. This is rather recent, yet I haven't touched the engine for quite a while. I commented out the scripts I recently added yet it still fails. Yet if I change a small part of the mission and it relights, VIOLA, it works. It seems to stop on the same line every time:
Ghost Always objects received.
Mapping string: MissionStartPhase3 to index: 10
Client Replication Startup has Happened!
fxFoliageReplicator - Client Foliage Replication Startup is complete.
Does anyone know what I can do to fix it?

#1
12/21/2006 (3:31 am)
I just ran it in debug mode and it came up with this.
Fatal(.../Torque SKD/engine/dgl/gBitmap.cc @ 788
Bitmap::read: incorrect file version
Edit:
When I relight one part is saying:
SceneLighting::light: unable to persist lighting!
I'm using draft mode if it makes a difference.
#2
12/21/2006 (12:20 pm)
Does it work with a Production relight? If not are the ml flies or the mission directory write protected?
#3
12/21/2006 (12:44 pm)
Production seems to work. I guess it is a draft + shadows bug.
I would appreciate it if someone could give me some advice on fixing it, since relighting in Production after every change is long and boring.
(Can someone move this to the bug section?)
#4
12/21/2006 (4:18 pm)
Does the mission have a lot of detailed interiors? When testing against the WarZone demo (an old unoptimized version with a ton of lighting data) I noticed the raw lighting files (used for Design and Draft relights) were hitting close to 250MB in size. If your harddrive is almost full there might not be enough room to persist the file.

Also try running the mission in a stock 1.5 to see if the issue is related to any code changes or the mission.
#5
12/21/2006 (7:03 pm)
I tested it with stock TGE and the mission was a slightly altered Stronghold. The file size is only 2.9 MB. Is there anything else that might be causing this?
#6
12/22/2006 (8:38 pm)
Did your game mission relight correctly in stock 1.5 (or is your mission the slightly modified Stronghold mission)?

Does the stock Stronghold mission work in your code base?

If it seems like the problem is related to code changes try doing a quick diff between your code base and stock 1.5 looking for changes in sgScenePersist.cc, stream.h, fileStream.cc, and gBitmap.cc - these are most likely to affect the lighting persistence.

If the problem is related to the mission and not the code (your mission crashes stock 1.5) you can send over the mission and I'll debug 1.5 here to find out whats going on.
#7
12/23/2006 (5:08 am)
I made only minor changes (adding a script fucntion to check time). I altered stronghold by adding lots of triggers, but nothing that would change the lighting.
#8
12/23/2006 (9:04 am)
question removed


Never mind. Sorry, that was a stupid question - you already said the mission works in a stock 1.5.
#9
12/23/2006 (9:56 am)
So far this is what we know (please correct me if this is wrong):

-the modified engine and mission are not working correctly together
-the modified mission works great with stock 1.5


Just in case perform a rebuild (or clean and build on VC6/VC7/VC2003) - occasionally the build is in bad shape from incremental builds. This occurs infrequently enough that I'll often spend time looking at the code before remembering to try a rebuild.

If that doesn't help heres what I would do to test the code changes and make sure you're getting a solid working copy with as many of your updates as possible:

-backup your code

-unzip a clean stock 1.5 into a new directory
-replace the examples directory with your modified version (delete the stock version and copy yours into the new directory)
-compile the engine and verify that the mission relight works as expected

-diff the two code bases (I use WinMerge, it's fast and easy to use)
-select one of your modifications to merge into the stock 1.5 code and merge it in (by modification I mean "feature", one self contained change or resource with code thats independent of other changes)
-compile the engine and verify that the mission relight works as expected
-repeat this process until all of the code is in and working or (more likely) one of the changes introduces the relight problem into the new code base

When the problem shows up in the new code base you know the last set of changes you merge in are the problem. I usually back them out of the new code base (recompiling and testing again to make sure the problem is definitely gone) and continue merging other changes in and testing until the new code base is fully working with all of the working changes. Then you know which changes are working and which are not, and can drill down to find out why.

Btw: I never make changes to the original code base during this process (only the new code base), that way I always have a consistent reference to compare with.