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

Re: [pygame] SOC Proposal: Networking for Pygame



On 5/7/06, Rene Dudfield <renesd@xxxxxxxxx> wrote:
 Using the pygame event queue means that all event management is done
through the same api.  So people who already understand pygame events
can use networking too.

That's a Red Herring, and it doesn't apply to the issue I'm talking
about. You don't need to use the same event queue in order to get the
benefit of people's knowledge and understanding. If you have the
network have it's own seperate queue that acts similarly to the pygame
one, but can be read and processed in a seperate loop, then it's still
true that "people who already understand pygame events can use
networking too"

The issue I'm talking about is whether pygame.event.poll and
pygame.event.get would be the only functions that can get network
packets and/or lobby/matchmaking events...I still don't see any reason
why a single line of game code to process packets should be sitting in
my main event loop.

...I'm just working through what code I would write in my
pygame.event.get loop if net messages came through there, and it would
just be something that buffers the net messages so the code that
actually uses it can read it, or forwards them on to registered
listeners... So why shouldn't the "simple to use networking" module
help me out by not making me write that extra boilerplate?

I can see that it would be easier to process the net stuff in that
main loop if you are writing a small example, or a pygame app that's
all in one file, but is there anybody here who would write anything
more than either message dispatch/buffering for net events in their
main event loop in a real network game?


SDL_net does use the event queue... well they wrote a different
implementation of it which they call fast events.

Are we talking about the same SDL_net? Do you mean this one:
http://www.libsdl.org/projects/SDL_net/

because that SDL_net sure looks like nothing more than a very thin
(simple?) wrapper over TCP and UDP to me

I don't see the word event used anywhere in it's docs
http://jcatki.no-ip.org/SDL_net/SDL_net.html
and I don't see events used in the SDL_net sample code either


See the fastevents module in pygame.

I don't know anything about fastevents, I can't find the "fastevents"
module in the pygame docs:
http://www.pygame.org/docs/ref/index.html

I'm curious about them though, got a link?


(PS. if there is a better home for discussion/suggestions/criticism of network proposal stuff than being mailed to this list, please let me know where it should go)