Archive for December 19, 2011

C&C Vector-Based Menus

Andrew says that I should blog about the conversion as it progresses. In truth, I’m not in conversion mode just yet. I’m focusing on the differences between the current and new platforms. Ultimately, Andrew and I will work together to merge any new features that I put in the Droid version into the iOS version.

One example is in-app purchases. When Andrew originally wrote Creatures and Castles, there was only one set of levels. Shortly after his port to Chrome, he added a new level pack, which the player can purchase from within the game. The iOS version has no screen to select the level pack, since there’s only one. The Chrome version has a single screen with only two options (the currently-available level packs: Medieval and Egyptian).

The Android version of C&C has the benefit of hindsight. I know that new level packs will be made available via in-app purchases. While there will only be two level packs when C&C hits the Android Market, I’m redesigning the menu system to support many more options.

Similarly, there are only two characters that the player can select when they start the game. Both the iOS and Chrome versions present the player with a single screen with those two options. My plan for the Android version is to have the original artist create a few more variations on the characters. As with the level packs, the character select screen will support many more options.

So, I’ve been spending a good chunk of my time programming a new, generic model for player options, but there’s another hurdle to leap in the Android port — the unpredictable variety in devices. I’ve started down the path of creating vector-based assets for the menu system and fonts.

Menu assets will ultimately be pixel based (after all, OpenGL textures are pixel-based), but those assets will be generated for the host device from vector sources at runtime. That means that tablets and phones, big and small, should have images that appear to be tailor-made for whatever device you happen to be playing the game on.

I took a break from the programming this evening to create some vector-based assets in Adobe Illustrator. Here’s a PNG of the SVG that I made. Andrew is a little miffed that I drew stars (“they’re supposed to be shields, %#$@!”), but I’m generally satisfied with the result — especially considering that this is really just a test to validate my vector-based plans.

C&C Vector Sprites

Test of Vector-Based Sprites for C&C

Remember, these images are based on vectors. While this looks like a traditional sprite sheet, and it will ultimately be used as a sprite sheet, the pixels aren’t set in stone until the game starts up. Every device gets its own version.

I hope it works as well in code as it does in my head. :)

The Cat’s Out of the Bag …

Well, Andrew tweeted about our new project, so I guess it’s not a secret any longer. I’m porting his “Creatures and Castles” game to Android. He’s already released the game for iOS in the Apple App Store and for Google’s Chrome web browser in the Chrome Store. I hope to have the game in the Android Marketplace early next year.

So far, everything has gone according to plan. When developing for iOS and Chrome, Andrew was able to easily manage platform variances. For example, all iPhone / iPod Touch devices fall into one of two general categories – Retina, and non-Retina. When it comes to Android, it’s not quite that simple. A lot of wiggle room is afforded the hardware manufacturers.

I think of iOS development as a close cousin of developing for game consoles, where hardware consistency is your best friend. Android, on the other hand, is akin to developing for PCs. You’ll never be able to test every hardware variant, so you try to write code that adapts.

As time (and master Rollings) permits, I’ll try to blog about the technical details of the project as it progresses, and (more interesting to me) how my assumptions about the Android platform are validated or contradicted.

This week was spent with the family in GA, but I was able to get a lot of the menu code written, and do limited testing on a few hardware devices. Tonight, I added support for SVG images using a 3rd-party lib. Using vector art for the menus and options should make life a lot easier. We’ll see.