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.
Technical
Synchronisation
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.
Auto-save
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)
Licensing
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.
June 10th, 2008 at 8:52 pm
So, any progress on the development yet? Given that iphone 3G and SDK are around the corner, I wondered if one would also be able to play good old IF on iphone too
July 11th, 2008 at 4:13 pm
Hey there, long time Zoom fan, first time caller. Since the appstore started working on my phone today, I’m now more excited than ever to see a ‘legit’ z-machine that doesn’t require me to jailbreak my iPhone. But what you wrote really disturbs me:
“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.”
If this is true, I’m really horrified. I’m one of the project members of a z-machine for Android (http://code.google.com/p/twisty), and now I’m starting to realize that maybe freedom really does matter. I’m sort of shocked that Apple is being this restrictive. I wonder if we can get some sort of exception from Apple for your one app. They’re clearly trying to prevent people from implementing generic JVM or CLR interpreters that ‘break’ the appstore distribution model by allowing a separate ecosystem of apps to run unchecked. But text-adventures seem pretty harmless.
If this is really a dead-end, I’d like to know. It makes me realize how important opensource OS’s like Android really are.
July 11th, 2008 at 5:42 pm
[...] z-machine app for Mac OS X) is actively working on a legitimate iPhone port. However, something he posted really disturbs me: “A more serious issue is that Apple’s SDK license prohibits [...]
July 22nd, 2008 at 8:02 pm
Yes, I’m afraid it’s true: Apple aren’t too bothered about most things but they do explicitly forbid writing any application that can download code to interpret which doesn’t use one of Apple’s built-in interpreters.
The reason is probably similar to the reason they ban plug-ins: they don’t want anyone creating an application that can be used to circumvent the App Store. The clause is in a section of the license where things seem to be up for negotiation, so there may be some leeway depending on what you’re doing – however, it doesn’t have the ‘without our permission’ wording that the other clauses in that section have.
I plan on asking them: however, I suspect the answer may be no: Apple may not consider IF important enough for an exemption, especially given that Sun and Adobe have both had to retract product announcements over this clause. I also suspect that Apple’s stance may change over time; they have probably chosen to be as stringent as possible with the initial clause, knowing that it would be harder to add new restrictions than it would be to remove old ones (certainly this is what happened with Palm, where the open source tools were initially frowned upon and gradually got more acceptance as time goes by).
August 13th, 2008 at 9:16 pm
I observe that Frotz has just gone live in the App Store, so Apple clearly either aren’t aware that Z-code files are executables running in a virtual machine, or they don’t care.
August 20th, 2008 at 8:02 pm
“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.”
iFrotz has been made available in the application store… so it would seem that Apple is allowing z-code interpretation and programs. It provides access to the IFDB so that additional games may be downloaded. Other applications (e.g. e-readers) provide the ability to specify a website using the browser and downloading eTexts that way. Perhaps you could provide the same capability. In this way (admittedly the worst case) a person could bring up a temporary ftp or http service on their computer and access the files using the browser to pull them onto the iPhone… voila… Zork on the iPhone.
Cheers,
Dwayne