Monday, May 4, 2009

How to become an iPhone developer in 8 easy steps

1. Buy a Mac
You'll need one with an Intel-based processor, running the Leopard version of MacOS X. It doesn't have to be a top of the range model, though. Ethan Nicholas wrote iShoot on a banged-up old MacBook with 1GB of memory, knackered Wi-Fi and an Ethernet port that needed to be wiggled around to get it to work. The machine did however, afford him the maneuverability he needed: "most of my available development time involved holding a baby on the couch so my laptop was better suited to the task."

Peter Scott, CTO at Connect2Media suggests Mac Minis, "they are more than powerful enough, small, easy on desk space when you already have PCs, three LCD monitors and a bunch of devices. They are also easy to move round, developers can take them home at the weekend if they want to continue to work."

2. Down the SDK (software development kit)

"Apple provides the free SDK for iPhone development from their Developer site," explains Stuart Varrall, Creative Director at Fluid Pixel. "This includes everything you need to get going, including the development environment Xcode, the iPhone Simulator for testing, performance analyzers, interface builders and the full documentation reference library."

3. Learn Objective C

This is the primary programming language for iPhone development. "It's an extension of C to include object-orientated principles," says Varrall. "It has scripting elements to it, so is easier to pick up than some languages and anyone with programming experience should be able to transfer their skills."

"Here's a short history of Objective C," offers Scott, "It was born out of Smalltalk which was a very early Object Oriented Programming language developed in Xerox PARC (where Window/Mouse computing really begun) and as a consequence was heavily adopted by Apple since as early as the Lisa. Smalltalk is very similar to C."

"Objective C was actually created by Next Computing owned by a certain Steven Jobs. When Jobs returned to Apple, he sold Next to the company and so Objective C became the main development environment for the Apple Mac. It is liked because in similar ways to Java, it deals with many of the problematic parts of programming…. It's nice, simple, hides the complexities of the hardware away from the developer and deals with (on the whole) the major cause of programming issues in C and C++ which is memory leaks."

All well and good, but what's the best way to actually pick up the language? "This really depends on where you are starting from," explains Scott. "If you are proficient in C/C++ or Objective C then the learning curve is in getting to grips with the APIs of the iPhone - the best place to start is the iPhone developer site. If you need to learn the programming languages themselves then the best place to start is a beginners book, actually the For Dummies series is very good for this. Also look at one of the many free tutorials online - Googleing 'objective C tutorial' throws up many places to get these."

"The official Apple SDK has a wealth of detail along with examples of implementing various features," adds Varrall. "The Apple developer forum is rapidly growing to be the best place for specific questions or to get further clarification on something". He also mentions that iPhone supports Open GL ES which allows heavy optimization when working in 3D. So if you're thinking beyond a scrolling shooter or Tetirs clone, you'll need to look into that as well. Also, many professional studios write their games in C++ rather than Objective C, especially if they're planning to port the code onto other platforms such as N-Gage of Xbox Live Arcade.

4. Start writing something!

Forget theory; forget mastering Objective C with your first attempt. Just set yourself a project and start working. "I knew nothing about Objective C, Cocoa, or OpenGL prior to starting iShoot. In fact I barely even knew C," admits Ethan Nicholas. "I hadn't really touched it in a decade. I was a Java programmer for twelve years and it was quite an adjustment moving from a nice safe language like Java to one where a single misplaced byte can instantly crash your program."

Nicholas' first aim – and this is more or less standard procedure in the development community when presented with a new platform – was to get something to appear on the screen. "The first thing I worked on was the ground. I wanted to create a destructible landscape with falling dirt. Since I had no idea how to load textures at that point, and had just grasped the basics of Objective C and OpenGL, my dirt "texture" was just solid white. So the first thing I got onscreen was just a white rectangle that represented the ground. My wife was fortunately tolerant enough to understand my excitement at getting anything, even just a simple white rectangle, on the screen.

"By day two, my featureless white rectangle had morphed into a properly textured landscape and most of the dirt-destruction code was working. By the end of the first week I had a tank on the screen firing shots randomly, blowing holes in the ground. When I finally got it on to an actual phone and not just the simulator, I found that it only ran at one frame per second, so I had some considerable optimization work ahead of me."

If you can't face starting out on an original project, however, Varrall suggests a couple of modification tasks. "The SDK actually comes with a whole host of sample projects that cover most aspects of development. So the best place to start would be to take one of those and reverse engineer it and work out how it has been constructed. You can then build on these by adding new features and create your very own game very quickly."

5. Sign-up as an official developer
If you plan on releasing your masterpiece at any point, you'll need to sign up with the iPhone Developer Program. The Standard cost is $99, and it involves agreeing to Apple's terms and conditions, and signing and returning the contract. Even if you're nowhere near completing the project, you'll need to sign up in order to test your code on an actual iPhone rather than an onscreen emulator. Once you're on the Developer Program you're sent a certificate, which allows you to pair up with an iPhone device.

6. Prepare for a few weeks of work…
Depending on the time available, and your level of programming knowledge, developing an iPhone game can mean as little as a couple of months' work. "Including learning Objective C, Cocoa, and OpenGL, I spent exactly six weeks on iShoot," says Nicholas. "The hardest part was adjusting to an unsafe language... after twelve years working in Java, it's very difficult to get back into the proper mindset for debugging crashes. I had one memory corruption issue where it turned out that literally only a single byte was being corrupted, and it didn't cause the program to crash until several minutes after the corruption occurred. It took me three days to find that one…"

The professional studios I spoke to provided similar time frames, though they involved teams rather than lone coders. "KamiCrazy took three months to develop part-time, so could be done in a month full-time," reckons Varrall, who used three programmers, one artist and a producer. "The programming was focused on the most part into making the robust engine that drives the game and included the level editor, allowing the levels to implemented with ease. This means that this technology can be re-used and future titles could be turned around in less time. The art took three weeks in total to produce."

7. Submit your app to Apple
Okay, this is the big one. "Finished games have to be submitted to the App Store using the same interface as music producers use," explains Varrall. "It's a straightforward process of zipping up the file, uploading it with a description, a large and small icon, and screenshots. If everything is alright then it usually takes Apple a week to approve the content and it finds itself in the store. If there is a problem, such as obvious bugs or Lite apps that are mentioned as demos or aren't fully featured, then this can take longer to review and ultimately reject. In this instance you can fix the issue and resubmit as many times as you like."

"Any iPhone developer will tell you that the provisioning and code signing is a pain, but once I had that sorted out the submission process was trivial," agrees Nicholas. "Fill in the fields, wait a few days, eagerly anticipate your first sales report... and then watch everybody completely ignore your app as you sell fewer than 20 copies a day. iShoot wasn't exactly a resounding success in the beginning…"

8. Adapt, market and survive!
The work doesn't finish once you've made it onto App Store. As it's unlikely you'll have your own in-house QA department, some bugs and design issues may only surface when hundreds of gamers get their hands on the code. Consequently, it may be necessary to submit several alterations.

And as Nicholas mentioned, don't expect an immediate response to the release – App Store is an open market, featuring around 20,000 applications and 2,000 games. To get noticed, you'll need to build a buzz around the game: engage with the development and gaming communities, start a blog about the programming process, produce screenshots and mail out press releases to iPhone news sites like Pocket Gamer, Touch Arcade and FingerGaming. And, of course, utilise social networking sites like Twitter, Facebook and Bebo.


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...