Game Development Community

Question, Server / Client seperation, can you ?

by Bo Bjering · in Torque 3D Professional · 05/25/2009 (3:43 am) · 80 replies

Hiya :P

So, i want to ask a couple of questions in regards to my project im working on (As im "fairly" new to TG engines and how its working behind the curtain).

The client/game right now, starts up a client and server to connect the client to your local server, but, i wish to run the server as a external application (my own), using my own networking library, while still using the clients network to connect to my server (yes, multiplayer only).

What i need to understand here, is

1) Can you seperate the client/server structure of the dll at the moment in this engine (without too much hassle) eg to create single player games (no networking) and multiplayer seperated client/server, last one wich i need for my current project.

As im writing the server in C#, using my own very well working and tested network library (TCP), and let the client use the torque network to connect to my C# server.

And
2) IF you can seperate them, where would one go (in source, docs, forums ect) to find the info,idea on how to do that.

Thanks :)
Page «Previous 1 2 3 4 Last »
#1
05/25/2009 (5:08 am)
If you don't use the Torque library it's not just changing the send/recv/IO completion ports/etc. It's the whole protocol...
How is your well working and tested network library better? Cause the Tribes network protocol has quite a reputation...
#2
05/25/2009 (5:27 am)
@Micheal

"How is your well working and tested network library better"

1) Didnt say it was better, though it is for what WE need it for.
2) Its written in C#, using C# to make server = make server ALOT faster (for us).
3) Our server code is already written (basic) and a plugin (C# .cs) for adding packet types, servicing ect.
4) Its been tested to handle 4000 users at same time.
5) Its 100% standalone, and have clustering posibility (should need arrive)
6) -> Its what we need for our game, simple as that <-.

While we have no problems using the network library in the client for the client, the server code is un-needed and un-wanted for our project.

I dont sit around asking these questions for fun, if i thought the current networking had what we need, i woudnt ask for this :)
#3
05/25/2009 (6:24 am)
There's precedent of people using Torque as a client and something else as a server. Your server "only" needs to know how to talk to it (of course it's never that easy, but it's doable).

As for your answer, all you need to do is go into the source and delete anything you don't need, simple as that. Since you're using your own server tech, I need more details: are you using the stock classes (Player, etc)? Are you porting their server logic to your server? Or are you using custom classes?

(If your game involves moving characters around, you *will* want client-side prediction for player movement. So this means part of your player movement logic must exist in both the client and the server.)
#4
05/25/2009 (6:37 am)
By better I meant better for you, not "generally" better, no need to feel oppressed :)
Couldn't you just strip the dedicated server code to a bare minimum then write some C++/CLI glu to get to your C#?
#5
05/25/2009 (11:25 am)
@Playlore

Thanks, i guess ill have to dig into the source to find out where what goes and do what, would be nice maybe if someone had some experience with it :)

Our game will use A* pathfinding or similar for player locations, as it will be a iso/ortho 3d, click on map to walk to point, i think our prediction is pretty normal, click somewhere, and it will use start loc-& end loc to automaticly calculate path to walk, all clients gets the start point, end point, current point, and then calculate path, well not intirely as simple, but close enough, i did some mmo server things earlier.

@Micheal

Didnt feel opressed :), just had to make it clear i asked for this because i needed it and not because it was a real option to use it or not, also why i asked for help on this.

And the option you said is not possible im affraid, though thanks for the suggestion :) (lets not start arguing why :P)
#6
05/25/2009 (12:15 pm)

By client/server separation, do you mean writing and running a custom server application written in C# and using Torque as a client to that application? If so, that would be a pretty hopeless task I guess. Torque's client and server code are tightly interwoven (as in any game engine, I guess).

If it is about changing the networking infrastructure, then I suppose you could just switch the transport layer that Torque is using. That would mostly affect the networking code in the platform layer. You could put Torque in a mixed-mode .NET C++ DLL and have the network interface allow your C# to hook in so that coordinating and transmitting packets runs on top of your network transport layer rather than on top of plain TCP.

