Game Development Community

FxShapeReplicator bug?

by Mark Barner · in Torque Game Engine · 07/10/2006 (9:38 am) · 12 replies

I have been trying to use the fxShapeReplicator feature in TLK. I can not get it to load a shape. It works properly on TGE 1.4 but not on TLK 1.4. Any suggestions on what I may be doing wrong or is this a bug?

#1
07/10/2006 (10:05 am)
If I remember correctly when TGE 1.4 was first shipped those were broken. Basically you could load up a mission and they looked fine, but as soon as you changed them all of the replicated objects vanished.

Try doing a diff between the fxShapeReplicator source files in TGE 1.4 and TLK 1.4 to see what the non-TLK differences are - I have a feeling those were updated after the original 1.4 release.

Definitely let me know what you find, I'd like to get these fixed - thanks!
#2
07/10/2006 (10:41 am)
I did that. Only TLK differences showed up in winmerge. I checked both fxShapeReplicator.cc and fxShapeReplicator.h files. Is there any other files to check?
#3
07/11/2006 (12:11 am)
Hi Mark,

Sounds like it could be TLK related then, I'll log this as a bug and it should be resolved in the next release.
#4
07/11/2006 (5:55 am)
Hi Mark,

I just checked out our bug tracker and the issue I was referring to was already fixed (it looks like it existed in TLK 1.3.5/1.3.6). I tested the shape replicator by pulling a clean TLK, opening the TGE mission, and adding a replicator that uses 'tree3.dts', and everything worked correctly.

Are you seeing any errors in the console after trying to load a shape, and do the steps above work correctly for you using a clean TLK 1.4?
#5
07/11/2006 (8:29 am)
It works with a clean TLK 1.4. I am trying to figure out what is effecting it on my version since I did not do changes fxShapeReplicator source files. I ran winmerge on the .cc and .h , they are the same. I think I am going to take the clean TLK and add the other code that I have in my version one at a time to see what is happening. Thanks for your help.
#6
07/11/2006 (9:55 am)
Ok, I did a little more testing on what was going on. I downloaded a fresh copy of TLK 1.4. I tested the three missions with the same dts file that came with TLK 1.4. As long as I am in FPS mode it works. If I goto camera mode it does not work in any of the three missions. I tested out my version and the same results. So for some reason in camera mode the trees would not show using fxShapeReplicator in TLK 1.4. In the standard TGE 1.4 it worked in camera mode. Any ideas what source code I need to look at to fix this. Thanks
#7
07/11/2006 (1:38 pm)
Hmmm, I just tried it again and I think I'm not following the same steps because it keeps working here. :)

Here's what I did:

-Downloaded a fresh TLK 1.4 off of the GG site (in case our internal release is out of sync)
-Compiled in release mode without any changes (though I also tested in debug earlier)
-Ran the TGE demo mission
-Created a shape replicator while still in first person cam, the replicator used the 'tree3.dts'
-Saved

Switching from first person to third person or to free flight cam all show the trees. Also reloading the mission and doing the same also works.

I also tried loading up the TLK mission and creating the replicator using 'tree2.dts' in free flight cam mode, and then toggling between the views, which worked too.

Can you post the exact steps used to reproduce the problem, and the dts object you're using in the replicator (in case that is affecting it somehow).
#8
07/11/2006 (2:11 pm)
I have done the same thing you did.
Quote:-Downloaded a fresh TLK 1.4 off of the GG site (in case our internal release is out of sync)
-Compiled in release mode without any changes (though I also tested in debug earlier)
-Ran the TGE demo mission
-Created a shape replicator while still in first person cam, the replicator used the 'tree3.dts'
-Saved

But if I go to camera mode and change the count, the trees disappear. I switch back to fps or third person and change the count, the trees reappear.

Now if I am in camera mode(floating) and create it with the same tree as in the demo, nothing appears. I save it and reload the mission they are there.

As soon as I go into camera mode(floating) and make any adjustments, I click on apply...the trees disappear. I save it and reload mission, they are there.

As long as I am in fps or 3rd person view I can edit and move them around without the trees disappearing.

I used the trees in the demo 'tree3.dts' , 'tree2.dts' and my own... same results.
#9
07/11/2006 (2:33 pm)
That worked fine for me, what compiler are you using, and have you tried a clean build (I know it's a bit of a stretch)?


Here is the fix from the problem i mentioned earlier, which seems to be the same thing you're seeing now; originally the TLK update looked like this:

void fxShapeReplicator::inspectPostApply()
{
    // Set Parent.
    Parent::inspectPostApply();

    // Renew Shapes.
    RenewShapes();

    // Set Replication Mask.
[i]	//-----------------------------------------------
	// Lighting Pack code block
	//-----------------------------------------------
	setMaskBits(0xffffffff);
	//-----------------------------------------------
	// Lighting Pack code block
	//-----------------------------------------------[/i]
}

This is the fix (which should already be in your code, but is worth double checking):

void fxShapeReplicator::inspectPostApply()
{
    // Set Parent.
    Parent::inspectPostApply();

    // Renew Shapes.
    RenewShapes();

    // Set Replication Mask.
[i]	//-----------------------------------------------
	// Lighting Pack code block
	//-----------------------------------------------
[b]	//setMaskBits(0xffffffff);
	setMaskBits(ReplicationMask | sgAdvancedStaticOptionsData.sgNetEventMask);[/b]
	//-----------------------------------------------
	// Lighting Pack code block
	//-----------------------------------------------[/i]
}

If all else fails you might want to comment out all TLK code changes in the shape replicator to see if that helps, and if it does it will allow you to continue working until a fix is issued.

Let me know if any of this helps!
#10
07/11/2006 (3:05 pm)
I am using VC2005.

I treid it first with the TLK 1.4 download, then did a clean build with vc2005. Same results.

I have the fix of the above code. I'll comment the TLK code out and see if that works.
#11
07/11/2006 (4:20 pm)
I don't know what I did but I got it fixed. DUH! I commented out the TLK code and got an error. When I restored everything back to original state... it worked.




edit: I compiled it with vc6 and it works.
#12
07/11/2006 (9:03 pm)
Is it possible VS2005 didn't build the code because the exe was already in the example folder (it ships with TLK)?

That pre-packaged exe could have been built before the fix - I know this is a stretch, but weirder things have happened. :)