2-player game, client and server at localhost

Peter Hansen peter at engcorp.com
Sat Jul 30 19:50:19 CEST 2005


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



More information about the Python-list mailing list