|October 6th, 2011|
Want to buy Caster for webOS? Click Here
Much like Amit Singh and his Hanoimania, I regularly attempt to port my friend’s game Caster to as many platforms as I can. Because of some good language and API choices upfront (C++, OpenGL 1.X, SDL, etc…) the Caster codebase is very portable. That portability combined with its relatively humble (for these days) performance needs has lent the (currently still unified) codebase to easy porting. This multi-platform journey began many years ago before Caster was even released. Caster was still in early development when Mike approached me with the idea of maintaining a concurrent Mac build. At that time Macs had not yet moved over to x86 processors and so the most difficult part of the process was reverse engineering Valve’s Half-Life model format (which Caster uses for animated character models). The Half-Life model format was a binary, in-memory format utilizing offsets which meant that while loading it was quick and simple (just read it into memory, no processing whatsoever) it was unfortunately dependent on little-endian byte order to work. Other than that and a couple of other issues, the Mac port was really straightforward. So before release, Caster was solidly supported on both the Windows and Mac platforms. After release another guy helped out with the Linux port of Caster and so at that point we now had the major desktop operating systems covered. Over the years we added slightly different versions for the desktop platforms to adapt them to specific distribution avenues like Steam and the Mac App Store. The first port that required major reworking was iOS. That adventure was chronicled in my post Caster for iPhone: A Postmortem. Mike and I had the opportunity to give a presentation about what we learned at GDC Austin ’09. Later on as the Android and webOS mobile platforms took shape, I started to look into porting Caster to those platforms as well.
Adventures in webOS
About a year ago I was able to get a hold of a Palm Pre from a friend and so I started poking around the webOS PDK (Plug-In Development Kit). Unlike iOS, the primary development environment for webOS is (duh) web-based and not suitable for high performance games. However, through the webOS PDK you can write C-based programs that utilize OpenGL and other libraries much more suitable to game development. I was able to leverage a lot of the work from the iOS and Linux ports and within a day or two I was able to get a working version of Caster up and running using the PDK. Hardware-wise the Pre is somewhat similar to the iPhone 3GS in that it has an A8 CPU and PowerVR SGX530 (as opposed to the SGX535 in the 3GS). This fact made it easy to just reuse all of the carefully optimized assets we had worked on for the iOS port. There were some things like the PDK touch APIs that needed a bit of reworking but it was pretty straightforward. I considered the port to be 98% complete but there were 4 show stoppers and general performance issues that prevented me from releasing it to the webOS App Catalog at that time. I had suspicions that my issues might be resolved in a future version of the OS and so at that point I decided to wait for the next webOS update and then re-visit the port. Unfortunately I was already running the final version of webOS released for the Pre (1.4.5) and so I put the unfinished port on the shelf and went on to other things.
Throw Hardware At The Problem
Fast forward to a week ago. I was able to procure some newer hardware (a Pre2 and a TouchPad) that would allow me to test the Caster codebase on webOS 2.X and 3.X. I had hopes that the newer versions of webOS would resolve some of my show stoppers. Fortunately they did and I was finally able to finish up the port that I had started a year ago. Caster now runs really smoothly on the Pre2 thanks to the updated OS and a CPU clocked significantly higher than the original Pre. Caster also will run on the HP TouchPad in a manner similar to how it runs on the iPad. Performance on the TouchPad is somewhere in-between the iPad 1 and the iPad 2. Getting the year old port to work on the Pre2 was a piece of cake seeing as the hardware was very similar to the original Pre. The TouchPad had some interesting differences (outlined by Palm here) which actually made it more like developing for a desktop platform than a mobile one.
One More Down, Many More To Go
Another platform under the belt. About a day or so after submitting Caster to the HP App Catalog it was approved and went live. It was definitely a fun exercise to develop for webOS. One thing I loved about PDK development was that you have gdb directly on the device. That and the ability to ssh as root on stock hardware + OS made debugging a lot of things a snap. Over a year ago I also started a port of Caster to Android using the Android NDK but for various reasons it has not yet been released. One of these days it will get completed. Maybe not before the Dreamcast port though 😉
(a year and a half ago I did actually get a Dreamcast build of Caster to compile, link, launch, execute and display a simple quad onscreen)