Sketchy network library...
Last update on .
Couldn't sleep this evening, so I sat down and hacked up a loose sketch of a networking library for Pygame. The loose sketch is based on the description Phil gave at the OLPC jam at PyCon, but it's nowhere near finished yet. Basically it's got the ordering and reliability stuff built, but hasn't touched the network level or the application level logic yet. Target is a lightweight API usable in games that need reasonably fast network operations.
I'm planning to keep the total size of the download to a couple of KB. Eventually I'd like to have a lobby-server protocol and the choice of either sync or async operation. A candidate message pack/unpack for the payloads might be useful too. Anyway, for the curious, the source can be checked out at:
bzr branch http://www.vrplumber.com/bzr/qnet
comments, code and suggestions welcome... I don't consider this great code just now, just code hacked together by a tired old brain.
Comments are closed.
Pingbacks are closed.
Rene Dudfield on 07/26/2008 4:34 a.m. #
we're going to start working on networking in pygame the next release (1.9, starting in like two days). If you're interested in helping out with getting something into pygame itself that'd be super cool -- if so please start up a networking discussion on the pygame mailing list.
Seeing network events in the pygame event queue would simplify things for people. So networking then becomes like any other event.
OSC is an important consideration too. It's a pretty good UDP based protocol for real time use. It's widely used in the music world as a networked replacement for midi, and a little bit in the game world.
It does things quite well for real time use. Things like bundling messages together. So if you send a bunch of messages they can be played back in time. This is obviously very useful for music, but also for games... where timing is important for many games.
There are a few different code bases for pygame networking which have sprung up... the coderanger code designed with tubes and the OLPC in mind(that uses a similar api to yours)
There's a few more pages about with networking with pygame. There's also been a bunch of people who have made networked pygames too.
... so anyway, if you're interested in getting something into pygame it'd be cool to start a discussion on the mailing list. If not, at least there's some other code for you to look at :)
Rene Dudfield on 07/26/2008 5:10 a.m. #
oh, another note... here's the q3 networking doc that phil based his algorithms off.