The ones you left behind are stuck in a line

March 8th, 2005, By Duncan Gough

// OpenGL vs. SDL

When I started to develop my first downloadable game, when my son was just weeks away from being born, I had one question left to answer.

For Playaholics, downloadable games were an option we needed to explore. A number of sites around that time had started to offer them and, from where we were sitting, looked to be doing well from it. To my mind, we needed a game to test and the cheapest option was for me to create one. If it failed, we’d lose only a fraction of my time and nothing more.

What type of game though? That was easy – there aren’t enough word games to go around and my wife plays them all. She knew exactly what sort of game she wanted to play and within 24 hours she gave me around 80% of the game in a couple of sketches.

What language should I write it in? No question, Python and more specifically, Pygame. If writing a downloadable game for Playaholics was an experiment in seeing how well they’d perform, writing it in Pygame was an test for me, to see how difficult it would be. I’d written a couple of applications in Java and not enjoyed it, I’ve written a couple of things in wxPython and had more success so I was a little bit nervous that Pygame was going to offer the same experience. However, I knew that I could bundle the end product into an .exe file using py2exe and, furthermore, into an installer using any number of freeware or shareware setup.exe creators. Provided I could write the game, the rest was there for the taking.

Which leads me to the last question, one that I saw mentioned in relation to Pygame an awful lot. One that I began to ask myself over and over again. One that, looking back, bears no relation to what I was attempting.

Is Pygame fast enough?

It’s a meme. Look into Pygame in any depth and this sort of irrelevant need for speed pops up. I was writing a word game and for some reason I was worried about frame-rates. It doesn’t help that the example games on the Pygame website don’t show off what can be done but the few that I played eventually convinced me that it would work. Since finishing the game I’ve gone on to use wxPython again and those ‘is it fast enough’ questions just don’t seem to crop up. More importantly, the wxPython demo suite is a hugely impressive collection of every kind of windows application that effectively provides the basis of any tools you’d be planning to create. I know that, I’ve done it :)

So, I went ahead and wrote a downloadable game in Pygame, bundled it up using py2exe and created an installer using Inno Setup. Easy.

My son was born a week late. He gave me time to finish off a release candidate and then things went haywire. When I came back to the game our perception of downloadable games has shifted. The same sites that featured them had all suffered from the same dilution. They offered downloadable games in an attempt to ‘monetize’ their traffic and it showed. Most of them featured the same games and most of those games bore no relation to the other games on the website. We dropped our interest in downloadable games that didn’t fit with Playaholics and I learnt Flash, ported the Pygame code across to Actionscript and shrunk the Pygame executable down to just a few hundred k.

So, why tell the story now? Popcap and yet another insightful Slashdot comment. PopCap have open sourced their games framework and I’ve been playing with it. Reading through the comments on Slashdot reminded me of the whole ‘is it fast enough’ faux dilemma that I’d experience just under a year ago and I laughed when I got to this comment:

http://developers.slashdot.org/comments.pl?sid=141665&cid=11873842

So true – Pygame uses SDL over OpenGL and if you’re developing downloadable games for OpenGL you’re asking a lot from the end users’ computer. Pygame uses SDL and while it may not be ‘fast enough’ it’s going to run on a whole lot of computers much more reliably than an OpenGL game. Just ask Wik

I feel the same way about SDL as I did about scripting languages when dynamic websites were first popping up around the web. A language like Python and SDL can do for application programming what PHP did for C and web-apps in building a easy to use middleware layer that opens it up to a much wider pool of developers.

ps – On the subject of games websites open sourcing sections of their code, I’d just like to point out that 3RD sense open sourced their ’single sign-on’ code about 8 or 9 months ago ;)

pps – So yes, I’ve not mentioned the name of the game or where you can play it. All in good time. The Flash version will come first and then the downloadable version with the Pygame source attached. All in good time…

– http://www.lyricsdir.com/j/jayhawks/nothing-left-to-borrow.php

One comment

« He bangs a drumI broke the record but I broke my back going over the waterfall »