However, I'm still sitting on a pretty large deficit when it comes to knowing about Torque networking so maybe this is all some completely worthless rambling.
#7
05/25/2009 (1:18 pm)
@Rene

Yes to your first question :) and i surely expect it to be possible.

Well, i sure hope you are mistaken about client/server seperation, or else this engine is absolutely useless for anyone wishing to use there own server code, or just making a single player game with absolutely no server code.

Infact, i dont see the reason why this client should absolutely need a server locally to connect a single player client, to me its absolutely ridiculous if that is the case.

Being dependent on any networking code in any engine is a bad idea, networking is a addon for a engine, or a plus so to say, and should not be directly tied into everything the engine does, i have never seen any other engine that does that, 0$ or 3 mill$, -> ever <- so i hope this is not the case with Torque3D, or it would be a serious bug in my mind.

Having a clean client, no netcode, use Torque network code, add opcodes and construct packets, send to server, or completely remove all networking code ect.. that should be possible, or else it needs to become it.

Thanks for idea about hook ect, but, as i said, that better not be nessesary :)

P.S, not trying to sound rude, i really do appriciate the input you gave me :).

P.P.S If you look at other engines, they come with networking samples, and not actually engine source that has networking already programming into everything, there should be a clean release aswell for us who wishes not to use networking code at all, or who wishes to use our own or customizing it to specific needs.
#8
05/25/2009 (1:25 pm)

What I meant is not where the server code is running (locally or remote) but rather what the server code looks like.

In plainer words than before: if you intend to write a custom server that uses the "Torque protocol" to talk to the client, then no way. If you intend to move the dedicated server code out into a separate application and wrap some parts in a .NET assembly, then sure; a bit of work but doable.

Most game engines really don't use much of a well-defined protocol but rather just write some code that synchronizes data structures at both ends.
#9
05/25/2009 (1:27 pm)
Quote:1) Can you seperate the client/server structure of the dll at the moment in this engine
Not really... every NetObject derived class contains bother server and client code. So splitting that up would be very difficult, but really not desirable.

To do what your wanting to do you would either need to...

A) Reverse engineer the existing Torque networking protocol and mimic it in your C# server.

B) Modifiy ConnectionProtocol, NetConnection, and GameConnection to work within your own network protocol and work out the format of individual pack/unpackUpdates and read/writePacketData so you can send data to them.

C) Write a custom class which talks with your C# server and directly modifies the Torque server side objects running in local server mode (this means single player).

I've done C before... it works and its the easiest way to control Torque objects from an external server.

So this is very possible... but of course challenging.
#10
05/25/2009 (2:21 pm)
Okay, then someone probably should modify the engine purchase page, it is nowhere descriped you are required to use the torque engine networking for all your games (you are required as its virtually close to impossible apparently to do your own networking).

And as no other engine in the intire world does this but torque, perhaps you actually should tell people this before they buy (as this makes any game not actually planned on using torque engine alot more hard, if not impossible to do, and will require alot more developing time).

We plan to make a MMO using our own server tech wich is based on well proven tech (well proven for us anyways) and we used for other mmo server projects, we are familiar with it and the coding required for quickly creating everything server side, so basicly, thats now out of the question, and we stand to loose month and months of developing time.

Im going to wait to tell my team this and see if i can find a quick solution myself, because this will mess things up considerably if i cant (relations).
#11
05/25/2009 (2:25 pm)
Quote:And as no other engine in the intire world does this

Huh????? Have you actually looked at these engines? Unreal, for example, does basically the same thing as Torque only that it's synchronization of objects is more automatic and somewhat smarter.

PS: It would be really cool if people were a bit more careful before crying wolf and go claiming that they've been so utterly betrayed.
#12
05/25/2009 (2:50 pm)
Isn't the built-in "award winning networking" model part of the prime attraction of Torque to begin with? It's called researching and understanding the product before purchasing.

And there's that phrase "MMO" ;) so I will point out that there have been MMO projects (even successful ones) based on Torque with a suitable display of adaptability.
#13
05/25/2009 (2:56 pm)
I do not believe that you and your team have properly understood the problem you are attempting to solve.
#14
05/25/2009 (3:14 pm)
@Rene

