Thursday 10 June 2010

Command-lines in games

Over at Emily Short's blog, she has an interesting post on whether interactive fiction games really need parsers.

One of the things that makes command-lines powerful in computer interfaces is the ability to chain together commands in novel ways (e.g. in Unix, listing files, and piping the results through a filter).

Guess-the-verb still exists (because nobody knows every possible command), but the user can (theoretically, at least) develop facility with all of them independently – anything can be filtered. There aren’t any special cases where the commands suddenly behave differently. All of the possible outcomes emerge naturally from combinations of commands.

The game-world analogue for this is a physical simulation – given a number of universally available options (walking, lifting things, letting things go, throwing things), and all outcomes emerge from combinations of these, in the context of the universal world rules (e.g. mass, gravity, the rigidity of objects, friction).

A given puzzle (e.g. press a button high up on a wall) might have many solutions – stack some boxes, throw a ball at it, etc., and perhaps only one or two of them were anticipated by the scenario author.

Once you get to a certain level of facility (e.g. you’re no longer trying to pick up the air, or ‘throw’ when you’re not holding anything), every sequence of actions does at least have an outcome. (Though you might not like it!)

In CDLIB (MUD software – I’m not sure how this compares with Inform), the situation is quite different.

While there are global verbs, like ‘north’ – many verbs are made available to the player by relevant objects. I can’t ‘smoke’ anything except a cigarette – I can’t ‘smoke twig’. (Unless I’m carrying a cigarette, in which case I might be told ‘You can’t smoke that.’) I can load my sling with pebbles, but not a stick of chalk.

Successful smoking and sling-loading are special cases, outcomes that were pre-planned. Many attempts to invoke these concepts result in no outcome at all.

Pocket interactive fiction occupies a very awkward position, to my mind. Immersion requires the promise that you could do anything, but specifying the flammability of every object in the game world is a crazy investment when all you want to do is let the player enjoy a post-coital toke in scene six.

One complicating factor is that a lot of the actions we wish to support in IF are very high-level. Smoking consists of numerous small actions (open packet, get cigarette from packet, put cigarette in lips (not mouth!), get match from matchbox, rub match on matchbox, touch cigarette with match, shake match).

Another complicating factor is the highly idiomatic nature of language – it only makes sense to ‘smoke’ a handful of things, but it’s immersion-breaking if we simplified and forced users to type ‘consume cigarette’.

So we resort to writing special cases needed to make the game go… but then we’re left repairing the immersion by writing endless witty no-outcome responses to unsupported actions like ‘smoke chalk’.

Thursday 3 June 2010

Three Year-Old Magic

This morning at breakfast, my three year-old, Leah, performed an incomprehensible magic trick. She's holding her hands behind her back, waving them around, then she's shouting "Ta-Da"! I have no idea what was going on in her mind, but she seems pretty pleased.

"Honey, you need to explain what you're doing so people can understand your trick."

To demonstrate, I make a fist and hold it up. "There's a penny in my hand, and I'm going to make it disappear!" I hadn't anything in my jeans pockets, so I'm just pretending - my fist is empty. Maybe I'll get a laugh out of it.

Morgan, my six-year old, perks up.

"Show me the penny! There's no penny in there."

After years of my lame daddy-magic tricks with pennies, Morgan now questions every step of the way. There's no way she's going to believe there's a penny in there unless she sees it first.

"You're right, Morgan," I say, "there's no penny in my hand. See, Leah, people need to understand what you're doing and believe it, otherwise the trick doesn't work."

I'm not going to fool anyone, but now I'm in the mood so I continue with my impromptu routine.

"Look, Leah, I'll make it disappear!" I say, holding up my still unopened fist. "I'm going to squeeze it down to nothing!" Loosening my grip, I poke my finger in one side, then in the other, ostensibly pressing the penny down to dust-speck size.

"Now that it's too tiny to see, I'm going to blow it out like dust!" I hold my fist to my mouth, blow through it, then theatrically fan open my fingers, showing my empty hand.

"Where's the penny?" I ask.

Leah thinks for a second. She wasn't born yesterday. She's turning four in a week, she's been around the block a few times now. She's seen this sort of thing before.

"It's in your ear!" she exclaims!