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?


2 Answers 2


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.

  • \$\begingroup\$ 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 \$\endgroup\$
    – Krom
    Commented Nov 25, 2010 at 6:31
  • \$\begingroup\$ @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? \$\endgroup\$
    – o0'.
    Commented Nov 25, 2010 at 9:11
  • \$\begingroup\$ As I've mentioned everything else is working good enough :) You may want to check our SVN (code.google.com/p/castlesand) \$\endgroup\$
    – Krom
    Commented Nov 25, 2010 at 9:30

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.

  • \$\begingroup\$ 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? \$\endgroup\$
    – Krom
    Commented Nov 25, 2010 at 6:26
  • 2
    \$\begingroup\$ @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. \$\endgroup\$
    – bummzack
    Commented Nov 25, 2010 at 7:05
  • \$\begingroup\$ 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? \$\endgroup\$
    – Krom
    Commented Nov 25, 2010 at 7:38
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Nov 26, 2010 at 23:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .