March 21, 2009

PodSixNet is a lightweight network layer I've written to make it easy to write multiplayer games in Python. It uses Python's built in asyncore library and the simplejson 3rd party library to asynchronously serialise network events and arbitrary data structures, and deliver them to your high level classes through simple callback methods.

Click here to download it

I wrote this library because I'm forever thinking up multiplayer game designs and then starting, but never finishing, a new multiplayer game library for every multiplayer game idea. In other words, I get bogged down writing low level code and eventually lose interest in my original idea as it proves tricky to implement. I decided to get the multiplayer game library written once and for all so that whenever I get an idea for a multiplayer game, I can now prototype it up rapidly. I'm quite proud of the fact that this library is only a handful of simple classes, and weighs in at just two hundred odd lines of code. This is of course because I built it on top of Python's already cool asynchat (used by Twisted) and simplejson.

Two example apps are included with the source to help you get started. The first one is a simple console based chat program, and the second is a pygame based collaborative whiteboard. For each example start one copy of the respective server, ChatServer.py or WhiteboardServer.py, and then start multiple copies of the client to test.

Would really love to hear about it if you use this in a game!

Need software development advice? Book a call with me.