Hello pygnet! pygnet sits on Twisted, and make it easy to trade marshal-able Python objects between clients and a server, using TCP.
It also (seems to) integrate well with the de-facto standard pygame event loop, as long as you call the poll function regularly.
So... what is next in my quest to complete a multiplayer-persistent-world-online-game? I think I need to define the game rules, and a backend strategy for implementing them. Also need some way to persist data to disk. ZODB perhaps?
Friday, June 08, 2007
Subscribe to:
Post Comments (Atom)
Popular Posts
-
These are the robots I've been working on for the last 12 months. They each weigh about 11 tonnes and have a 17 meter reach. The control...
-
This hard-to-see screenshot is a Generic Node Graph Editing framework I'm building. I'm hoping it can be used for any kind of node...
-
Unfortunately I've not secured a venue for the GGJ. With 9 days left, things are not looking hopeful. It could be that GGJ Perth will no...
-
So, you've created a car prefab using WheelCollider components, and now you can apply a motorTorque to make the whole thing move along. ...
-
MiddleMan: A Pub/Sub and Request/Response server in Go. This is my first Go project. It is a rewrite of an existing Python server, based o...
-
Often, when building a game, you need to test if objects are colliding. The objects could be spaceships, rocks, mouse pointers, laser beams....
-
I've just read a newspaper article (courtesy of Kranzky ) from WA Business News documenting the malfeasance, gross negligence and misc...
-
After my last post, I decided to benchmark the scaling properties of Stackless, Kamaelia, Fibra using the same hackysack algorithm. Left axi...
-
Update: This is another planet shader, with more physical fidelity. Shader "Planet" { Properties { _MainTex ("Diff...
-
Possibly slightly more correct lighting. The rim light is now only applied in the direction of the sun, rather than being purely based on vi...
7 comments:
pygnet eh? So, will it work with pyglet? :)
I would suggest you talk to Will McGugan about his gameobjects library, as he might be thinking about the same issues as you.
I'd avoid ZODB since most games end up with mostly relational data in them, as opposed to object data. In that line I'd look at SQLAlchemy as a good layer to build on, as that then gives people freedom to choose an appropriate (or use their favourite) database backend. For peer-to-peer hosted casual games, sqlite should be more than adequate and is definitely easy to ship :)
pygnet uses marshal to deserialize data from the network. nuff said (insert security nightmare here)
The serialization scheme will be independent of pygnet, so you can choose something suitable for your application.
There are plenty of safe serialization schemes out there. I've even written one, as a safe alternative to marshal.
http://fibranet.googlecode.com/svn/trunk/gherkin.py
I'm playing cheesecake with extensions now.
1) no license meta data, no readme, no install, etc.
2) no mention about the security implications of pygnet in the default (marshal) setting
3) using marshal as a default, which is probably what nobody *really* wants to do.
4) using the encoding as a module global is bad design. It means that even though you got a protocol abstraction, all protocol instances share a common state.
Solved properly you should configure GameProtocol objects with the encoding they should use (and whatever other parameters they need). You might want read "Design patterns" by Gemma et all.
Mostly valid points, except 4). All protocol instances are required to share some state, I had to make part of that shared state configurable due to security concerns. If it was anything more than that, I would agree with you. Fortunately, Python's late binding came to the rescue. I've seen this done in a few Python projects... hey is this a new pattern? :-)
To do it as you suggest, I would need to subclass the protocol class, customise its behavior, and pass it through to the init functions... but that is starting to go beyond what pygnet is intended to do. If I do that, there is no advantage to using pygnet, Twisted becomes the better option.
BTW: If you would like to help out, please join the project! http://code.google.com/p/pygnet/
Just, using multiple protocols is then impossible, ooops...
Though there is neither a need to subclass, nor give up defaults, python to the rescue.
Nice solution...
...but it's doing more than I want pygnet to do. I'd like to keep any specific to twisted out of the API, and keep it simple enough to be understood in about 60 seconds.
The best thing is really to replace marshal with something else, as you originally implied.
Post a Comment