Unreal engine does not do that "out of the box", it was programmed into games like Unreal Turnament and so on, last i checked anyways, i know someone who has source access.

@Micheal

"award winning networking", prime attraction sure, for some who needs it, but attrative as its required and has to run in every game made as its the backbone of the system, not so sure, and not mentioned anywhere.

Yes MMO, im unsure if that is a problem, i know people say its hard and such, but as i stated before, this isnt our first dance, and while other MMO has been build using torque in the past, i dont see anywhere they actually use there own networking lib.

But okay, we can spend ALOT of time learning torque networking, or just use what we know (C# networking, our own libs ect) and the already written core of the networking applications for this game, oh wait, no we cant do that really.

@Pat

Enlighten me.

#15
05/25/2009 (3:20 pm)
Don't see whats preventing you from using the torque networking in your own technology.
Thats after all everything that would be needed, as the server side does not need to be torques, your server just needs to talk "torquish" :)
And that this part can be done has been proofen by TNL / OpenTNL
#16
05/25/2009 (3:20 pm)

@Bo
Sorry, but that is BS. Unreal's Core package contains the code for replicating UnrealScript objects. Well, last time I checked--which admittedly was way back in the dark ages...

Whatever... have fun...
#17
05/25/2009 (3:26 pm)
@Rene

It might contain the code, dont know, but i know its not executed nor required by default, and games you make can run fine without it "out of box".

But okay, whatever (such a nice word, no reason to get mad)..

@Marc

Nothing "really" prevents us, other then we already spend TONS of time making our own server systems and code, and we have knowledge and know excatly how to implement and expand our server source, while we where prepared to use torque's client code to connect to the server if possible (and C# is simply faster to code tools on).

We have seperated client handling, sql system, and so on, and so on, already ready to be implemented and used.

P.S Me and the team also have some "guidelines" for our networking packets and encryptions, data types we are going to use and such, wich makes it hard to use torque's client "code" directly (100%) thats running right now.

While we do want to use torques networking "client side" system, the way/type packets send would probably need some tweaking for implementing our MMO specific packets (login, movements, npc movements, item packets and so on and so on).
#18
05/25/2009 (4:06 pm)
Quote:
It might contain the code, dont know, but i know its not executed nor required by default, and games you make can run fine without it "out of box".
Dude...that doesn't even make any sense. The code to pack/unpack updates, and process time-steps using that data and such is a core piece of each game object. Unreal, Torque or any other networked engine...it doesn't matter.

The idea that client simulation code is separable from server simulation code, which is separable from game-code is ludicrous. What data objects use to determine their position from frame-to-frame, and tick-to-tick needs to be the same on both the client, and the server or the results won't line up, and you will burn all your network time resolving the deltas between client-land and server-land. Furthermore, the code which processes that data (which must be the same) also needs to be 100% deterministic, across platforms (and in your case, programming languages). The data needs to be processed the same way on the server as it is on the client, otherwise the server is operating blind...it sends data to the client, and simply assumes the client is properly representing it. I simply don't understand how you intend to maintain an authoritative server model when your C# server isn't capable of representing Torque objects.

Game networking is not the same as application networking...like I don't even understand how you think you are going to communicate network scope of objects. Do you plan on simply updating every object every tick and sending all that info down the pipe to the clients every network tick? All that info; even the stuff that didn't change? Do you need to communicate animation poses? Do you need to synchronize animations and particle effects? Do you need to smoothly interpolate data which is updated at varying frequencies? Do you need to communicate with the Torque object-type system to instantiate Torque objects on a client machine?

I cannot even begin to fathom the exploits that would be possible given the system you have described.
#19
05/25/2009 (4:12 pm)

@Pat
Hey Pat, that "Skills: Novice Programmer" thing really made me chuckle. Clever disguise :)
#20
05/25/2009 (4:20 pm)
I think changed it to Novice shortly after talking with some of the dudes at RAD Game Tools a few years ago. I may know a lot about Torque, but...
Page «Previous 1 2 3 4 Last »