Advanced graphics for Inform 7

While working on another project, I found that I really needed much more control over Inform’s input loops. I put together an extension to solve the problem, Glulx Input Loops. While the primary impetus for GIL was rather arcane, the final extension also allows for the game’s primary input loop to accept any type of input in place of “line input” (the standard typed text input familiar in interactive fiction). For example, if you want your game to be played entirely with hyperlinks—no typing at all—you could make that change by writing, essentially, a single line (you’d also have to include one of the numerous extensions that implement hyperlink input).

Anyway, while contemplating what kind of example code I could include with this extension, I thought about the way that Nethack has you chain together single keystroke inputs to build commands. For example, to eat something, you key in “e” for “eat”, followed by another letter for the edible inventory item you’re keen on. I wondered whether something similar might work for interactive fiction, and so I threw together a quick experiment to explore the question.

The result is a bit underimplemented—you can only enter, at most, VERB + NOUN inputs—and there quite a few issues are left hanging that any full-scale game would need to address, such as how to provide contextual lists of items, how to allow the player to refer to things outside her immediate environs, how to handle conversation, and so on. Still, it at least gives a good sense of how this kind of thing could work. You can play the example online, browse the source, or download a gblorb for use on your favorite desktop interpreter here:

Under Doom (An Interactive Experiment)

Reflection: I’m not sure whether this fills any real need. A similar interface that used hyperlinks would be more practical for mobile devices, for example, and for most of us working on a full-size computer, typing a full word isn’t really a whole lot less work than hitting a single key. Comments welcome.

Advertisements

Comments on: "An Experiment with Keystroke Input in IF" (5)

  1. Ben Cressey said:

    I like it. It feels closer to the traditional IF experience than hyperlinks, at least to me. I’m a Nethack fan so that may explain why it seems more comfortable.

    I could see this being useful when targeting a device like the Kindle, which has a keyboard but lacks a touchscreen. Single (alpha) key input is the sweet spot there.

    • Good point. I hadn’t thought of the Kindle, but you’re right that this would be a nice thing to have for that sort of device. I didn’t mention it in the original post, but it’s very easy for the author to move between this and other input modes. In other word, keystrokes could be offered as an alternative to standard input (with only a few extra lines of code, in fact).

  2. I like this a lot. Incidentally I’ve never really liked how hyperlink-laden IF text looks.

    So I take it this combined with Glimmr means you’ve cracked the roguelike-in-I7 nut? 😀

  3. There’s a big difference between a single letter and typing a whole word. Otherwise, why ‘x’, ‘l’, and ‘n, s, e, w’, etc.?

    It does add another obstacle for new users (trying to remember all the letters to play Nethack is a problem for new players), but if the interface accepted both full words and single letters, that ought to work.

    • If a game does this, I think that the keystroke commands should be listed on-screen so that it isn’t necessary to memorize the keys (as it is in Nethack). This might be a problem for a game with a lot of verbs…

      Note that the interface can’t accept full typed words and single letter commands *at the same time*, because there would be no way to know whether the player intended any given keystroke as a full command or just a character in a string. Moving between the two modes, which is what I assume you mean, is pretty trivial though.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: