Game Development Community

New client connection to server on the same computer?

by Juan Lemus · in Torque Developer Network · 01/25/2010 (5:26 pm) · 1 replies

Is it possible on T3D to have multiple client connections on a computer to a server that’s on the same computer?

#1
01/26/2010 (6:30 pm)
Ok, I have been doing some research in the matter and having a little problem understanding the client-server relation. I have been exploring the code and I notice that there is no function that creates a client, unlike the server that has “createServer(%serverType, %mission);”. So I’m reading “Multiplayer gaming and engine coding for the Torque” and I’m looking at everything that the client is suppose to do (table 2.1, page 14) and I notice that it’s basically everything that the engine and client scripts are doing. So if I’m getting it right the client is basically a part of the engine itself that is interacting with the server and therefore is not an object that is created and that has the option of being manipulated. Which means that the answer to my question is: “No. Because the way T3D is setup right now, it would require to have 2 instances of Torque running on one computer at the same time and connecting to one of the servers of the Torque instances, and you can’t have two instances of Torque running at the same time”. So what I had in mind is to imitate the AI part of the code and create a new type of client2 and connection2, that will have all the client‘s and connections attributes (including crucial abilities such as being able to render the world). So once I have created this new client2 class, I will modify the script files so that the engine will be able to handle two clients instead of one (So instead of the engine being divided into client-server, it will be divided into client1-serverA client2-serverA). Is this a viable and/or effective solution so that I can implement multiplayer’s on the same computer, or am I just complicating myself and wasting time in a non viable solution?