Jump to content

Removing Networking


Jay Copeland

Recommended Posts

Hello everyone,


I just downloaded the 3.9 release on my Linux desktop and got it up and running, I'm really happy to see it support the environment so much better than it has in the past. However, the project I'm working on requires a modification that I'm not sure I will be able to make, but I thought I'd ask you guys.


Is it possible to remove the built-in multiplayer networking component of the engine? I mean ... anything is technically possible with open source engines, but I'm curious just how heavily integrated it is.

Link to comment
Share on other sites

Why you want to do it? You can just make your game singleplayer only, no need to remove networking.

 

I'm the main programmer on board at this point, and I've worked an early-build MMO client-server model from our previous attempts at the project into something somewhat standalone, and I want to work it into Torque, but I can't get it working. I'm wondering if the built-in networking component is what's getting in the way. I would rather strip out what's in Torque and work in a fresh new version of what we've made than try to get what we have working around what's already there and ignoring it. In fact, doing so, according to a couple of people I know networking from the college, is considered a (albeit non-defcon) security risk.


I mean, they could be wrong, they aren't industry pros they're mostly info security in corporate settings, but I still think they probably have a good basis on the thought. Unless someone has a suggestion on how I could somehow rework the built-in networking altogether, that's what I'm looking at.


Would I benefit from making that client-server model a plugin to the engine versus built-in? I would think that too would be a security risk versus just going full into building it into the engine and thusly client.


If that makes sense, please shout if I'm not clarifying right. :)

Link to comment
Share on other sites

docs

https://github.com/GarageGames/Torque3D/blob/bacf0cde2af17ab6f25c7effe0308035f164d54e/Engine/source/sim/netObject.h#L59

docs

https://github.com/GarageGames/Torque3D/blob/7bba3ee2de610c2757bc70eba10db869bab72a85/Engine/source/console/simDatablock.h#L37

docs

https://github.com/GarageGames/Torque3D/blob/7bba3ee2de610c2757bc70eba10db869bab72a85/Engine/source/sim/netInterface.h#L28

example of a recent tweak

https://github.com/GarageGames/Torque3D/pull/1358/files


tl;dr: Pretty tightly coupled. Server-authorative. Would tend to agree with the general assessment that mixing networking methods without some deep diving is likely to lead to oversights in security if that's what they meant. Otherwise would like to hear about it as an issue at a minimum.

Link to comment
Share on other sites

Why you want to do it? You can just make your game singleplayer only, no need to remove networking.

 

I'm the main programmer on board at this point, and I've worked an early-build MMO client-server model from our previous attempts at the project into something somewhat standalone, and I want to work it into Torque, but I can't get it working. I'm wondering if the built-in networking component is what's getting in the way. I would rather strip out what's in Torque and work in a fresh new version of what we've made than try to get what we have working around what's already there and ignoring it. In fact, doing so, according to a couple of people I know networking from the college, is considered a (albeit non-defcon) security risk.


I mean, they could be wrong, they aren't industry pros they're mostly info security in corporate settings, but I still think they probably have a good basis on the thought. Unless someone has a suggestion on how I could somehow rework the built-in networking altogether, that's what I'm looking at.


Would I benefit from making that client-server model a plugin to the engine versus built-in? I would think that too would be a security risk versus just going full into building it into the engine and thusly client.


If that makes sense, please shout if I'm not clarifying right. :)

 

Details for the particular setup you're shooting for would be useful, but on a basic level, I'm not sure how extreme a security risk an uninitialized and unused networking layer would be.


For example, if you wrote a custom game class that worked with your custom networking model and doesn't interact with the built-in packet handling in any way, then any theoretical bits exposed that could be set couldn't really be utilized to mess with the custom game class.


If your security buds have specific points of concern a la security, those could probably be addressed, but if your stuff doesn't interact with the existing networking, I don't think it'd really matter much.

Link to comment
Share on other sites

 

Thanks for the links, definitely gave me a little bit better perspective on what's going on there in integration. :)

 

tl;dr: Pretty tightly coupled. Server-authorative. Would tend to agree with the general assessment that mixing networking methods without some deep diving is likely to lead to oversights in security if that's what they meant. Otherwise would like to hear about it as an issue at a minimum.

 

I do see how "neatly" the Torque networking is written, it's definitely better than a lot of networking I've seen in other projects.

 

Details for the particular setup you're shooting for would be useful, but on a basic level, I'm not sure how extreme a security risk an uninitialized and unused networking layer would be.

 

