Question

I am making a simple multiplayer economic game in pygame. It consists of turns of a certain length, at the end of which, data is sent to the central server. A few quick calculations are done on the data and the results are sent back to the players. My question is how I should implement the network support. I was looking at Twisted and at Pyro and any suggestions or advice would be appreciated.

Was it helpful?

Solution

Twisted would certainly be a good idea. Here is example code that integrates twisted and pygame.

OTHER TIPS

I've nothing against Twisted and PyRo, but the sort of simple messages you're going to be sending don't require anything like that and might be overcomplicated by using some sort of framework. Pickling an object and sending it over a socket is actually a very easy operation and well worth trying, even if you do eventually go with a more heavyweight framework. Don't fear the network!

There are a number of plug-and-play libraries tailored specifically to work nicely with PyGame on the pygame.org website.

These include PodSixNet, PygLibs.net, and my own Mastermind (which is, at the risk of self-aggrandizement, lightweight, easy to use, and comes with a simple tutorial).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top