This is a programming post. Those not interested in programming can quit now.
I’m evaluating switching my default development platform. So far, I’ve been doing all of my games in Java as applets because I was familiar with the language and they run in a web browser. But there are some downsides to it: it’s pretty unstable when managing sounds, some browser/network configurations prevent applets from running, and up-to-date runtimes don’t have the penetration that Flash has thanks to YouTube and friends. Also, I want to change because I feel like it.
Python
So first I grabbed Python. I once coded something simple on it and I loved its syntax and philosophy. Armed with Pygame and the latest runtime, I set to port my current in-development game, Pixelworld as a test. The game is mildly demanding as it is essentially a particle simulator, but it’s just a 128×128 field, so I figured it should not be a problem.
Wrong. Despite an honest effort to optimize as far as I could by tweaking and trying whatever trick I could find on google, a loop that runs 655360 times a second with some logic is too much for Python. The final veredict was that calling user-defined methods in Python is excruciatingly slow and there’s no workaround for it. If I am to inline the bulk of my particle logic without helpers, I might as well not code in Python at all. If you are a Python wizard and want to have a shot, here’s my final source code. If someone manages to make it run above 30 fps without making the code unreadable, I’ll apologise for this:
Conclusion: Any platform is good for games if you just draw a bunch of hardware-accelerated sprites. I just needed a bit more on the soft side, and as much as I liked the language, it does not provide the penetration of Flash or the raw performance expected from a standalone game.
On to…
ActionScript 3.0
Then I started with AS3 on Flex builder. Again, Pixelworld is about writing pixels on a surface, so I knew from the start that I was going to be pushing Flash beyond it’s area of expertise. However, Flash really stood up for the pixel mangling after implementing several obscure hacks I found here and there coupled with some code optimization in general. The language is ugly, but the runtime offers many possibilities (i.e. Kongregate). However, I had to optimize beyond what it’s healthy for this game. You can check out the Flash prototype.
Conclusion: I’m not going to do Pixelworld in Flash 9. But I’m probably going to switch over to it soon just because of the runtime. Maybe Flash 10 makes a difference to me. Maybe Silverlight will be out of beta… for now… I stop promiscuity and go back to safe sex.