Game Development Community

Is instancing optimized and ready to go in the 1.1 build?

by Jonas · in Torque 3D Professional · 11/23/2010 (2:50 am) · 8 replies

Hi everyone another short question.

How is the instancing working in the 1.1 beta 3 build? is it working as intended and ready to be used without
engine coding? im asking this because it is called 'beta' and if there is any hitch in the code that would slow things down please let me know.

Kind regards
Jonas

About the author

Freelance 3D artist at day scripter/coder on Enduring Life at night. Lover of all things TorqueScript.


#1
11/23/2010 (12:31 pm)
It's as working as it's gonna get ...

... but yeah, it works, but it's designed to cut drawcalls for "lots" of instances, not four or five. eg: I have a thousand trees, but only the drawcalls for for one of each type of tree that I'm using.
#2
11/23/2010 (7:51 pm)
Ye of course with the tragedy it wont get much more forward just needed to ask the question.

Yes that is the idea, thanks for the answer.

Kind reagrds
Jonas
#3
11/24/2010 (8:03 am)
Been playing around a bit with the instancing a bit and i have to say that its working very well.

However i wonder if there a way to use this in multiplayer, AKA using the %sourceclient.tree.isrenderenabled = false or something like that, been looknig around but havent found a nice way to do it yet.
#4
11/24/2010 (2:41 pm)
I don't see why not ... but my knowledge of networking is ... er ... limited to say the least.

I'd guess that you could send it as a server/client command.
#5
11/25/2010 (4:14 am)
yes im currently look at the risk reward on taxing the connection even more ill make some tests on it and get back on that.

Also i noticed a significant drop in polygons/drawcalls when upgrading to 1.1 using the Metrics(shadow); command. Is that something that handles it better or did they just upgrade metrics?
#6
12/01/2010 (9:26 am)
Hey again sorry for reviving a old thread of mine but i have been looking into the commandToClient functionality but it does not work that well for me it is probably a syntax error on some degree (i have read the syntax guide ofc) alot of bad habits from C++ who in my opinion have a different approace then scripting in torque.

This is what i got so far:

datablock TriggerData( Rendertest )
{
tickPeriodMS = 1000;
};

function Rendertest::onLeaveTrigger( %this, %trigger, %obj)
{
echo("Leaveing Trigger");
}

function Rendertest::onEnterTrigger( %this, %trigger, %obj, %sourceclient)
{
echo("Entering Trigger");

if(tree_test.isrenderenabled)
Triggertime(tree_king);
commandToClient(%sourceclient, tree_king.isrenderenabled = false);
echo("READ THE ENTIRE CODE");
}

NOTE: These are located in one script contained within: game/scripts/server/
another thing of note is that the functions have %obj etc but are not used this is a salvaged trigger and i havent cleaned it yet.

WHat happens is that what ever happens i see the echo's on the client 'holding' the server NOT on the other client but the effect happens on both clients. This in my opinion is a scoping error targeting all clients and not only the client tripping the wire.

Kind regards
/jonas
#7
12/01/2010 (12:32 pm)
I think you missed the correct syntax on the 'commandToClient' server command.

commandToClient( clientId, clientFunctionAsATaggedString, params…)

So for example, the server-side call:
commandToClient( %client, 'updateScore', +10);

(see the tagged string 'updateScore', with simple quotes and not double quotes)

will trigger the client-side function:
clientCmdUpdateScore( %deltaScore )

Nicolas Buquet
www.buquet-net.com/cv/
#8
12/01/2010 (1:02 pm)
Got it now thanks everyone!

Kind regards
/Jonas