Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm writing my own RTS game in Delphi. Single-player part is almost done and works well and I'm thinking about adding multi-player to it now. There's going to be a lobby where players should be able to chat and organize games. I tried googling for a convenient way to do it, but couldn't find anything related ..

My idea looks like follows:

  • Players are identified by Names they choose and their IPs
  • There's main chat area where all players meet
  • There are rooms, where players may select game options (map, teams, flag colors, etc..).
  • After everything is settled players exchange IPs and multi-player engine starts.

I want to avoid usage of server-side software. Currently I'm looking into running everything through SQL database where each player commits posts and his state and reads other players posts/states.

Whats the common practice of organizing in-game chat lobby?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

As far as I'm aware an SQL database used as you described is server-side software.

In any case, the database seems like a really bad idea since you will not be able to restrict how it may be altered.

Common practice is to have a custom program running that relay messages in a meaningful manner. For basic purposes it shouldn't be a big coding job, you can keep everything in memory, though everything is not a lot since you can ditch a message as soon as it has been sent to all receivers.

share|improve this answer
    
atm I'm using PHP pages on a server, they receive messages as parameters (e.g. post_msg.php?t=Player1?m=Hello_World?a=mainlobby will construct SQL query to add message by Player1 to Main room). The biggest drawback is need to constantly query server to get new messages from other players :( See above comment for more questions please –  Krom Nov 25 '10 at 6:31
    
@Kromster: you can keep doing it this way... or maybe you can do something that, you know, actually works. The chat lobby isn't the first thing you are doing in your game, isn't it? –  Lohoris Nov 25 '10 at 9:11
    
As I've mentioned everything else is working good enough :) You may want to check our SVN (code.google.com/p/castlesand) –  Krom Nov 25 '10 at 9:30
add comment

If your going to have a database somewhere, you minus well have your own custom server application running.

You could have all of the matches listed in a database and the messages as well, but if you go with your own server application, it'll be far safer in terms if authority. (it's not a fool proof option, but definitely a better one)

It seems like you only want the server to relay messages and match making. It wouldn't be a huge pain to get something simple up and running. It'll be worth it in the long run when you start having concurrency problems and people messing with your database.

There really is no point in avoiding server software when your going to have a database somewhere any way. Don't restrict yourself for no good reason.

share|improve this answer
    
Okay, let's say I need a server-side application running. What kind of server do I need? I have a site hosted, I guess that I need to upload EXE there and run it somehow and "listen" for ingoing messages and issue outgoing messages in return? How do I deploy and run the exe on server? –  Krom Nov 25 '10 at 6:26
2  
@Kromster yes, you need to deploy an executable to the server that can keep a socket connection open to your clients. This isn't something that you can do on a typical shared-host. Best would probably be some dedicated server (or virtual-server) where you get root access. –  bummzack Nov 25 '10 at 7:05
    
I wonder if there are any servers that provide services like one I need at once. E.g. I've heard some games used IRC for lobby setup, perhaps there are other ready solutions? –  Krom Nov 25 '10 at 7:38
    
Some web hosters allow databases. If you go with your route, maybe you could get away with hosting it on a website of yours? I wouldn't recommend this and I'm not sure if it would even work. If you just need a lobby, xfire or other services like an irc could definitely work for you. –  Michael Coleman Nov 26 '10 at 23:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.