Game Development Community

Bad zones crashing particle emitter

by Sim Ops Studios (#0003) · in Torque Game Engine Advanced · 09/07/2007 (2:17 pm) · 2 replies

Hello again! Thank you to everyone for all your help to-date!

We seem to be having trouble in TGEA 1.01 with a DIF model we have created in using Torque Constructor 1.0.2. This model is an underground tunnel with no explicitly-defined zones or portals (I'm afraid I don't know enough about Torque Constructor to fully understand what zones are implicitly created). Most objects we place in the scene are fine, but when we attempt to place a particle emitter inside the tunnel we crash on access to uninitialized memory.

I've been able to trace the problem to a line in sceneGraph\sceneGraph.cpp. Inserting the following two lines at line 841 of this file (inside the function SceneGraph::rezoneObject) catches the problem:

S32 zoneSize=mZoneLists.size();
AssertFatal(masterZoneBuffer[i] < zoneSize, "Error, attempted to insert object into nonexistant zone.");

So masterZoneBuffer[0] is pointing to a zone that doesn't show up in mZoneLists. I'm consulting the source code in sceneGraph.cpp; it's tricky for me to understand exactly what mZoneLists is. Could this access error be caused by a problem in our DIF? If so, how can we diagnose this or change our DIF to account for the issue? A quick glance at masterZoneBuffer reveals that most of the values in that array are greater than the size of the mZoneLists list.

Thank you for your help!

#1
09/07/2007 (3:20 pm)
I *believe* that one of the bugfixes I did on Constructor 1.0.3 will fix this for you.
#2
09/08/2007 (1:36 pm)
Thanks for the heads-up.

We aren't able to upgrade our Constructor just yet, but I was able to fix the problem in our specific case. We opened the .csx file in a text editor and removed all the 'portal' objects that had been added. Not sure why they were causing us trouble, but re-building the DIF after doing that seemed to work.