Game Development Community

Some multiplayer questions

by J Sears · in Torque Game Builder · 04/29/2007 (10:59 pm) · 5 replies

If I wanted the multiplayer of a game to connect to a master server that had chat and a list of games and when the number of players was reached launched a game with a person hosting. And then if the host left it would automatically keep the play going on another comp is all that possible or would I need to look into getting the pro version?

#1
04/29/2007 (11:11 pm)
Should theoretically be possible as the TCPObject etc are all available through script in TGB.
#2
04/30/2007 (4:30 pm)
J Sears, you can implement the chat and master server concepts with the TCPObject ... I actually wrote some code that replaces the TGE Master Server stuff with a custom TCPObject based one that communicates over ... OMG.... HTTP ... It retrieves a list of servers from a web call, powered by a PHP Script ... which feeds from a MySQL Database ... and allows the website to display the running server list as well ...

Implementing the chat wouldn't be too hard either ... creating a simple socket server is fairly easy in C or C++ ... you could even do it in a scripting language such as Python or PHP ... then just bind your TCPObject to this socket server and communicate with plain-text packets ... use the IRC Protocol as a reference ... or ... just use the IRC Protocol period ;)

As for the host leaving and the game still running ... this would require that your host actually be a separate system and you would then attach clients to it ... this might be a bit more tricky .... however, with TCPObject ... you could implement a fairly easy 'server' as well in any language of your choice ...
#3
04/30/2007 (5:53 pm)
Alright knowing that it is in some way possible is very helpfull this should get me on the right research path to try and get a handle on it, thank you.
#4
04/30/2007 (6:00 pm)
Two words. Jab ber. Okay. So it's one word. Jabber. aka XMPP: theoreticalgames.com/portal/Home/tabid/36/EntryID/27/Default.aspx

I'm working on a resource for Torque (TGB, TGE, etc.) that will integrate the iksemel library. I've got quite a bit of functionality already ready already but you don't have to wait for me. It's cheap (free) and easy.

edit: and in terms of non-Pro licensing - you can use TCPObject and handle all the Jabber communication in script, but yes, Pro would probably be easier.

-Andrew Douglas
theoreticalgames.com
#5
04/30/2007 (6:28 pm)
Heh --- the jabber protocol, without a library ... is a tad bit too extensive ... the IRC Protocol is a plain text protocol that requires a little string parsing only ... where as Jabber communicates with XML ... and would add lots of additional overhead for something such as a game which already has a ton of overhead to begin with ... not to knock the idea Andrew ... I just don't see using Jabber as a functional solution for In-Game chat ...

IRC Supports the concept of private messages ... player to player 'whispering' ...
IRC Supports the concept of 'rooms' (channels) ...

and, if you run the standard ircd daemon ... you can control all sorts of things, such as registering all your game users with the server and have the game client automatically 'log them in' ... and then let the ircd manage who can join what 'rooms' and who can't ... etc, etc ... you can also create 'rooms' to support Guild Chat and other such things, etc, etc ...

All you have to do to support IRC is some extremely basis socket stuff, of which most is already done for you with TCPObject ... so all you really have to do is interpret whats being sent back and forth ... writing a quick script library ... you could create a simple class in TorqueScript that handles all the finite details of the IRC protocol ... such as how to format the messages, etc ... examples of communicating with IRC are all over the place as well ... you don't really have to concern yourself with the language the examples are written in ... just how the example communicates back and forth really ...


I think a Jabber resource would be cool ... but, like I said, I fail to see an XML Based chat systems being a logical solution for a game ... if your implementing chat then you've probably already got a good amount of network overhead, and most likely even have a good amount of stuff going on with the video ... so wasting resources to parse large XML messages seems a waste of time ...