Friday, June 15, 2007

Safer Serialization

The need for a secure / safe serialization module for the built-in Python types has reared its head again.

After looking around at the alternatives, I decided I should simply update my 2005-era gherkin module, and make it an easy installable package. When the cheeseshop comes back online I'll do the upload.

I've added support for sets, and complex numbers. I even tried to make it faster, but ended up in defeat. I had forgotten how much time I had already spent optimizing the thing... My 2007 brain could not best my 2005 brain... hmmm must be getting old.

In other news, the new Super Ajax-ified Media Widget (Scouta Play) went live earlier this week on the front page of It doesn't use gherkin, it uses json. :-) Band of None have also released a new tune, Hoffburger.

Saturday, June 09, 2007

Building Corsair Redux

I've got a few things I want Corsair Redux to feature.
  • User Generated Content - Players to be able to upload models and textures for use in game.
  • Exploration - Exploration and discovery should be key gameplay elements.

While thinking about game rules, I realised I need to answer a few unasked questions...

Is a conquer-the-universe gameplay objective going to be able to create a long lived game? Should it have RPG elements? Should it focus more on trading, economics, or something else?

Maybe a sim-solar-system, with players creating trade routes, discovering and colonising new planets... hmm.

The first Corsair project taught me that it really helps to get gameplay rules correct, before coding starts. :-)

Friday, June 08, 2007

Minimal Pygame Networking Achieved

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?

Sunday, June 03, 2007

Ubuntu + iMac = Greased Lightning

I haven't booted my iMac into Ubuntu Linux for a while, due to my newly discovered dependence on iTunes. However, I had to fetch some spreadsheets out of the Ubuntu system, which required me of course to reboot the iMac... select Ubuntu... yada yada.

Woah! I didn't know this machine could run so quickly! Hey, I've even got more eye candy in here! I had forgotten just how quickly Linux can run on an iMac. OSX feels like wading through treacle compared to this... Hmmm, why aren't I using Ubuntu full-time?

Ah. That's right. iTunes. And I still haven't got audio in Ubuntu to work correctly. (It needs max volume to barely hear any sound.)

I might upgrade to Ubuntu/Feisty and see if it resolves the issue.

Update: The upgrade is complete, but I'm still only getting very low volume audio. Looks like it's a known problem though.

Saturday, June 02, 2007

Something looks like a Pylons caching problem...

...but isn't.

For a while now, in my in-development Pylons web app, I've been experiencing what I thought were cache problems. Every X clicks of the refresh button (usually 5 or 10) the page would revert to an older version. I thought this might be some middleware playing tricks on me... but it wasn't. Well not quite.

I use some custom SQLAlchemy magic in my model to dynamically switch between SQLite databases based on the URL, yet still keep the 'core' database available in the same model namespace. The code to setup the correct SQLAlchemy sessions sits in the __before__ method of lib.base.BaseController. As it turns out, I also need to call session.clear() on my SA session object between requests, as it seems some junk is left around, waiting to trick the unwary programmer.

This problem was solved with the help of Band of None and their new tune, Your Myspace Page.

Popular Posts