Re: pygame and socket.recv

2009-04-04 Thread Aaron Brady
On Apr 2, 5:46 pm, Tim Wintle tim.win...@teamrubber.com 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

Re: pygame and socket.recv

2009-04-04 Thread Aaron Brady
On Apr 2, 4:13 am, Tim Wintle tim.win...@teamrubber.com 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

Re: pygame and socket.recv

2009-04-02 Thread Hendrik van Rooyen
Aaron Brady cast...@gmail.com 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

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 add

Re: pygame and socket.recv

2009-04-02 Thread Aaron Brady
On Apr 2, 1:19 am, Hendrik van Rooyen m...@microcorp.co.za wrote: Aaron Brady cast...@gmail.com  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

Re: pygame and socket.recv

2009-04-02 Thread Aaron Brady
On Apr 2, 4:13 am, Tim Wintle tim.win...@teamrubber.com 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

Re: pygame and socket.recv

2009-04-02 Thread Hendrik van Rooyen
Aaron Brady cast@gmail.com wrote: On Apr 2, 1:19 am, Hendrik van Rooyen m...@microcorp.co.za wrote: Aaron Brady cast...@gmail.com wrote: 8 stuff showing small packets and adequate bandwidth -- What does some latency mean? - barely visible jitter, or a half second freeze?

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

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 Aaron Brady
On Apr 2, 10:12 am, Miguel Prada miguel.regis...@gmail.com 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.

Re: pygame and socket.recv

2009-04-02 Thread Rhodri James
On Thu, 02 Apr 2009 23:55:48 +0100, Aaron Brady castiro...@gmail.com 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

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

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

Re: pygame and socket.recv

2009-04-01 Thread Aaron Brady
On Apr 1, 8:28 pm, Tim Wintle tim.win...@teamrubber.com 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

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

Re: pygame and socket.recv

2009-04-01 Thread Aaron Brady
On Apr 1, 10:38 pm, Terry Reedy tjre...@udel.edu 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