The worry my buds expressed wasn't so much of exploiting the system as it is, but having the underlying and unused networking there, if we ever decided to offer a paid upgrade system to the game, would allow a way for people to figure out how to set up their own multiplayer system just as good or better without paying. Sure, that shouldn't happen based on the idea people would go for ease of use versus cost, but look at all the WoW private servers, the desire to avoid payment is there. I know the argument and idea is silly in an open source setup of a project's engine, but it's still completely viable, right?

 

If your security buds have specific points of concern a la security, those could probably be addressed, but if your stuff doesn't interact with the existing networking, I don't think it'd really matter much.

 

Again, very true that it's not an issue too much of immediate security, but allowing such a thing to exist untouched invites it to be used as an exploit in some form. If my train of thought makes sense. :roll:


Final note: I would give details in particular, however at this point with all the engine modifications and overall design preplanning I'm working on to see if what we want is possible within the realm of reason, I'd rather just see if in a generic sense what I'm asking is so.

Link to comment
Share on other sites

Okay, I can give one further detail now that I know for sure we're going that route:


Our plan, if we could strip out the networking inside Torque, would be to replace it with our system that's tied to the Oracle Linux server we built for the server-side half of the project.


The thought is, would it be worth trying to edit the existing networking components to try to properly make use of the powerful Oracle server setup, or would we be better off stripping it out and replacing it?

Link to comment
Share on other sites

After years of taking on projects that seemed reasonable at first but turned into monstrous quagmires before they were finished, if ever, I can say for sure that if I were you, I would try to work with Torque's existing networking layer before I'd try to strip it all out and replace it. It is very fast, by the way - I wonder if your Oracle system is as efficient in terms the needs of a realtime game, ie using the absolute least number of bits possible for the required data? This is one area where Torque benefits from its history as a first person game engine from the nineties, where everybody needed a smooth framerate while playing Tribes over their dialup modem connections.


Even if you do rely exclusively on the Oracle system, if your only concern is to make it impossible for players to play multiplayer on their own for free, it seems like you could come up with a myriad of ways to break that functionality without rewriting the whole engine to strip out the network code. I assume you're not going to release your source code, given the concern about exploits, so it would seem that a simple monkey wrench in the right place would be enough to make it impossible to connect to another player without going through your authenticated system.

Link to comment
Share on other sites

After years of taking on projects that seemed reasonable at first but turned into monstrous quagmires before they were finished, if ever, I can say for sure that if I were you, I would try to work with Torque's existing networking layer before I'd try to strip it all out and replace it. It is very fast, by the way - I wonder if your Oracle system is as efficient in terms the needs of a realtime game, ie using the absolute least number of bits possible for the required data? This is one area where Torque benefits from its history as a first person game engine from the nineties, where everybody needed a smooth framerate while playing Tribes over their dialup modem connections.


Even if you do rely exclusively on the Oracle system, if your only concern is to make it impossible for players to play multiplayer on their own for free, it seems like you could come up with a myriad of ways to break that functionality without rewriting the whole engine to strip out the network code. I assume you're not going to release your source code, given the concern about exploits, so it would seem that a simple monkey wrench in the right place would be enough to make it impossible to connect to another player without going through your authenticated system.

 

Excellent points ... yeah I'd probably be better off breaking functionality versus stripping it out if I could.


We will not be releasing source, correct. Though we're basing on Torque3D, we're heavily modifying several aspects with fully custom code, much of which we've sort of rigged together without input from others or books or anything to get specific functions and mechanics we want working. At this point it's mostly in the form of Torque plugins but we'll be changing that as time goes on after the release of Torque 4.0 (we're gonna end up basing mostly on that particular release, based on what we've heard rumor and such of the plans for that release and what we liked from 3.9's changes.)


Well after talking with a few friends in networking at the college, I actually got some suggestions on possibly figuring out a way to modify the Torque networking to specifically point towards and rely on the Oracle system. I know it's possible ... but would that be a good idea?

Link to comment
Share on other sites

Just what does your Oracle system do? Is it for persistence or frame by frame updates? Can you really hit it for player positions 32+ times a second, for all players? My only experience of anything database related is that interacting with them is far slower than that, but maybe what you have is a game-specific application designed for just what you are trying to do.


For what I'm used to doing with online games and databases, you would use the Torque networking for all the frame by frame updates, and then check in with the database periodically to save current position and sanity check the current state, etc., but I've never (in my admittedly old school, limited experience) heard of anyone using a database for realtime, frame by frame game state updates.

