Game Development Community

New Decal eliminates UniversalLight

by Alan James · in Torque Game Engine · 01/17/2007 (4:48 pm) · 2 replies

O.K., John, I haven't given you any problems in a while so I figured it's about time I did. :)

Here's what I've got going on, (and I'm not sure how I manage to break things this way) but what is happening is that when I create a new datablock for a decal in sgExample.cs, then bring up the World Editor Creator in the ingame GUI, then Mission Objects, Environment, sgUniversalStaticLights, the last light on my list is missing.

If I comment out a block of decals in sgExample.cs, then the same number of lights are now listed again. I seemed to notice this about the time I integrated the BT Tank Pack, Tank emitters and treadmarks,FX1 Pack and Tim Heldna's Heli resource...oh and the fxshape & fxfoliage replicator clustering Resource. I can comment out their scripts (specifically the heli resouce heli.cs and chaingun.cs) and everything seems to return to close to normal, but I don't see anything like duplication of emitters, datablocks or anything else that I can figure would cause this behavior. Everything works fine, except that if the level uses one of the lights for example I'll get a missing content error on load (without a specific reference to what it was missing, just an "Invalid Packet Gamebase::unPackUpdate()" error.

Now the question is this: Is this error really because of a missing light, or does it sound like I hosed something in code regarding the Lighting Kit inadverently with all of those code changes? Like I mentioned, everthing seems to be working ok, I can add new lights, if I delete in the .MIS files all the lights then place new ones in the levels they load, but I can't figure out the decal thing. No matter where I put the datablocks for them, i.e. what script file and how high up or down in the game.cs, if they are there, the equal number of lights disappear from the in game editor.

I've done something bad, haven't I? BTW, if you were wondering this is all 1.4. The last time I tried to merge my build (with GLSL) to 1.5 and Winmerge hit 1300 differences, I figured CN:MI would be released on 1.4. Maybe the next game will be 1.5. =)

Any ideas would be appreciated. But I'm a realist. If it's obvious I've borked it, I can handle the truth.

- Alan

#1
01/22/2007 (11:25 am)
Probably the best thing to do is run the game in stock TLK 1.4 and see if it still happens. If not slowly add the resources back in until it does - this will show you where the problem is occurring.
#2
05/11/2007 (6:25 pm)
In case anyone comes across this and has the same "disappearing" data blocks problem as I did, I finally stumbled across the solution. In simBase.h change:

DataBlockObjectIdBitSize = 10,

to

DataBlockObjectIdBitSize = 12,

This change adds two bits to the datablock-id size, DataBlockObjectIdBitSize, increasing the allowable datablock limit from 1023 to 4095.

- Alan
Really Really Good Things Studio