Re: pygame and socket.recv

2009-04-04 Thread Aaron Brady
On Apr 2, 4:13 am, Tim Wintle wrote: > On Wed, 2009-04-01 at 18:45 -0700, Aaron Brady wrote: > > > My game loop looks like this: > > > poll events, get 1 at most > > send to server > > wait for server reply > > render entire frame > > The look I'm suggesting is: > > poll events > write to (non-blo

Re: pygame and socket.recv

2009-04-04 Thread Aaron Brady
On Apr 2, 5:46 pm, Tim Wintle wrote: > On Thu, 2009-04-02 at 06:50 -0700, Aaron Brady wrote: > > It's just that if you register a collision in between the time that > > one object has changed its position and momentum, and the time you > > learn about it, you have to retroactively edit the collisi

Re: pygame and socket.recv

2009-04-02 Thread Rhodri James
On Thu, 02 Apr 2009 23:55:48 +0100, Aaron Brady wrote: I switched to UDP. My average round-trip time is at 50 trips/sec, but my worst round-trip time is still in the 10-20 range. I also tried buffer sizes of 2**8 and 2**12, with about the same results. So, UDP might free up some processor

Re: pygame and socket.recv

2009-04-02 Thread Aaron Brady
On Apr 2, 10:12 am, Miguel Prada wrote: > I don't know if this might be causing your problem, but most socket > implementations use quite a big buffer for incoming data by default. I > had a lot of trouble with another real-time networked application > until I realised this. Reducing this buffer t

Re: pygame and socket.recv

2009-04-02 Thread Tim Wintle
On Thu, 2009-04-02 at 06:50 -0700, Aaron Brady wrote: > It's just that if you register a collision in between the time that > one object has changed its position and momentum, and the time you > learn about it, you have to retroactively edit the collision, restore > hit points, and recalculate the

Re: pygame and socket.recv

2009-04-02 Thread Miguel Prada
I don't know if this might be causing your problem, but most socket implementations use quite a big buffer for incoming data by default. I had a lot of trouble with another real-time networked application until I realised this. Reducing this buffer to the minimum helped a lot in my case. Also, I wo

Re: pygame and socket.recv

2009-04-02 Thread Hendrik van Rooyen
"Aaron Brady" wrote: On Apr 2, 1:19 am, "Hendrik van Rooyen" wrote: >> "Aaron Brady" wrote: >> 8< stuff showing small packets and adequate bandwidth -- >> What does "some latency" mean? - barely visible jitter, or a half >> second freeze? > >I've got a rather amateur loop keepi

Re: pygame and socket.recv

2009-04-02 Thread Aaron Brady
On Apr 2, 4:13 am, Tim Wintle wrote: > On Wed, 2009-04-01 at 18:45 -0700, Aaron Brady wrote: > > > My game loop looks like this: > > > poll events, get 1 at most > > send to server > > wait for server reply > > render entire frame > > The look I'm suggesting is: > > poll events > write to (non-blo

Re: pygame and socket.recv

2009-04-02 Thread Aaron Brady
On Apr 2, 1:19 am, "Hendrik van Rooyen" wrote: > "Aaron Brady"  wrote: > > > Hi, > > > I tried writing a small game on a pygame layer.  The graphics are > > fine, and at the moment, it is not graphics intensive.  It is multi- > > player, and for the communication, I am sending a pickle string acr

Re: pygame and socket.recv

2009-04-02 Thread Tim Wintle
On Wed, 2009-04-01 at 18:45 -0700, Aaron Brady wrote: > > My game loop looks like this: > > poll events, get 1 at most > send to server > wait for server reply > render entire frame The look I'm suggesting is: poll events write to (non-blocking) socket render frame check non-blocking socket and

Re: pygame and socket.recv

2009-04-02 Thread Hendrik van Rooyen
"Aaron Brady" wrote: > Hi, > > I tried writing a small game on a pygame layer. The graphics are > fine, and at the moment, it is not graphics intensive. It is multi- > player, and for the communication, I am sending a pickle string across > a LAN, once per frame. How big is this pickle - i.

Re: pygame and socket.recv

2009-04-01 Thread Aaron Brady
On Apr 1, 10:38 pm, Terry Reedy wrote: > Aaron Brady wrote: > > > My game loop looks like this: > > > poll events, get 1 at most > > send to server > > wait for server reply > > render entire frame > > I am very sure that commercial 'real-time' (versus turn-based) > multiplayer games do not operat

Re: pygame and socket.recv

2009-04-01 Thread Terry Reedy
Aaron Brady wrote: My game loop looks like this: poll events, get 1 at most send to server wait for server reply render entire frame I am very sure that commercial 'real-time' (versus turn-based) multiplayer games do not operate that way, at least not the ones I have played. I suspect tha

Re: pygame and socket.recv

2009-04-01 Thread Aaron Brady
On Apr 1, 8:28 pm, Tim Wintle wrote: > On Wed, 2009-04-01 at 17:58 -0700, Aaron Brady wrote: > > I tried writing a small game on a pygame layer.  The graphics are > > fine, and at the moment, it is not graphics intensive.  It is multi- > > player, and for the communication, I am sending a pickle s

Re: pygame and socket.recv

2009-04-01 Thread Tim Wintle
On Wed, 2009-04-01 at 17:58 -0700, Aaron Brady wrote: > I tried writing a small game on a pygame layer. The graphics are > fine, and at the moment, it is not graphics intensive. It is multi- > player, and for the communication, I am sending a pickle string across > a LAN, once per frame. > > I'm

pygame and socket.recv

2009-04-01 Thread Aaron Brady
Hi, I tried writing a small game on a pygame layer. The graphics are fine, and at the moment, it is not graphics intensive. It is multi- player, and for the communication, I am sending a pickle string across a LAN, once per frame. I'm observing some latency. It seems that socket.recv isn't per