What’s coming in Twine 2.0.9?

This post originally appeared on my Patreon.

Twine 2.0.9 is going to be a maintenance-oriented release. We have three new languages that have already landed on the main development sourcebase: French, Dutch, and Brazilian Portuguese. There’s also a pull request for Russian that I’m excited about getting landed. I think there’s a sizeable interactive fiction community that speaks Russian, so it’ll be cool to give them something that works in their native language.

The other big change I want to land is totally under the covers. After talking with some fellow developers at the CharmCityJS meetup and getting advice on the workflow I’ve set up for myself, I’ve been working on refactoring the code structure a bit so that we use Browserify to split the code up into more manageable modules. If I do this right, regular users won’t see any difference, but it will be way easier to work on the code. This not only makes my life easier, but will also make it easier for other developers to contribute to the other project. As of August, the work on this end is pretty much done, but I am waiting on the next part to land those changes…

… which is that I’m overhauling the automated tests for Twine. Up until now, I’d been using Selenium IDE to exercise Twine before release. It’s a Firefox plugin that automates browser actions and verifies they have the result you’d expect. Working with Selenium IDE has always been OK at best. I could never get a few tests to work predictably, so every time I did a release, I had to manually step through a few to make sure things would work correctly. This kind of friction always annoyed me, but I put up with it because it was the best way I knew how to do it.

So, also at the suggestion of fellow CharmCityJS’ers, I’ve been working on moving the Selenium tests out of the IDE and into the build process I’ve been using, Gulp. This has the advantage of being more convenient to run — a single command instead of having to navigate a GUI — but also promises more reliability. We shall see. The JavaScript bindings for Selenium are pretty full-featured, but it’s taking me some time to translate the IDE tests into JS because the best documentation I’ve been able to find is the API docs. It is a bit like trying to learn a language by skimming through a dictionary. Suggestions welcome!

My theory is that I’ll use the revised browser tests to validate the code re-organization. A major refactor is always a little perilous. Perhaps your code was ugly, but it had been working right for several releases. The automated tests are a way to better guarantee that.

That said, I’m still planning to do a prerelease test version to the world at large to catch anything that slips through the cracks. This release has been a bit slower to get out the door than others this year, mainly because I’m doing a lot of learning along the way. That said, I’m shooting for mid-September.

Twine 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.

Continue reading Twine 2, now a real(?) app

Helping at CoderDojoDC

Last weekend, I was invited to help with a session at CoderDojoDC that focused on Twine. CoderDojoDC is more-or-less the modern equivalent of the computer club I went to after school days in elementary school — only instead of pirating Apple II games and messing around with AppleWorks and Logo, kids these days are learning Python and messing around with robotics. Progress indeed.

Continue reading Helping at CoderDojoDC

Beta

At very long last, Twine 2.0 has entered beta. You can download it from Bitbucket, or play with it right now.

The word beta has been abused to the point that it is essentially meaningless, like HD or cloud, but I’m a bit of a traditionalist about it. To me, it means no more features until the real release, only fixes. It means we’re close to a final release. So it’s an exciting milestone for me.

Continue reading Beta

War, Pestilence, Famine, Death, and Twine

I originally wrote this post for StoryCade.

There’s something unusual about the announcement of this year’s XYZZY Awards finalists. For the first time since since Inform 7 was released in 2006, most of the XYZZY Awards finalists were not created with it. In fact, this is the first time in the entire seventeen-year history of the XYZZY Awards that the plurality of nominees were not created with some version of Inform.

Continue reading War, Pestilence, Famine, Death, and Twine

The economy of Twine

Mark Bernstein was recently interviewed by Exprima Media, and a good portion of what he talked about concerned Twine. If you’re not familiar with Mark, he’s the chief scientist at Eastgate Systems, which publishes hypertext works– and more relevant to the discussion at hand, Storyspace, a hypertext authoring tool that was created in the 80s. Among his remarks was this:

Twine has no model for building a literary economy.

Continue reading The economy of Twine

Parsers and prejudice

I originally wrote this post for spectaclerock.com.

Something of a furor has erupted over some brash comments by Jonathan Blow in an interview with PC Gamer:

