Objects on a dedicated server
by DMT · in Torque 3D Beginner · 08/04/2010 (8:44 pm) · 2 replies
Hey,
I built a level using the world editor, throughout it I placed various objects and gave them names. I did this all offline. I also coded in some basic interactions with said objects, such as picking them up. I then wanted to see how everything would work online, so I setup a dedicated server on a separate computer and connected to it. When I joined I could see the objects just fine but I could not interact with them.
I handled interaction by putting code in PlayGui::OnMouseDown and performing raycasts that would check for objects on the mouse click. I always get errors that saying that there was an error calling "getName" on the object. This would make sense as the objects, although present, seem to have lost the names I gave them. I am also unable to select them in the world editor, only when I enable it while connected to the server. I am also unable to call any functions(dump) by calling their names. I suppose this all has to do with how Torque performs the networking with object ghosting and whatnot.
My problem is that I just simply do not understand this as well as I should. I would appreciate it if someone could help me wrap my head around this.
I built a level using the world editor, throughout it I placed various objects and gave them names. I did this all offline. I also coded in some basic interactions with said objects, such as picking them up. I then wanted to see how everything would work online, so I setup a dedicated server on a separate computer and connected to it. When I joined I could see the objects just fine but I could not interact with them.
I handled interaction by putting code in PlayGui::OnMouseDown and performing raycasts that would check for objects on the mouse click. I always get errors that saying that there was an error calling "getName" on the object. This would make sense as the objects, although present, seem to have lost the names I gave them. I am also unable to select them in the world editor, only when I enable it while connected to the server. I am also unable to call any functions(dump) by calling their names. I suppose this all has to do with how Torque performs the networking with object ghosting and whatnot.
My problem is that I just simply do not understand this as well as I should. I would appreciate it if someone could help me wrap my head around this.
About the author
#2
Aside from the obvious things, what should be controlled by the server, or I suppose the question is what can I leave client side? For instance, who should handle things like collisions? For instance I can understand leaving the code for colliding with other players(AI/client) and such on the server but I don't see an obvious reason to do so in the form of environmental collisions, at least not in my very basic scenario.
Thanks for the help so far!
08/05/2010 (8:19 pm)
So a raycast should not be done client side? Or should the server just enable the client to perform it using some commandToClient function?Aside from the obvious things, what should be controlled by the server, or I suppose the question is what can I leave client side? For instance, who should handle things like collisions? For instance I can understand leaving the code for colliding with other players(AI/client) and such on the server but I don't see an obvious reason to do so in the form of environmental collisions, at least not in my very basic scenario.
Thanks for the help so far!
Torque 3D Owner Ted Southard