Setting Sail on the Objective-C

         My game dev tool of choice thus far has been Unity. I have been using Unity to develop an iPhone game called Hanj’s Box in addition to the web game, Hall of Archery. Recently however Apple announced the new TOS for iPhone developers which throws doubt upon whether applications made by Unity will be accepted in the App Store. The new terms are effective when iPhone OS version 4 is released and the speculation is that they will exclude all middleware tools from Apple’s mobile app eco-system, including Unity.
         “Well,” I said, “Why not learn Objective-C?”
         When I first posed that question I knew nothing about Objective-C. Perhaps I was arrogant in asserting that “if I can learn 3-D math for Unity, I can learn anything!” Nevertheless despite my arrogance I knew that I had much to learn. I searched through the docs. I read. I tinkered with the tutorials. And I have developed… a headache.
         Writing game behaviors in Unity is one thing. Learning object oriented programming and the Model-View-Controller paradigm is another. I have come to accept that I will not be writing a 3-D game as my first iPhone project. Hanj’s Box will sit on the shelf until – well perhaps until I am ready – whenever that is. This is probably for the best. I have grudgingly come to accept that when it comes to programming I probably only know enough to be dangerous, and in that only to myself. Hanj’s Box was a mess of spaghetti code threatening to strangle me.

So what to do?
         Learn Objective-C, and in the process become a better programmer.

How to do it?

  1. Choose a modest project
  2. Divide the project into pieces
  3. Attack each piece one at a time

Choosing A Modest Project
         When dealing with something unusual, the familiar is comforting. Interactive Fiction is familiar to me.[1] I have made them before. A text adventure game is also modest from an output stand point being primarily text.

Dividing the project into pieces
         I have begun this process, but not completed it. The simplistic version is three parts: model, control, and view. UIWebView will compose the View component drawing upon dynamically generated HTML or XHTML. The Controller will use the UIWebViewDelegate protocol to respond to the user, prompting the Model for information when text needs to be generated. The Model will also of course have all the game objects. I have not decided if I will use Core Data.

Attacking each piece one at a time
         The first item of attack is UIWebView. This looks like a good tutorial to begin with.

         And lastly it is probably a good idea to name your project so that it feels more real. This project will be called Lillie and Ransome based on a story idea I was working on in January.


[1] – Twelve years ago this spring, I wrote code for the first time since childhood, working on an Interactive Fiction game in BASIC on a college roommate’s Amiga. We played a lot of table top fantasy role playing games back then, and I decided to create a story for one of his favorite characters, a would-be wizard named Lavenreth who worked for his room and board with Simon the cobbler. I only had a rudimentary understanding of BASIC when I started, but I learned more with each problem I solved. For over a week I skipped my classes to write this game. I became obsessed, enjoying myself so much that I forgot to sleep or eat. Eventually I did go back to my classes (which had nothing to do with writing programs or creating games), but I was also motivated to learn HTML and JavaScript which I used to create a similar game on the web.