Challenges for iPhone CocoaGlk

Development so far has actually been quite quick as I've been focusing on the things that are the same on the iPhone as on desktop OS X. Eventually, I'm going to need to address the differences, though.



Something I would really like to implement is the ability to synchronise with Zoom running on a Mac, so when you plug your iPhone in, all your latest saved games are copied between the two applications, and any story files that you've selected get copied onto the phone.

Synchronising over wifi is possible, I suppose, but it would be nicer to have iTunes do it for you when you plug your phone in.

Obtaining games

I haven't decided on the methods for obtaining stories yet. I think that this should be reasonably easy: provide an interface to the IFDB that works when the phone has a wifi connection. Synchronisation would be nice, but it can't be the only way that stories are put onto the phone, because PC users would be left out in the cold.


Interpreters running on the iPhone are really going to need this. I doubt users would appreciate a 'are you sure' dialog when you hit the home button and losing game state just because a phone call has arrived is really poor form.

Zoom supports this, so this should be easy for Z-Code. glulx doesn't, though: I'll have a look at hacking this into the interpreter, but it really needs to be a part of the specification for any IF interpreter (even on the desktop)


CocoaGlk is currently licensed under the LGPL and distributed as a framework. This isn't appropriate for the iPhone, as there's no such thing as a framework and the LGPL requires things that are statically linked to be under the LGPL as well. That means almost no interpreters as many are under incompatible licenses.

The solution is to change the license to one that is less restrictive: probably the MIT or modified BSD license.

A more serious issue is that Apple's SDK license prohibits downloading code to interpret: this means that it would be impossible to load any games that were not bundled with the interpreter. I think this is probably a fatal problem: it seems doubtful that many IF authors will be willing to pay the $99 required to get their work onto the iPhone - plus it would mean no Zork, ever.

User Interface

I haven't really decided on how the UI should work. The basic functionality should be pretty simple, but there are a few issues new to running on a small display:

Complex graphics

Games like moments out of time use a complex window layout that won't work too well if we use a large enough font to be legible when everything is on screen. So, it would seem sensible to have a Safari-like ability to zoom in and out.

However, games with a more traditional layout won't really benefit from this, so we're going to need to be clever and detect when we need to have a zooming display and when a simple, more legible, display is useful - some experimentation is required! The initial version will go for the 'big but simple' approach, which should work with the majority of IF games that are out there, but I'm not going to be satisfied until games like City of Secrets and Moments Out of Time run and look good.

Text entry

This is pretty crucial to get right. The iPhone keyboard isn't ideal for typing lots of stuff in, so CocoaGlk is going to need to help out. Luckily, I can borrow ideas liberally from the Palm interpreters that already exist:

Tapping on a word in a text window should insert it as input (with an animation + a quick way of undoing accidental taps) Tap + hold on the center of the display should pop up a compass rose. Dragging in a direction will enter that direction as a command. If possible, I'd like any words the game prints that don't exist in the autocompletion dictionary to be added, at least for as long as CocoaGlk is running: that should make typing those made up magic words a lot easier. There also needs to be a way of getting a list of common verbs. I'm thinking that if a tap+hold on the center brings up a compass, one on the right side of the screen should bring up the verb list - drag to select a verb (the verb under where the user taps would be blank to avoid accidental input) Possibly the tap+hold gestures should be duplicated in a toolbar along the bottom of the screen (or only done that way if it works better) There's a tap+hold gesture on the left hand side that's not being used in this scheme, so if someone thinks of some other useful shortcut, that could go there. The reason for using a tap+hold to bring up shortcuts is that dragging is more sensibly used to scroll around the game output.

That's it for now.. I'll try to get something more exciting for the next screenshot. Honest. This entry was posted on Tuesday, March 11th, 2008 at 1:18 am and is filed under CocoaGlk, iPhone. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.