[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] SOC Proposal: Networking for Pygame



On 5/8/06, Rene Dudfield <renesd@xxxxxxxxx> wrote:
wait() is useful if your game is minimised or paused.  So that it
doesn't use cpu when it's not supposed to be doing anything.

for completeness sake, I feel I must mention that I accomplish all
those same benefits with frame rate limiting with pygame.time.wait()
(rather than clock.tick or pygame.event.wait), so that my pause menus
can animate (I wouldn't have it any other way), but I got no beef with
supporting a wait call.

There's some non games on the project page using pygame.

My two non-game wait programs are: An upload program that prints the
url for copying when it uploads.  A musical pad program which uses ddr
mats to trigger samples.  Both of these I want to use as little cpu as
possible and wait is good for that.

You have convinced me that having events wake up wait calls for new
network packets is a necessity, because people clearly are using
pygame for non-games. I still would rather not have to get my network
packets through the main loop though.

Latency is the other main reason to do networking in another thread.
If your game is going at 20fps-60fps or whatever, then it means you
are adding 1/20th-1/60th of a second latency to all networking every
frame.

All you are talking about is the latency it takes to get the packets
in some other buffer to be read. What's the point in decreasing that
latency if you are only going to be reading the other buffer once a
frame? the true packet latency is still the frame rate either way.