Game Development Community

What is a Ghost?

by David Stoesz · in Torque 3D Professional · 08/09/2009 (1:48 pm) · 10 replies

Sorry if this is an obvious question, but scripted objects that I am dropping in using tthe World editor are flaged isGhost() true.
I know this has something to do with netObjects, but can someone explain what this setting means and what it is used for?

I am trying to name an object but can't because it is a Ghost.

#1
08/09/2009 (2:51 pm)
A "Ghost" is just the client-side copy of a server side object. For example, You have a player running around the server - The data is sent down to the client, and a copy is constructed there. This copy is the "ghost".

What your error is telling you is that you can't rename the client side copy, because it wouldn't really do anything. Instead, you need to create a server side command, and use CommandToServer to rename it on the server.
#2
08/09/2009 (3:30 pm)
Thanks Jaimi.
#3
08/09/2009 (3:54 pm)
Commonly its called Remote Object (because its controlled by a remote controller, not locally) or Proxy Object (because it approximates the state of a remotely controlled / server object).

I hope T3D will take the opportunity to bring "Ghost" in relation with the normal, industry standard terms in the documentation to help making understanding far simpler.
#4
08/09/2009 (4:08 pm)
Remote Object

Isn't that the thing people use to watch different crap on their tv, or do you mean those model airplane fanatics ;)
#5
08/09/2009 (5:06 pm)
@Marc - Proxy object wouldn't be right either. A proxy object would be an intermediate object on the client or server that looked like the class, but handled the transport layer (ie, talks to the remote class). A Ghost is a copy, not a proxy. Proxy is not short for "Approximate". Proxy is a word on it's own:the agency, function, or power of a person authorized to act as the deputy or substitute for another.

Think of it this way: The server talks to local objects. At some point, someone decides the object needs to live on another server, so a proxy is created, and the server continues to talk to the proxy, none the wiser (Actually, I wish it were that easy... but I digress). A ghost is different, because the server still has the real copy of the item, and the client has a copy also. But the client copy is a "ghost", and server changes are copied down to the client object. But it's one way - Client changes are not copied back up.
#6
08/09/2009 (6:34 pm)
Since "ghost" is part of the original Tribes networking writeup, IIRC, I would say the rest of the industry should change to fit the original standard ;)
#7
08/09/2009 (11:09 pm)
@Michael: lol ;-)

@Jaimi: Perhaps I've read the wrong books then, because what you describe by those books would exactly be a Proxy object.
Its controlled by the server only, the client network layer only gets "read access" to replicated object states from the server object and then tries to interpolate and extra polate approximated client side states for the object to be able to interact with it on a usefull scale, including smooth movement etc.
If it were a 1:1 copy, all we would get in multiplayer would be a superb teleport show and not even Tribes on 33k looked like that ;) (tribes 2 with jet pack high velocity hover tricks though did, but that was a speed where most games would look like that even today)

I used approximation because its a good way to remember what it does.
I know that Proxy does not really mean approximation, that would cut too much of what it is meant to do.

@Pat: hehe ;)
Problem is that Tribes more or less died, there was no active Researcher Team doing further work basing on it, was there ;)
And to be fair, Tribes 2 was the last good tribes, Vengeance was crap.
#8
08/10/2009 (3:52 am)
Actually, the term "ghost" comes from around 1991 or so from games such as Vroom on the Amiga. Maybe it appeared even before that, or shortly after, I can't remember. The term meant a copy of the motion of a previous race's controlled object (a car in this case). So you could race with your own time, seeing your own car from the race before. This is done even today in racing games. It was called a ghost, because the car would be made translucent, so it would not cover out parts of the track from you.

The ghost in Torque does much the same - except just a few milliseconds later.

To me, a proxy sounds like something that'd relay control instead.
#9
08/10/2009 (6:11 am)
@Konrad - Exactly. A proxy presumes that the processing is happening on the client, and that the server instance is just a relay. That is not the case with a ghost.
#10
08/10/2009 (12:07 pm)
I loved tribes