Game Development Community

ScopeToClient - Only when needed?

by Welias D. Willie II · in Torque Game Engine · 12/17/2004 (12:32 pm) · 2 replies

Okay I had a need for client side only objects and I hit a dead end - why? two words - Collision Detection.

So know I am re-evaluating my project to see if there are alternate ways to accomplish what I need. Now I have a question about Scoping. I can't seem to find much about it in the forums, maybe someone can tell me more about how it works and if this is possible...

Can I create an object in the MissionCleanup.add() scene and have control of what clients these objects get scoped to.

I want to read object locations from a database, insert them into the world (server side) only when there is a player in a specific area. This is easy enough, however, I would like Player A who is 40 "milies" away from Player B to only have objects scoped to him that are in his area, while Player B is only having objects scoped to him that are of course in his area.

I am not sure how or when scopetoclient() is needed or how to insert an object server side and require a scopetoclient function to be called before it is placed on the client specified by the function. Can someone give some details?

#1
12/17/2004 (12:39 pm)
ScopeToClient from what I understand forces an object to be sent to the client.

TGE server currently uses a scope of the serverSceneGraph to figure out what to send to the client. So Player A will only see whats around him, and Player B will only see whats around him. That is assuming your scope range is small and not overlapping.

A ScopeToClient could be used if you wanted something forced to be sent to the client that was out of their scope range.
#2
12/31/2004 (11:20 am)
As a side note - the MissionCleanup is merely a grouping of objects that get deleted at the end of the mission - nothing more, nothing less.