Link to comment
Share on other sites

  • 4 weeks later...

I've been thinking about this for a couple of weeks. Short answer is, no. You can not strip out Torque's networking nor can you really "point" the Torque networking towards an Oracle system. There is no situation in which Torque networking code is actually unused.


Torque networking is by definition a connection between a Torque client and a Torque server. The structure is baked in one step below the top level of torque's game object class inheritance tree and forms the basis for all interactive and updatable game components. It is the mechanism used (among other important things) to update and synchronize a high-level object's tick-based mathematical simulation and framerate-based interpolation/rendering.


Objects are basically designed as two halves. Each half expected to operate in a specific space where the server side updates data as needed (and *only* as needed) and the client side uses that data to maintain a simulation's rendering and media output. A game object must have both to function. So there really is no such thing as a non-networked Torque game. What appears to be single-player is functionally just a networked game with a local client attached in which the server does not accept external connections. As far as game objects are concerned, the client/server interchange involved with keeping objects updated and rendering them is no different than if the client were attached over the internet.


Which gets to what you are trying to accomplish. As far as preventing people from connecting to future multiplayer servers through some sort of hypothetical script hack, it would simply take nulling out a couple of engine functions that handle finding and connecting to external servers. Likewise, the engine capacity to host multiplayer could be disabled in a similar fashion.


As for the Oracle thing ... what does the Oracle system do? What information does it provide/manage and what is the anticipated client update frequency? Are you planning on requiring the single-player version of the game to have a connection to the Oracle server?


Any way it goes, unless you want to rewrite pretty much the entire engine the Oracle server will need to update the Torque simulation somehow while still letting Torque networking do it's thing. I'd say maybe create a custom network link between Oracle and the Torque server to update the master simulation as desired. If real-time control of the sim is needed, latch it into the main loop and get an Oracle sync/update just before all the objects tick or something. In that case any changes as the Torque server interacts with Oracle that impact the visual sim would be seamlessly pushed through to the client(s) regardless if the client is local or remote.


Thing is, you're adding a ton of potential latency any way you do it. The more frequently Oracle updates Torque, the more latency will accumulate. For stuff that would only happen a few times per session - like saving/loading games, managing lobbies, etc. - the issue wouldn't be a big deal at all. For functionality that controls/impacts the sim in real-time, it seems like the issue could cascade pretty damn fast. Weather or not it is a good idea has a lot to do with which end of the spectrum your envisioned use sits on.


If you are dead-set on linking the technologies with a sub-second update interval, I'd recommend only considering it for a multi-player situation with Torque compiled into Linux alongside Oracle on a server so the link between the two can be accomplished via a local connection (or engineer with a seriously high-bandwidth physical pipe). For something like that, I honestly think performance might prove to be an interesting (but perhaps not insurmountable) challenge.

Link to comment
Share on other sites

  • 1 month later...

The Oracle system is intended to do a few major tasks wherein the primary function is storage. There are three Oracle systems we have spread across three server blades at the moment, all tied into the game intranet. There's one for accounts and account data, one for game data storage, and one for game update management (rolling out patches and major content updates).


To clarify ... and let the cat out of the bag as it were .. this is a MOG. Not an FPS or anything standard which I see Torque used for. A lot of the assertions being sent from the server won't update much beyond a set necessity, the only major things will be player positions and their impacts therein on the world ... of course all being managed on an authoritative basis.


The use of the Oracle system specifically is because we can implement (and have tested to a rough 65% success rate, the other 45% yielding mostly network issues ... yet TBD) a system wherein most patches to the game can be applied and distributed without taking the server offline. Sort of killing off the concept of weekly maintenance downtime.


Now, if there's a way I can implement ALL of that using only Torque networking tied into say just a MySQL database, or a way to sort of separate the Torque server from Torque client to accomplish this stuff, I'll hear it out.


Wayyy back when I first started with TGE I had bought the MMO kit, but that has essentially become useless as there's no more real documentation and it's just plain incompatible now, and I don't know if I can pull off converting that or if it would just be better to go from scratch or something.

Link to comment
Share on other sites

Link to comment
Share on other sites

A lot of the assertions being sent from the server won't update much beyond a set necessity, the only major things will be player positions and their impacts therein on the world ... of course all being managed on an authoritative basis.

Translation, all the server will be doing is everything.


