Client vs. Server separation
by Robert Lee · in Torque 3D Professional · 05/24/2009 (5:58 am) · 7 replies
I'm still on my learning curve on Torque tech, but I have a question that has come up as I make my way through.
While the architecture is client/server out of the box, its confusing all the "client" code that gets executed when I start up a dedicated server, such as audio, graphics, art and canvas setup.
What is the actual intent here? I've read many cautions in the various docs about keeping the two separate, yet they are intermingled all over the place in the code base.
Is the idea that everything get initialized on the server, even if its a "NULL" graphics device for example, to keep a common code base, or would it be worthwhile to work out a cleaner separation using packages so that if you are starting up a dedicated server, only server code gets executed per se?
Thanks for any insight offered up.
While the architecture is client/server out of the box, its confusing all the "client" code that gets executed when I start up a dedicated server, such as audio, graphics, art and canvas setup.
What is the actual intent here? I've read many cautions in the various docs about keeping the two separate, yet they are intermingled all over the place in the code base.
Is the idea that everything get initialized on the server, even if its a "NULL" graphics device for example, to keep a common code base, or would it be worthwhile to work out a cleaner separation using packages so that if you are starting up a dedicated server, only server code gets executed per se?
Thanks for any insight offered up.
#2
The audio layer probably doesn't need to exist, but leaving it on as a NULL device makes it easier for people hacking the codebase. You can be sure that calling play() on the server side code will work in single player and not crash in dedicated server mode.
GFX initialization follows the same theory as with audio.
The materials are loaded on the server because how things are currently designed the material can contain info used for effects which the server triggers on the client.
The Canvas probably doesn't need to be initialized... but i'm not sure what its doing there exactly, so i can't say.
All that said... i don't believe its hurting anything to have it work as it is now, but there will be more of a seperation in the future of Torque.
05/25/2009 (2:57 pm)
Quote:all the "client" code that gets executed when I start up a dedicated server, such as audio, graphics, art and canvas setup.Some of that may be something you could skip over... but most of it is importaint.
The audio layer probably doesn't need to exist, but leaving it on as a NULL device makes it easier for people hacking the codebase. You can be sure that calling play() on the server side code will work in single player and not crash in dedicated server mode.
GFX initialization follows the same theory as with audio.
The materials are loaded on the server because how things are currently designed the material can contain info used for effects which the server triggers on the client.
The Canvas probably doesn't need to be initialized... but i'm not sure what its doing there exactly, so i can't say.
All that said... i don't believe its hurting anything to have it work as it is now, but there will be more of a seperation in the future of Torque.
#3
Of course, you can deal with it by keeping DxDiag open in the background.
05/25/2009 (8:54 pm)
The only issue this creates is that DirectX needs to be running on the server machine for the dedicated server to load. Some rental servers have DirectX functions disabled to keep users from loading graphical apps via remote desktop. Of course, you can deal with it by keeping DxDiag open in the background.
#4
05/25/2009 (9:24 pm)
cool, thanks for the info. I think the DirectX needed for dedicated server issue was already written up as a bug, which I hope gets addressed.
#5
05/26/2009 (12:15 pm)
@Henry - Actually... that is a bug and i think it was reported as such already.
#6
The demos have intertwined code because they are dual-purpose. You can create a fairly good separation in script alone, by having clients only have client code and have your servers be dedicated-only.
05/26/2009 (12:32 pm)
You sure don't need the Canvas for a dedicated server. If you skip it Torque will simply not create a Window, plain a that.The demos have intertwined code because they are dual-purpose. You can create a fairly good separation in script alone, by having clients only have client code and have your servers be dedicated-only.
#7
01/25/2010 (4:37 am)
@did any knows how to run a dedicated server in linux......how i can compile c++ engine files and convert to bin files......
Torque Owner JesseL
Pyrotronics-Games
http://www.amazon.com/Multiplayer-Gaming-Engine-Coding-Torque/dp/1568814224/ref...