JojoLinkyBob has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Sage Scripters:

I am working on a game soon that will incorporate client/server interaction. Currently I am web-hosted by addr.com, which is pretty flexible with server-side Perl (although I am limited on hits per month). The game will resemble an avatar-community, requiring members to be able to see each other in real-time. Here's my current plan of action:

1) Write a Perl script that runs on the web server to handle user log-in.

2) When a user creates a log-in, they are added to the server's user list (text-file). The user list would contain info like username, special_id, IP address.

3) Each time a player logs on, it retrieves the IP list from the server, this list is stored locally, and from then on the client manages everything else. If a user has a dynamic dial-up IP, it's address is updated in the main file as well.

4) Through P2P, the client connects to each of the IP in its list at some refresh interval, updating it's database accordingly Any unresolved pings are tossed from the list and it's assumed that user has logged off.

Some problems:

1) Is this too much of a load on the server? I've heard something about pre-compiling your perl scripts as byte-code. Would that be feasible in this case?

2) I don't want to get a nasty letter from my webhost saying I've received too much traffic, and will be charged extra. So minimal server interaction is what I'm striving for. I'm guessing that this won't be a big problem, unless it really catches on, and then that's a good problem :)

My apologies if this question isn't totally Perl-centric. What strategies would you recommend? My current method of invoking the scripts from C++ is to use an Intelligent Agent class for grabbing URLs (e.g. http://www.mywebhost.com/jojo/server.pl)

Maybe I shouldn't be using a web-server,Or should I use a special CPAN module for handling TCP/IP that runs on a server farm or something? If you know of a cheap server service, I'd be glad to know too.

Question In A NutShell:

Low-budget game designer seeks client/server strategy for multiplayer game, incorporating Perl and his web-server. Open to suggestions.

Thanks in advance, End-Of-Ramble Reached

Desert coder
  • Comment on Low-Budget Multiplayer Client/Serve Solution for Web Server-Side Perl

Replies are listed 'Best First'.
Re: Low-Budget Multiplayer Client/Serve Solution for Web Server-Side Perl
by merlyn (Sage) on May 08, 2001 at 19:12 UTC
      Cool, looks exactly like what I'll need. I'm not sure if my host supports it (or whether that's an issue), but I'll spend the time checking it out.
      Thx, jojo