The torque server will interface pretty securely with all of your 3 different servers pretty easily. There is clear separation of client and server so thats secure, and if you believe you have a network developer thats smart enough to create a better networking system than the torque one, then they should be smart enough to know how to spend 10% of that time adding extra security to that system instead of re-inventing the wheel.


You seem to be fixated on an area of security which tbh is probably unachievable in real terms, regardless of which engine you use, even if you write your own. There are ways of course, but then you are heading somewhat down the same path as starforce and the same sort of destructive issues. Simply put, security and inconvenience are partners in crime, the more secure you want something the more you inconvenience your users, this will remain a truism until the day night cycle of the planet ends.

Link to comment
Share on other sites

A lot of the assertions being sent from the server won't update much beyond a set necessity, the only major things will be player positions and their impacts therein on the world ... of course all being managed on an authoritative basis.

Translation, all the server will be doing is everything.


The torque server will interface pretty securely with all of your 3 different servers pretty easily. There is clear separation of client and server so thats secure, and if you believe you have a network developer thats smart enough to create a better networking system than the torque one, then they should be smart enough to know how to spend 10% of that time adding extra security to that system instead of re-inventing the wheel.


You seem to be fixated on an area of security which tbh is probably unachievable in real terms, regardless of which engine you use, even if you write your own. There are ways of course, but then you are heading somewhat down the same path as starforce and the same sort of destructive issues. Simply put, security and inconvenience are partners in crime, the more secure you want something the more you inconvenience your users, this will remain a truism until the day night cycle of the planet ends.

 

Quite right.


I'm not exactly fixated on an area of security that is unachieveable, I very well understand that as long as the server can be accessed through internet, there will be security risks that will need patching. Thus is the nature of networking. I wanted to ask here on the forums because I was led to believe that an internal system such as Torque's connected and worked into a system such as our Oracle system would be a bigger security risk than what is considered normally acceptable (for patching, etc.) Personally I love Torque's networking system, but running a few of the features from the Oracle system I find invaluable to give up for simplicity sake for the network dev. I'm starting to feel the guy just doesn't want to put the work in to get Torque to work with our Oracle system :x ... so without saying more about that, we'll see where that goes.


Thank you, @Bloodknight , for confirming it's certainly possible, even more than acceptable, to hook the two systems together. I've got another network dev coming on board and I'm going to see what he has to say about ... hopefully contrary to ... what I've heard so far.

 

hrm... authserv might be able to get away with a variant of https://github.com/Azaezel/Torque3D/commit/d7271b991c9bcc062d52722a8237d2388d4ee104#diff-1ab2c1df3b24c2dd18b4d50cdc9be880R249 + https://github.com/Azaezel/Torque3D/commit/d7271b991c9bcc062d52722a8237d2388d4ee104#diff-a29d2b33e0ee5e904dd964ac24c77af5R63 though the position storage bit.. that would indeed most likely involve digging into the guts a bit,,,

 

I'll have a look at these, and see what my new network dev thinks. Maybe you'll inspire something from him. :lol:

Link to comment
Share on other sites

Torque networking doesn't necessarily do what you are talking about. It's only purpose is to accept controller inputs from the client and feed back the bare minimum needed for a client to properly render it's current simulation. The facility is so completely different in design and function from Oracle you should almost treat it's use of "networking" as a homophone.


It sounds like the tasks you are trying to accomplish with Oracle are things not implicit in the engine that would need to be built for every individual game any way it goes. A common approach is to use server-side data files (processed in script) to maintain static information. For a single player game, of course, that means local data files on a user's machine.


I'm not going to call it trivial, but changing from accessing locally-stored files to extracting equivalent data from an external server is a reasonably typical task. This isn't significantly different to accomplish for a Torque app than it is in any other context. It should just be a matter of writing a handler to expose the desired data from the Oracle side and calling it at the appropriate times in the game process to retrieve/store data as needed.


Updating values in the torque server will implicitly update clients if any changes impact game objects which are significant in a client's context/scope. There are potential implications and security concerns with how this is accomplished, but that is an entirely different set of questions and concerns than securely maintaining authoritative static game data. For an online-only game, there is no reason Oracle should be exposed at all from the client's perspective. In your application, Torque's design seems to provide the benefit of reducing potential network exposure footprint significantly.


The updating without downtime part is an interesting question. I assume this would be a server-side update that doesn't distribute a new client app? Hypothetically it seems totally doable. Something like: alert the clients to enter a "suspend" mode so they don't disconnect, save server state, launch updated exe, restore server state, "unsuspend" clients. You could probably even pull the bulk of it off with pure script.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...