Dedicated Server Problems
by Greg Gardinier · in Torque Game Engine · 03/28/2006 (7:50 pm) · 3 replies
I have setup a dedicated server so that I can test my current project online with other team members. I got it all working and had upwards of 6 people connected at one time. No problem.
However, there are many things within my game that are broken EXCLUSIVELY on the dedicated server. These include a teleporter we have put in as well as several objects (which won't mount to the player).
None of these issues occur when playing of my LAN only on my"dedicated" server.
I know the server and my client are the exact same version (I have checked many times). As of right now I don't know what to do. I don't understand why a dedicated server is so much different from a normal one.
At this point I am stuck if someone could point me in a direction or supply a solution it would be greatly appreciated.
Thanks in advance...
However, there are many things within my game that are broken EXCLUSIVELY on the dedicated server. These include a teleporter we have put in as well as several objects (which won't mount to the player).
None of these issues occur when playing of my LAN only on my"dedicated" server.
I know the server and my client are the exact same version (I have checked many times). As of right now I don't know what to do. I don't understand why a dedicated server is so much different from a normal one.
At this point I am stuck if someone could point me in a direction or supply a solution it would be greatly appreciated.
Thanks in advance...
About the author
#2
This is because you've probably written the code without keeping in mind that the client and server are seperate instances. When you're running a non-dedicated server (the client and server are on the same instance) then it won't matter, but that's bad programming practice and you'll have to rethink the whole structure.
There's nothing limiting you to run the dedicated server on the internet, it can be run on LAN as well (and yours probably does already). A dedicated server is just that it has no client associated with it, and thus receives more processing time and is more ideal for production and heavy load.
You'll have to dig into the forums and the documents, and try to find examples of commandToServer / commandToClient code, and try to understand it. It might take a while, but it's worth it and you won't be getting long without it.
When you're executing code on a listen server (the type of which you ran on your LAN), you don't have to take into account that they are different, this is why you're having problems.
Basically, your teleporter should still work, but anything else that tries to talk to the client or GUI, won't.. as you'll have to send that in commands. On the other hand, if you had 6 players before - you should have seen problems even back then, because if you don't code like suggested above, only the player running the server will have working functionality.
So I'm not sure what you're doing that's wrong specifically, post some code and it'll be easier.
03/29/2006 (2:34 am)
Quote:
I have setup a dedicated server so that I can test my current project online with other team members. I got it all working and had upwards of 6 people connected at one time. No problem.
However, there are many things within my game that are broken EXCLUSIVELY on the dedicated server. These include a teleporter we have put in as well as several objects (which wont mount to the player).
This is because you've probably written the code without keeping in mind that the client and server are seperate instances. When you're running a non-dedicated server (the client and server are on the same instance) then it won't matter, but that's bad programming practice and you'll have to rethink the whole structure.
Quote:
None of these issues occur when playing of my LAN only on my"dedicated" server.
There's nothing limiting you to run the dedicated server on the internet, it can be run on LAN as well (and yours probably does already). A dedicated server is just that it has no client associated with it, and thus receives more processing time and is more ideal for production and heavy load.
Quote:
I know the server and my client are the exact same version (I have checked many times). As of right now I don't know what to do. I don't understand why a dedicated server is so much different from a normal one.
You'll have to dig into the forums and the documents, and try to find examples of commandToServer / commandToClient code, and try to understand it. It might take a while, but it's worth it and you won't be getting long without it.
When you're executing code on a listen server (the type of which you ran on your LAN), you don't have to take into account that they are different, this is why you're having problems.
Basically, your teleporter should still work, but anything else that tries to talk to the client or GUI, won't.. as you'll have to send that in commands. On the other hand, if you had 6 players before - you should have seen problems even back then, because if you don't code like suggested above, only the player running the server will have working functionality.
So I'm not sure what you're doing that's wrong specifically, post some code and it'll be easier.
#3
Everything in client/ is code only run on the client side when connecting to a ded. server
Everything in server/ is code run on the server
Nothing is shared between these when you split the server and client into separate instances. So a global on the server is not accesible on the client side.
As advised above - check the commandToServer etc. for examples and you will see how it works.
03/29/2006 (4:01 am)
Simple (unless you changed a lot of the base script code):Everything in client/ is code only run on the client side when connecting to a ded. server
Everything in server/ is code run on the server
Nothing is shared between these when you split the server and client into separate instances. So a global on the server is not accesible on the client side.
As advised above - check the commandToServer etc. for examples and you will see how it works.
Torque Owner Paul /*Wedge*/ DElia
"None of these issues occur when playing of my LAN only on my"dedicated" server."
There are client/server syncronicity coding issues that won't show up when the client and server are running in the same instance of TGE.