in reply to Making an Interactive Game on a website (Texas Hold'em)

I'm in the process of working on such a game, one that can be played over a lan or the internet. I will be posting it here after a bit more testing. It is a scrabble-type game that can support up to 4 players. I will attempt a poker variant next using the same framework.

Now to get to your question. I originally wanted to do it via CGI, but you run into one big problem...CGI is a stateless protocol, so you will have to store all the sessions in a database of some sort, send out alot of hidden fields to maintain state of the users, and deal with the fact that you will need to force an update to all the users, that may require javascript ? Otherwise, the players won't know when the other players have played, unless they click an "update" button. So that is your big problem with using CGI.

Now I just decided that using TCP sockets was an easier way to go. You make a perl server listening on some port, and have your clients connect to it. I'm using Tk for the clients. The benefits of using TCP are: it maintains state, the server can send out data to the clients for updates, automatically; and it also allows for a little real-time chat between players.

So consider TCP for realtime games, it actually is easier than CGI, (once you learn a bit about sockets, and some Tk for the clients)


I'm not really a human, but I play one on earth. flash japh
  • Comment on Re: Making an Interactive Game on a website (Texas Hold'em)