Escape Artist postmortem pt 1 (of 3?): Is python/pygame feasible?

This post is about if python and pygame is feasible for LD48. But first… an action screenshot!!

So. How good is Python/Pygame for making games?

Good parts:

  • Python is a lovely language, an absolute joy to program in compared to just about anything else. It is definitely superior to any brand of ActionScript. I never got bogged down in syntax or trivialities, and bug fixing/iterating flew by.
  • Programming in Vim, favorite native text editor by far*, was orders of magnitude better than being relegated to some IDE, or worse, Flash’s cobbled-together editing environment.
  • I was worried that a lot of the things that I loved about the rapid development cycle in Flash would be lost in python/pygame, but I turned out to be almost completely wrong. For instance, I liked that in Flash you could just draw something and instantly have it in game, but as soon as I wrote a nice abstraction layer I had that in Pygame too. In flash I really like how you get animated sprites for free with keyframes, but that was about 5 lines in Pygame. There was some oddness about text not being multiline by default, but I managed to fix that quickly by taking some open source code. Which leads me to my next point:
  • Pygame has a fairly respectable community. Every time I have encountered a bug (so far), I have managed to fix it just with a simple Google search.

Bad parts:

  • One big missing thing from pygame is the wealth of neat filers and effects in Flash. I really wanted to do some nice TV static or something over my game, and make some stuff glow, but I was simply incapable, and I felt like in general my graphics were a bit worse than they could have been in Flash.
  • Another really nice thing in Flash: Tweens. And then even better is the open source Tweener library for AS3 which does a lot of really slick transitions and effects. I hand coded these in Escape Artist, and Flash could have saved me some time.
  • Now for the absolute worst part about python/pygame: porting. Turns out not too many people are excited about taking your raw source code and compiling it. py2exe and py2app are the standard for Windows and Mac porting, respectively, but it was still really hard to get them set up, and in fact I’m hearing reports of really obscure crashes in the Mac port – something that I’ve never encountered in my Ubuntu testing.
  • It actually took about 24 hours to port, which was really sad for me since it (understandably) got no votes during that period :(
So, is Python/pygame viable for Ludum Dare? Sure – if you plan out how to port beforehand. Now that you’ve read my postmortem (the first part, anyway), you should go play my game! Tell me what you think. * If you have never heard of Vim or Emacs, you absolutely must try them out. They have a steep learning curve, but you’ll soon be flying through code like you’ve never done before.

Tags: postmortem

Comments

23. Aug 2011 · 21:19 UTC
Cool, I also used pygame for my game! I think your comments are mostly right on. I don’t know Flash, though, so it’s harder for me to compare. You’re right that porting is the biggest pain, especially since I usually run Ubuntu, and I find Windows so hard to use by comparison.