Saturday 24 January 2009

Graphics engine for iphone game dev

I spent a few days trying to decide which framework/library to use. Initially the options were Open GL ES vs Core Animation. I was going to implement my own sprite engine (or port an existing one). But I couldn't possibly summarise my feelings better than Will Larson did when he faced a similar situation:
That is, until we ran into OpenGL, which was something like coming upon a family of skunks blocking your trail while hiking. I mean, you could walk through them. But, damn it, do you have to?
Fortunately, there's Cocos2d for iphone to save us all from dealing with the skunks.

Monday 19 January 2009

Running an app for the first time

The iPhone Developer Programme User Guide is a comprehensive document that leads you step-by-step through a fairly complex process of creating all the security bits and pieces that protect Apple's right for the hundred bucks I mentioned before.
The document is so comprehensive and the process is so mundane that towards the end one tends to just follow the steps without any thoughts running in the skull.
So one comes across "Now press Build&Go button" sentence in the guide and gets all excited. S/he presses the button, grabs the phone and... wait a minute... What the heck?

Your mobile device has encountered an unexpected error (0xE800003A) during the install phase: Verifying application

The organiser suggests the usual programmers trick: disconnect, reboot, reconnect. One tries this a couple of times. But grave suspicion that one's f$%^ed grows with each reboot. Some people report loosing a day to this problem. The funny thing is the solution is in the guide, a couple of pages below this point in an entirely different chapter:

In the Properties Pane of the Target Info window, enter the Bundle Identifier portion of your App ID. If you have used an
explicit App ID you must enter the Bundle Identifier portion of the App ID in the Identifier field. For example enter
com.domainname.applicationname if your App ID is A1B2C3D4E5.com.domainname.applicationname. If you have used a
wildcard asterisk character in your App ID, replace the asterisk with whatever string you choose.

Thanks Apple! And really big thanks to Chamchamcham.

Getting the license

Seeing your stuff working inside the simulator window is fun but... Wouldn't it be nice to have it running on the phone after all? Sure. For a hundred bucks. And a bit of time. And a call to ADC support to prove that you are who you say you are.

10 years of Java makes one careless

One forgets what a pointer is. Well, not what it is, but what can be done with it. I, for one, just loaded a few kilobytes of audio data on top of some audio queue control structures... Kept me wondering for a while why the bloody queue spits some poisonous noises at me.

And all this memory management business... Apparently, someone has to think about whether an object is to be retained or released. C'mon, I've just assigned it to a private field, does that ring any bells? No? Well, then just retain it, would you?

Long time ago in a galaxy far away...

people used to make calls with their phones.

Not anymore. Enter the dark side of the iPhone development.