TGEA 1.7.0 Beta 1 Bug - Shape Replicator bug
by Marc Dreamora Schaerer · in Torque Game Engine Advanced · 03/20/2008 (1:08 am) · 7 replies
When changing the spawn radius (x,y) or the spawn count of shapes within the shape replicator, the previously generated trees do not disappear. If you just click in the same field again, the trees start to add up instead of beeing removed and new trees beeing placed.
Visually they get placed on top of the existing trees.
Visually they get placed on top of the existing trees.
About the author
#2
Would guess that the instanciation does not deinstanciate correctly.
03/20/2008 (10:12 am)
I've VS 2005 Pro, so potentially yes :)Would guess that the instanciation does not deinstanciate correctly.
#3
03/21/2008 (7:59 am)
This has been fixed... Here are the necessary changes:@@ -210,7 +210,7 @@
RandomGen.setSeed(mFieldData.mSeed);
// Set shape vector.
- mReplicatedShapes.reserve(mFieldData.mShapeCount);
+ mReplicatedShapes.clear();
// Add shapes.
for (U32 idx = 0; idx < mFieldData.mShapeCount; idx++)
@@ -396,6 +396,8 @@
}
+ mCurrentShapeCount = mReplicatedShapes.size();
+
// Take first Timestamp.
mLastRenderTime = Platform::getVirtualMilliseconds();
}
@@ -430,7 +432,7 @@
}
// Empty the Replicated Shapes Vector.
- mReplicatedShapes.empty();
+ mReplicatedShapes.clear();
// Reset Shape Count.
mCurrentShapeCount = 0;
#4
03/21/2008 (8:31 am)
That empty/clear bug has been there since the dawn of time, but it never broke the old replicator because it was using the Vector in a funny way. I've not had time to look over any of the code for 1.7 yet. Has the replicator been redesigned?
#5
03/21/2008 (3:52 pm)
It seems so because before I never had sky high piles of trees and it never broke down to 1 FPS after 20 clicks on my 8800GTS 640MB SuperClocked ...
#6
03/22/2008 (8:35 am)
When you delete the replicator, the shapes are still there. Even if you exit and enter the mission again. Does the above code fix this?
Community Manager Michael Perry
ZombieShortbus
Normal
Upped the shape count
Specs:
Windows XP SP2
Visual Studio 2008 Express
2 GB RAM
nVidia 8800 GTS
I'll see if the bug repeats on an executable compiled in another version of VS.