Game Development Community

Do the gServerContainer and gClientContainer have the same world game object set?

by Ji Xinyu · in Torque 3D Professional · 01/29/2013 (7:30 pm) · 7 replies

Hi,any one can give me some pointing about the Container Database.In the document,it says that "Container maintains a database on both client and server for objects positioned in the simulation".So I want to know that whether the gServerContainer and gClientContainer have the same world game objects set?

#1
01/30/2013 (1:26 pm)
gServerContainer will contain all of the objects in the sim but I believe gClientContainer only contains objects that are currently being ghosted to the client.
#2
01/30/2013 (7:39 pm)
In that way,what occurs when scoped object are ghosted to the client on the client side?whether the client side will create the game object dynamically and copy the ghost information to it.Will the client side continuously create related game object dynamically with the movement of the control object?
#3
01/30/2013 (8:12 pm)
Ghost updates are only sent from server -> client, not client -> server or client <-> client. Essentially the server tells each client what objects exist in its sim each time it sends an update packet.

Objects that are ghosted to a client will be created by the client, initialized based on properties in any associated datablocks (which, remember, are sent by the server to the client on mission load), added to the client's gClientContainer/sim and managed/updated locally with occasional 'correction' packets coming from the server to keep everything in sync.

So, each client maintains its own version of the world with a limited selection of objects (typically those within visible distance) existing at any given time. Objects on the clientside are created and destroyed as they go in and out of scope. The server sends regular update packets to all clients that keep every client sim in relative sync.
#4
01/30/2013 (9:27 pm)
Thanks very much,I learned a lot of things from your message
#5
01/30/2013 (9:46 pm)
In the documentation at the top of the left pane there is a "reference guide" tab - in there under Modules/Networking you will find a document titled "On Ghosting and Scoping" that gives a good overview of how this works.
#6
01/31/2013 (12:44 am)
Thanks for Richard's pointing.By the way where can I find books, documents or other materials about the scene Graph of Torque.
#7
01/31/2013 (6:35 am)
Unfortunately, the best documentation is still the source code itself. That reference guide in the link is built from the internal documentation in the engine.

Check out the Scene class for starters.