Tuesday, April 28, 2009

Math on the iPhone

When writing a game for a device like an iPhone you'll notice how much math is required. There is quite a lot to be evaluated, from physics to collision detection, lighting and animation.

Here is a little tidbit from the iPhone development guide that you may have missed. It's a bit counter intuitive to those of us trained to optimize code for older platforms.

Make sure you use floating point rather than fixed point arithmetic for iPhone games. The iPhone CPU implements a floating point instruction set natively. The ARM processor in iPhones and iPod Touches includes a Vector Floating Point (VFP) unit. Fixed point arithmetic [uses software libraries instead and] leaves the VPF unit unused.

On older platforms it was always faster to use fixed point arithmetic. We contorted our code to account for this and squeeze that last drop of performance from our code. Now, writing code for the iPhone requires a bit of a mindset change. Not to mention, if you're porting code from an older system you should convert the mathematic algorithms from fixed point to floating point.

And finally, in the performance world size really doesn't matter. It's all about the speed. Don't forget to switch from thumb mode to ARM mode, as discussed in this earlier post.

Sunday, April 12, 2009

iPhone iTunes Search Engine Optimization

There are 25,000 applications in the iTunes iPhone App Store and nearly 1 billion App Store downloads to date. It has taken 1/3rd the time to hit one billion downloads in the iTunes App Store than the same number of music downloads.

I have only two questions for you.
1. Where the hell is your application? Still on the fence? Good luck with that.... your competition is wrapping up their release and scooping up your market as you read this!
2. With all this competition, how do you get noticed?

Engineering perspective aside -- you can't argue with the numbers. Search Engine Optimization (SEO) is here to stay. Take a look at the sales jumps in Abby Crabby. 350% according to AppSales and about 150 ranking points according to MobClix. Sure the SEO text looks like something a robot spewed into the iTunes listing but it works. The biggest benefit was finally getting back into page two of the Games.Kids category on the iPhone App Store. We'd fallen out since that Y2K9 snafu.

What's SEO look like... we'll the numbers are pretty, but the text not so much! "Been scuba diving? This is not a village of fishing ice cream scoops blocked with emoji. The virtual creeps stuck with bejeweled bugs, penguins, pets, or god forbid a pocket of crazy puppy bunny to peekaboo. Zombies do not doodle in flight with a wolf vampire on the trails in Oregon."

What does it mean? Well, look at it closely. It's basically a spot on hit for most of the top games and applications. Try a search in iTunes, you'll see what I'm talking about.

A while back people started including a list of the top applications in their descriptions. "People will like this application that enjoyed: xxx, yyy, zzz... " This worked for a while. However, at some point a few weeks back Apple clued in. This no longer works. Based on some experimenting with my SEO block above I'd say there is a scoring system. If you score too high, you're out. And when I say out... I mean out. If you include too many high scoring words, you won't appear searches for anything in your description -- anything. You'll only appear for searches matching your title.

Give it a try, just don't go crazy.