Re: 2-player game, client and server at localhost
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: 2-player game, client and server at localhost

From: Peter Hansen <peter@engcorp.com>
Date: Sat Jul 30 2005 - 19:50:19 CEST

Michael Rybak wrote:
> I'm writing a 2-players game that should support network mode. I'm now
> testing it on 1 PC since I don't have 2. I directly use sockets, and
> both client and server do computations, the only data transfered is
> user mouse/kbd input.
>
> It works synchronously, but somehow, when I play in client window,
> both client and server have 17 fps, while when playing in server
> window, server has 44 fps while client has 5, and due to forced
> synchronization, they both run very slowly (I wonder how come server
> says it has 44fps?).
>
> Does anybody have an idea how can this be?

I'd suggest not spending time profiling, debugging, optimizing a
"home-brewed" implementation using sockets but switch to Twisted or Pyro
or something like that and save yourself a lot of headaches.

Chances are this will magically speed things up to acceptable levels, too.

-Peter
Received on Thu Sep 29 17:16:11 2005