Mysterious ghosts/simgroups
by Sean H. · in Torque Game Engine · 06/10/2005 (12:00 pm) · 10 replies
Still learning my way around torque. its like everytime i learn something, i stumble over two more things I know nothing about. what i would like are conceptual explanations for two things in torque, ghosts and simgroups.
what are ghosts? ive read alot of game development paraphenalia, but ghosts are something which are unique to torque. Ken's explanation of ghosts: "This is a ghosted object, on all the clients, that has no controlling client scoped to it. We don't want that!" p179. No other explanation is given. later on he talks about ghosts, ghosting to clients in relation to mission loading, etc. without giving a proper explanation of just what the hell ghosts are. can someone explain this concept to me?
also what are simgroups and simsets about? whats the difference between the two? i understand theres a rootgroup and a mission group, why would i ever need to declare any others? are they containers for objects like arrays of structures? how are they different from goups in the mission editor and what are they useful for?
i admit i probably don't need to know about these two concepts for the game im going to make, but it would be nice to understand when these things are mentioned.
what are ghosts? ive read alot of game development paraphenalia, but ghosts are something which are unique to torque. Ken's explanation of ghosts: "This is a ghosted object, on all the clients, that has no controlling client scoped to it. We don't want that!" p179. No other explanation is given. later on he talks about ghosts, ghosting to clients in relation to mission loading, etc. without giving a proper explanation of just what the hell ghosts are. can someone explain this concept to me?
also what are simgroups and simsets about? whats the difference between the two? i understand theres a rootgroup and a mission group, why would i ever need to declare any others? are they containers for objects like arrays of structures? how are they different from goups in the mission editor and what are they useful for?
i admit i probably don't need to know about these two concepts for the game im going to make, but it would be nice to understand when these things are mentioned.
#2
1) Even in a single player game, there is always a "server" and a "client"--even when it's just a single executable image.
2) The server is the authoritative source for controlling and manipulating all in-game objects.
3) Clients only receive information about objects that are within their "scope", which basically means that if the player wouldn't be able to see it on their screen in the very near future, the server doesn't send any information at all about any particular object. Only when the object "comes in scope" to a client does the server send network updates about that particular object.
4) The process of defining and configuring which objects will be networked, and especially how they are networked to the clients is called "ghosting", and the client's "copy" of each of the server objects are known as "ghost objects".
06/10/2005 (12:38 pm)
Ghosting is the descriptive term for how objects are networked from the server to the clients. The topic itself is pretty in depth, but at the concept level it can be summarized by a few lines:1) Even in a single player game, there is always a "server" and a "client"--even when it's just a single executable image.
2) The server is the authoritative source for controlling and manipulating all in-game objects.
3) Clients only receive information about objects that are within their "scope", which basically means that if the player wouldn't be able to see it on their screen in the very near future, the server doesn't send any information at all about any particular object. Only when the object "comes in scope" to a client does the server send network updates about that particular object.
4) The process of defining and configuring which objects will be networked, and especially how they are networked to the clients is called "ghosting", and the client's "copy" of each of the server objects are known as "ghost objects".
#3
"Ghosting is best described by someone else though(like Stephen Zepp)"
06/10/2005 (12:50 pm)
Lol I was going to say"Ghosting is best described by someone else though(like Stephen Zepp)"
#4
06/10/2005 (12:58 pm)
He's my hero.
#5
to the best of my understanding, ghosting describes how collision information is sent to clients. i assume at some level, collision must be handled using a repetitive polling method. yet, it would be silly to have to test a client for collision against an object miles away. correct me if I'm wrong, but i think ghosting relates to the circumstances under which client interaction with an object(or copy thereof) becomes enabled. that makes sense.
does this have anything to do with the scopetoclient(%client) command? i dont understand what this does either.
06/10/2005 (3:24 pm)
Thanks alot matthew and stephen. i understand simgroups now, ghosts im still not sure about though. it sounds pretty complicated.to the best of my understanding, ghosting describes how collision information is sent to clients. i assume at some level, collision must be handled using a repetitive polling method. yet, it would be silly to have to test a client for collision against an object miles away. correct me if I'm wrong, but i think ghosting relates to the circumstances under which client interaction with an object(or copy thereof) becomes enabled. that makes sense.
Quote: Clients only receive information about objects that are within their "scope", which basically means that if the player wouldn't be able to see it on their screen in the very near future, the server doesn't send any information at all about any particular object. Only when the object "comes in scope" to a client does the server send network updates about that particular object.
does this have anything to do with the scopetoclient(%client) command? i dont understand what this does either.
#6
Essentially some things should always send updates to the client, the player object that client controls for instance, and thats what this command does.
Another similar command is setScopeAlways which basically does the same thing scopeToClient does, but to all clients, instead of a specific client.
06/10/2005 (3:32 pm)
ScopeToClient forces that object to be scoped on that client at all times, regardless of visibility or other criteria., clearScopeToClient undoes it.Essentially some things should always send updates to the client, the player object that client controls for instance, and thats what this command does.
Another similar command is setScopeAlways which basically does the same thing scopeToClient does, but to all clients, instead of a specific client.
#7
Let's say you have a building in your game that is not ghosted. Client A walks up to a spot in the world just prior to the building (on the server). Player A will not see the building at all--for rendering purposes, it's as if the building does not exist.
Now, say the player moves forward enough so that on the server, the player object collides with the building. Since collision is processed server side, and both the player and the building exist server side, the player will not be able to move into the same space as the building (unless they hit a door or whatever), but the player will never see what they are colliding with. While this may sound neat, it's probably not a technique that should be used, because having your client(s) and your server out of synch in this regard could have unusual, unintended consequences.
Ghosting in a single sentence: ghosting is the secure, protected mechanism that allows clients to observe and be aware of server objects.
06/11/2005 (11:40 am)
And to clarify: ghosting an object configures it for transmitting all possible knowledge about the object to a client, not just collision. An object that exists on the server, but isn't ghosted to clients won't be transmitted to the client at all, although it can have indirect effects on what the client sees happen. For example:Let's say you have a building in your game that is not ghosted. Client A walks up to a spot in the world just prior to the building (on the server). Player A will not see the building at all--for rendering purposes, it's as if the building does not exist.
Now, say the player moves forward enough so that on the server, the player object collides with the building. Since collision is processed server side, and both the player and the building exist server side, the player will not be able to move into the same space as the building (unless they hit a door or whatever), but the player will never see what they are colliding with. While this may sound neat, it's probably not a technique that should be used, because having your client(s) and your server out of synch in this regard could have unusual, unintended consequences.
Ghosting in a single sentence: ghosting is the secure, protected mechanism that allows clients to observe and be aware of server objects.
#8
wow, that source code must be a nightmare to trace...
06/12/2005 (12:27 pm)
Ok. i get it now. that sounds very complex. wow, that source code must be a nightmare to trace...
#9
06/13/2005 (3:33 pm)
Is there a way to do the opposie of "ScopeToClient", to block the network updates for a particular object?
#10
06/14/2005 (11:46 am)
You can simply not scope it--you have complete control with what is scoped to a client via the onCameraScopeQuery() command. You can make this as complex as you like.
Torque 3D Owner Matthew Langley
Torque
note: you can only add objects to them
... like this
commands like that, the .add(object) to add an object...
then you can use
to get that object... or
data.save("starter.fps/data/data.cs");that will save it out...
One difference between SimGroups and SimSets are that an Object can only belong to one SimGroup, so if you add it to a SimGroup then add it to another, it will "silently" be removed from the first... while an object can belong to multiple Simsets...
Ghosting is best described by someone else though