Adventure games are all confusion. If it’s text, it’s “Why doesn’t the parser understand me still?” So the core gameplay of adventure games is actually fumbling through something, right? And that’s true with modern [versions]. All the episodic stuff that’s coming out. And there’s a whole community that makes modern interactive fiction games and all this stuff. And it’s true for all these games.

He touches a nerve in the modern-day IF community. Bad parsers are what the heyday of interactive fiction is remembered for among mainstream gamers. Homestar Runner parodied this in Thy Dungeonman; lingering in the shadow of the first major East Coast IF meetup in years at PAX East was Action Castle, a live rendition of a text adventure which relished in classically hackneyed phrasings like “You see a thing here,” “Exits are west, east, and in,” and whose moderator gleefully retorted “I don’t know how to do that” or “You see no [whatever] here” whenever a player said a sentence more complicated than what a dog could comprehend. These parodies were affectionate, of course, but illustrative of a problem the IF community has struggled with since players first found themselves standing west of a white house with a small mailbox nearby. It’s not like that anymore.

Continue reading Parsers and prejudice

Secrets and intentionality

I originally wrote this post for spectaclerock.com.

When a PC is powered on but it finds no disk to boot from, it says to you in gray letters: “No bootable device — insert a boot disk and strike any key.” A Mac shows instead an archaic icon of a floppy disk with a blinking question mark. If you turn on a Nintendo Entertainment System without inserting a cartridge first, its power light simply blinks on and off as your television set displays a gray screen. But — there is a subtlety here not often found in computers. If the NES senses a cartridge but cannot read its contents properly, it will sometimes show its initial screen but with corrupted graphics, or with the first note of its song strung out into an endless tone.

This is a harmless occurrence whose traditional remedy is taking out the cartridge and blowing into its contacts, to clear out any dust. It’s a familiar, comfortable ritual to anyone who owned a NES in its heyday, like cleaning your glasses or trimming your fingernails.

When I was a child, I once turned on my father’s Atari 2600 with a cartridge half-inserted by accident. Instead of displaying a message, an icon, or even corrupted graphics, it emitted an unholy, piercingly loud shriek.

I found out later that this process is called frying, and that if you do it skillfully, you can alter gameplay — by causing sprites to act contrary to their programming, or the world of the game itself to warp.

But as a kid, I was scared shitless by the sound.

Continue reading Secrets and intentionality

Why I’m doing this

This was originally written for gimcrackd.com. A postscript — the piece in question was A Kiss by Dan Waber.

To counterbalance the gloominess I’ve been posting about recently:

Last month, I got an email asking for help with Twine. It was running really slowly, the writer said, and it was nearly intolerable, working with the story map. After trading emails back and forth, I asked if I could look at the story file he was trying to work with, and he obliged. (I always feel a little strange asking for these things — at least I feel quite protective of my own work — but people have always been willing to share so far.)

I opened it to find a total spaghetti of nodes and links. All in all: 300-some passages, about a thousand links running between them. This was, to put it lightly, more than I had ever expected my poor little program to deal with. The lines running to the central node were so tightly clumped together, in fact, they formed a kind of moire pattern. This was the worst-case scenario made flesh. It took maybe two seconds to redraw the map — not that long in the grand scheme of things, but when you just trying to scroll around, get a sense of things, you know, actually do work — it was agonizing.

What caught my interest, though, was the content. I did not go poking around in it deeply — again I felt odd doing so — but I did want to see what some of the really critical nodes, the ones that caused the frame rate to plummet as soon as they came onscreen, were doing. So I caught the drift of it.

It was a love poem.

I came up with some quick optimizations to help him out — I had missed some very obvious things. For example, if a passage linked to the same place twice, Twine would actually go to the trouble of drawing the same line twice. This helped a little, but the final solution was to allow users to turn off some of the prettier features of the story map to get better performance.

I have a better solution in the works for the next version of Twine that should solve the problem entirely. (Briefly: it will save offscreen the parts of the story map that never change, so that each redraw of the map only manually draws what has changed — e.g. the passage you are dragging around, or the marquee selection you are making. Again, fairly elementary stuff.) I still hold onto that story file, mainly to test out optimizations, but also to remember what I’m doing helps people do real things, to make poetry even. There aren’t that many developers out there making things that people make poetry with. I feel lucky.

(Quoth jwz: “Your ‘use case’ should be, there’s a 22 year old college student living in the dorms. How will this software get him laid?” Easy question.)