13 April 2015Twine 2, now a real(?) app

The release notes for Twine 2.0.4 are relatively brief. Partly this is because I haven't had as much time in the past few months to work on Twine as I had earlier in the year, but it's also because a lot of that work focused on a single bullet point there: "Added experimental native app builds."

There really ought to be a full-fledged README to go with these builds, but in lieu of that, here are some notes on what's going on.

Wait, I thought Twine 2 was a browser thing? Yes, and it really still is. The app versions use a tool called NW.js to bind the app into executable versions that are basically a stripped-down browser that only runs Twine.

The main difference for now between the web version and these builds is that instead of storing your stories in a place you can't easily see or get to (your web browser's local storage), it saves your stories to your Documents folder, under Twine > Stories. Because of this, you won't see an available space gauge in the story list. I trust your operating system will take care of letting you know if you start to run out of hard drive space.

Why is there no File menu? How do I open files or even save them? I want to keep the web and app versions as much as in sync as possible, because trying to maintain two separate versions of the app, let alone testing them on three separate platforms, is beyond my current capacity. I found it to be a slippery slope. I tried out adding an Open File menu item, but that begged for being able to open multiple files at once, and a Save option only makes sense if an individual story is in the frontmost window on OS X, which requires extra coding, and on and on.

On top of that, I found testing even two platforms (sorry Linux users -- for the initial release I kept my focus on OS X and Windows, but I hope the binaries will work) exhausting. I used a VirtualBox VM to test Windows issues; despite NW.js promising a seamlessly cross-platform experience, the reality is not perfect. I still don't understand why the menus in Windows do not show keyboard shortcuts, though they do seem to respond to them properly. (I fear I'm making some embarrassing elementary error -- this is my first rodeo with NW.js.) The experience is eerily similar to working with wxPython in the Twine 1.x series, I have to say. 95% of it works as advertised, but that other 5% is painful.

Which is not to say that a Serious Local App is an unreasonable thing to try to strive for in the future, but I don't see it happening in the near term. I am curious whether people who were holding out for a local app version will find this acceptable. I won't be too offended if you hate it, promise.

Anyway, for now I'm following the library metaphor similar to, say, iTunes. You can import stories into the editor from somewhere else, which copies them to the Stories folder. You cannot modify them externally while Twine is open, but you can copy them, rename them, and delete them while the app is closed.

Just like the browser version (and for that matter, HyperCard), your work is automatically saved as you go. Incidentally, we've improved error reporting while saving in this version, and you can now verify that a story has been saved by pointing at the story menu -- the tooltip now shows when the last time it was successfully saved.

The app just ate all my work. Thanks a lot! These apps are experimental, so I would diligently keep copies of your work just in case. That said, I've been using the OS X version for several weeks now without any hitting any problems.

But let's say the impossible happens and something goes wrong -- you should report bugs here. I'll admit that I don't read the forums that assiduously, though I do peek in on them too.