Archive for category Interactive Fiction

Interactive Fiction WIP Progress Report

I’m working on a project for this year’s Interactive Fiction Competition (IFComp 2010).  It’s one that I started as kind of a small palate-cleanser after last year’s Comp, intended to be a quickie adventure for my son.  As I worked through the idea and setting, however, I realized that there was more there than I was planning on implementing, and I reevaluated the scale of the project.

The result is my current work in progress (still nameless for now).  I’ve been working on it almost since I submitted last year’s entry, aside from a couple of breaks, and I’m happy to report that I’ve completed implementation of the last puzzles and the ending sequence, at least in skeletal form.  Much of the early game is more completely implemented, but getting the “bones” of the rest of the game laid down means that I don’t have to worry too much about infrastructural issues any more, and can concentrate on finishing the writing and improving the polish.

I’m very relieved to be at this stage; I pushed hard to get here over the past month and am happy that I achieved this.  I can hear you saying “But Matt, it’s the middle of July!  Why are you worked up about completing your game when you have two and a half months left until the Comp submission deadline?!?”

Well, there are several reasons.  First, with a baby in the house that’s almost exactly as old as my WIP, plus two other young kids and a wife I enjoy spending time with, getting time to work on the project is not easy.  I’ve used almost the entire amount of my free time since the last Comp (except for a Dragon Age break) to get here, and I’ve needed it.  I know that finishing the rest of the game in time is still going to require focused effort, especially when school starts back up in the fall.

Second, I have a much better idea of what goes into creating a finished, polished game than I did last year.  For Grounded in Space, I didn’t give myself enough time for development, for learning the tools, or (most importantly) for testing.  This year, even with the game scaffolding implemented end-to-end, I still have the following left to do (in roughly the order they need to be accomplished):

  • Enhancing the in-game tutorial
  • Fixing some known game-derailing bugs
  • Write out the ending sequences in full
  • Test and enhance the default message modifications
  • Implement some additional short scenes and interactive dialogue
  • Review my keyword implementation to ensure it’s consistent and useful
  • Perform object testing a la Juhana’s Object Response Tests
  • Alpha testing
  • Revise my writing
  • Test compatibility on various interpreters and platforms
  • Set up Quixe-specific modifications required for proper keywording and exit-lister display
  • Do cover art and a blurb
  • Beta testing and bug fixing

So no, I’m not resting on my laurels having gotten to this point.  If anything, getting this far has only permitted me to lift my head up and see how far away the finish line still is.

Wish me luck — I’m going to need it!  And for all the other authors this year – both returnees and first-timers — I wish you the best of success with your stories!

Tags: , , ,

Upgrading to Inform 7 6E72

With the recent releases of both the in-browser Glulx interpreter Quixe, and the newest Inform 7 Build 6E72, it was pretty obvious that I’d have to upgrade.  Sure, theoretically it would be possible to stick with the last version of Inform and manually roll out a playable website for my WIP.  But why turn down all the labor-saving power of the new “release along with an interpreter” option?  It automatically builds you a nice website, converts the Glulx file to Javascript for you, and packages it neatly up for release.  I’d also modified my source to remove the very few procedural rules I’d previously used, since I’d heard I7 is deprecating them, so I figured getting my WIP up and running wouldn’t be too arduous.

Happily, I was right!  I did run into about a dozen errors, which fell into two broad categories:

  1. Errors due to more strict syntax checking in the new build.  These were easy to find and fix — I spent maybe 5 minutes on these.
  2. Errors due to changes in the extensions I use.  My WIP uses a lot of extensions, and I hack some of them up a bit as well with overrides.  So pulling down the newest versions of all these extensions caused me a bit of worry.  Of them all, however, the only one that gave me any more than the most ephemeral trouble was the new version of Jon Ingold’s Flexible Windows.  Instead of a single drawing rule, it now uses an object-based rulebook, which required a couple of minor changes (as he points out in the changelog, I should note).  Actually making the code changes was easy; finding out exactly what needed to change was the trick.  Even this, though, didn’t take me more than about 15 minutes.

So the first thing I did now that I could get up and running in the new I7 was to set up Quixe and try a test release using it.  I was pleasantly surprised by the nice CSS defaults for the web pages.  The result isn’t quite up to the level of typography you can get with Gargoyle, of course, but for a literally no-effort setup it’s more than serviceable.  The only thing I ended up doing to the generated pages was to modify the User1 and User2 styles so that they reflected the colored text defaults that I start with, and I was off and running.

I have noticed that I7 is a touch slower to compile now than it was before, and generates a larger story file as well.  Before the upgrade I was running at just over 800 KB, and after the upgrade I’m up over 1 MB.  All the changes and improvements in the I7 release probably contribute to this, but I was pretty surprised to see the size of the generated file increase by 20%.  What this really means, I guess, is that it’s a good thing Quixe came out when it did, since the new I7 has pretty well priced itself out of the Z-machine’s range for all but the most trivial stories.

One thing I hope people continue to look at is the performance of Quixe.  The speed difference when running under Gargoyle vs. when running under Quixe is shocking — Quixe is at least an order of magnitude slower than standalone compiled interpreters, and I suspect more can be done to optimize Quixe given how brand-new the implementation is.  My fairly large WIP is certainly playable, but the slow response time is jarring.  Until speed improves I’ll still be playing most games through a standalone interpreter.

Now the only trick remaining is for me to work out how to support the dynamic color shifting for user styles that the standalone interpreters can use.  I have an extra window created below the status line that should be able to display one of four choices of colored text depending on what the user wants.  I’m thinking that with some judicious changes to the standard styles for that window, along with some minor changes to the code that displays the text, that I can support the appropriate choices in Quixe with a single set of CSS.  If I can’t, I guess I can create alternate windows with different color settings in their specific CSS sections and swap them in appropriately.  I’ll just have to ensure that whatever I end up doing for Quixe doesn’t break the solution I’m using for other interpreters.

Tags: , , ,

Andrew Plotkin’s Quixe Beta: Glulx Games Directly In-Browser!

In a surge of holiday-weekend coding, Andrew Plotkin (Zarf) has progressed his Quixe project to the beta stage and released it for evaluation.  If you’re very familiar with the excellent Parchment project, you’ll know that Parchment provides a Javascript implementation of the Z-machine, which is one of the major virtual machines used in the interactive fiction community.  When you play a game via Parchment, you don’t need plugins or standalone interpreter software at all — you play directly and natively in the browser.  This has obvious advantages for outreach — many people are leery of downloading unknown executable files at all.  And unless your game runs in Flash, convincing someone to install a browser plugin can be almost as hard a sell.  So Parchment has been a great mechanism to make Z-machine games available to not just a wider audience, but to a wide variety of devices as well.  Almost any device that supports a Javascript-enabled web browser can access interactive fiction through Parchment.

But until now, Glulx games were left in the cold.  Glulx is an alternate virtual machine developed by Andrew Plotkin to address some of the limitations of the Z-machine.  There’s more addressable memory as well as support for multiple windows, graphics, and sound, among other improvements.  Inform 7 gives you a choice of using Glulx or one of the Z-machine formats when you compile a game.

Unfortunately, using Inform 7 for a game of any complexity almost forces you into using Glulx, whether you are making use of its enhanced capabilities or not.  Inform 7 generates large game files that easily push past the Z-machine limits.  Particularly if you make use of the growing extension libraries you are likely to inflate yourself right past even the Z8 format’s cap on size.

So Inform 7 developers have (for the most part) found themselves unable to enjoy the same advantages of accessibility and ubiquity that Parchment gives Z-machine authors.

Enter Quixe.  Quixe provides a native Javascript implementation of the Glulx VM.  When combined with a suitable output layer (in this case I believe Zarf is using his own GlkOte implementation) it enables the same type of direct-in-browser play for Glulx-based games that Parchment enables for the Z-machine.

He’s currently got five games up on his page, but authors are able to convert any existing Glulx games using the zcode2js tool, and run them via his engine.  If you do this, you’ll notice that not everything is functional yet.  In particular, if you play the conversion of Rover’s Day Out you’ll miss much of the text formatting and screen effects that are visible in the game when played via a standalone interpreter.  Also, Internet Explorer does not currently work (!) Presumably these problems will be fixed and capabilities will be added in as development proceeds.  I expect we’ll also see the new style model that Zarf has been discussing over the past few months.

And of course, I had to run a conversion of my own Glulx game, Grounded in Space!  Despite not being very long or complex, I had to use Glulx for this game due the need for fairly high-precision floating-point math for one of the puzzles.  I haven’t gone through it in detail yet, but it seems to have converted correctly.  It doesn’t use any odd tricks that should prevent it from being playable, although the geometry puzzle might be even less comprehensible due to style and font issues.  At any rate, it’s very cool to have this capability, and I hope by the time this year’s Comp rolls around we’ll have a much larger number of games able to be played online due to Quixe!

Tags: , , ,

Inform 7 Tips — Syntax Options for Action Responses

There are several ways to approach writing complex behavior in Inform 7.  Two common ones are what I’ll call “action oriented” and “subject oriented”.  It might make more sense to use “object oriented”, but that term already has enough associated connotation and confusion.

The “action oriented” style seems to be the one used most consistently in the Inform 7 documentation, and as you would expect it’s very useful and readable.  An example is something like this:

Instead of examining something in the presence of Dan when Dan is bored:
	say "'Quit gawking at the scenery and entertain me!'";

Note that this code applies to the player whenever he or she examines anything.  Although there are additional qualifiers attached that limit the scope of the rule, and we could certainly add more, it fundamentally works as a modifier (or in this case, a replacement) for a single action against a range of possible objects.

But it’s often the case that you want specialized responses for a number of different actions performed in certain circumstances.  You can achieve this using a more “subject oriented” style:

Instead of doing something to the teak table in the presence of Dan when Dan is bored:
	say "'Quit screwing around with the table and entertain me!'";

We now have a rule that makes anything you do — to the table, and the table only — trigger a generic complaint message.

All this is great as far as it goes, but what if we want to get more ambitious yet?  Let’s say Dan mocks you when he’s bored, and you’d like him to have something different to say depending on what you happen to be doing.  How would we express this?

If we went by the book we could make a bunch of “action oriented” rules, arrange them in a rulebook, and run that rulebook when the proper conditions apply.  If we did that, we’d have something that looked like this (code changed due to Andrew Plotkin pointing out that the Report rulebook doesn’t have a generic version):

The block singing rule is not listed in any rulebook.

After doing something in the presence of Dan when Dan is bored:
	consider the mockery rulebook;

A mockery rule when examining:
	say "'Ooooh, look at me!  I'm wasting time looking at something completely irrelevant!'";

A mockery rule when singing:
	say "'Hold on there, pal!  Ryan Seacrest is holding on line one!  He wants you to be the next audition reject on American Idol!'";

etc.

This works, and works well.  In the case where you want to do anything dynamic to the rules on the fly, this is definitely the way to go.

But there’s another syntax that allows expressing these kinds of constructs in a more straightforward manner, particularly if you don’t need the full power of a rulebook.  The Inform 7 documentation hints at this, but doesn’t always give you full examples of the syntax.  Here are the above rules expressed in this other format:

The block singing rule is not listed in any rulebook.

After doing something in the presence of Dan when Dan is bored:
	if examining:
		say "'Ooooh, look at me!  I'm wasting time looking at something completely irrelevant!'";
	otherwise if singing:
		say "'Hold on there, pal!  Ryan Seacrest is holding on line one!  He wants you to be the next audition reject on American Idol!'";

This is good — I like it because it groups together all the special responses when a particular condition obtains — but often we might want to specify an action that can involve multiple nouns.  In that case, you can use the following syntax (if you have a filling action defined):

...
	otherwise if filling something with something:
		say "'You're wasting your time with that...'";

and, of course, you can specify either or both of the nouns as well:

	otherwise if attacking Dan:
		say "He easily dodges.  'C'mon, wimp!  You'll need to do better than that!'";

It would be nice, as long as we’re valuing brevity, to be able to use the “switch/case” syntax for this — something like:

The block singing rule is not listed in any rulebook.

After doing something in the presence of Dan when Dan is bored:
	if the current action is:
		-- examining:
			say "'Ooooh, look at me!  I'm wasting time looking at something completely irrelevant!'";
		-- singing:
			say "'Hold on there, pal!  Ryan Seacrest is holding on line one!  He wants you to be the next audition reject on American Idol!'";

… but I haven’t been able to find a variant of this syntax that works properly.  Perhaps the new version of Inform 7, scheduled to be released today, will allow this.

At any rate, I hope this was useful.  Rulebooks are exceptionally powerful and many times they are the proper solution to your design issues, but don’t underestimate the power of the “subject oriented” approach.  By keeping your related actions in close proximity like this, you can keep your code clean, readable, and well-organized.

Tags: ,

Inform 7 Tips — Keyword Disambiguation For Verb/Noun Conflicts

I thought I’d share an Inform 7 programming tip I’ve come up with in recent work on my new game.  As you could probably have guessed from previous blog entries (here and here), I’m using a keyword-based interface in this new work.

At its core, what a keyword-based interface does is to link up a generic single-token input to one or more default actions, such as examining, asking about, or going.  Here’s a very basic example of some code that you might use to effect this:

Understand "[something]" as examining.

Simple, right?  Now if you type a word that refers to an object, the game will examine it.

Well, most of the time it will, except in a couple of annoying cases.  What if you have a drill in your game?  You could refer to the drill as the keyword “drill”, but if you have a drill you likely also have a drilling action as well.  What happens then?

Drilling is an action applying to one thing.

Understand "drill [something]" as drilling.
Understand "drill in/into [something]" as drilling.

What happens here is that whenever you type “drill”, the system immediately assumes that you want to use the specific “drilling” action rather than the generic keyword examination, and it asks you to clarify what you want to drill.

Likely this is not really what you want.  If it is, you’re fine; you can leave things as they are.  But in a keyword-focused game, you might judge it more important to preserve the behavior of the keywords and force the user to actually specify an object to drill if they want to perform the drilling action.

The reason the parser resolves a command of “drill” the way it does is not easy to pin down through standard Inform debugging commands, but is almost certainly due to the same general prioritization rules that it uses throughout the system:  the most specific match wins.  Even though “[something]” and “drill [something]” are both potentially valid matches for an input string of “drill”, Inform counts the exact text match of the drilling action as a closer match, even though it requires a second token. To Inform, that’s not a problem; it knows how to prompt the player for that required noun.

To get around this behavior, you need to provide a match that’s even closer.  Fortunately, this is pretty easy:

Drill-referring is an action applying to nothing.

Understand "drill" as drill-referring.

Instead of drill-referring:
	try examining the electric drill;

Now we’ve implemented an action tied to an exact match to the input token.  “Drill-referring” is now the best match for an input string of “drill”, and we can wire up the “drill-referring” action to do the appropriate thing.

Likely you won’t run into this type of behavior in a whole lot of places, but it can be nice to know how to resolve it if you do.

Tags: ,

New Inform 7 Release Imminent

Great news from vaporware’s post on rec.arts.int-fiction!  Inform 7 will have a new release on or shortly after April 28th!

Items slated for the new build will include:

  • Tidier user interface
  • Easily publish Inform works to the web, including a release mode
    that creates a playable web site using Parchment
  • Many language restrictions removed, and more expressiveness in
    talking about kinds, phrases, relations, etc.
  • Many Standard Rules actions changed to provide default behavior
    closer to what modern authors tend to want (automatically opening
    doors, handling TAKE ALL more naturally, and so on)
  • More than 250 bug reports resolved

Can’t wait!

Tags: , , ,

The Fruits of My “Research”

I recently took what ended up as a 2 1/2 month break from interactive fiction development.  Most of that time got spent on Dragon Age, but I also played through Left 4 Dead 2 due to an offhand comment by Zarf on rec.arts.int-fiction.  In addition, over the Easter weekend I traveled to my in-laws for the holiday and also to celebrate the birthdays of a niece and nephew.  While at Chuck E. Cheese for the latter event, I found an interesting game called “Let’s Go Jungle”, which in addition to sounding like something my daughter might say, incorporated an interesting gameplay mechanic that adds interest to what is otherwise a garden-variety rail shooter.

So to rationalize to myself that I didn’t just flush the last couple of months down the toilet, here’s some of the musings I drew from my “research”:

Read the rest of this entry »

Tags: ,

Keyword Interface for Conversation Package

Following up on my previous articles on integrating Aaron Reed’s Keyword Interface extension with Eric Eve’s Conversation Package system for conversations (part 1 and part 2), I’ve packaged up the interface code as an extension and submitted it to the archive, so it should be showing up there shortly.

The code is a bit different from what was presented in the articles, due to some changes required because of minor issues with new versions of the extensions it builds upon.  The extension should support both Glulx and Z-code text coloring.

Thanks to Strainer for providing me the kick in the pants I needed to get this done!

Edit:  Due to an apparent bug with the OS/X version of Inform where it perhaps adds the author’s name and the extension name together before comparing against the 51-character limit, I’ve changed the name to “Keywords for Conversation Package”.

Tags: , ,

Hoosegow Wins!

Congratulations to Jack and Ben for another win!  The excellent Hoosegow defeated a deep and strong field to take the $1000 prize in the JiG Casual Gameplay Design Competition.  Congratulations to the other top finishers as well!

The top 4:

  1. HoosegowBen Collins-Sussman and Jack Welch
  2. Fragile ShellsStephen Granade
  3. Dual Transform — Nigel Smith (actually Andrew Plotkin)
  4. Party FoulBrooks Reeves

Tags: ,

Hoosegow

If you’re interested in one-room escape games, JayIsGames is hosting a competition for them.  One of the entrants is Hoosegow, an interactive fiction game by Ben Collins-Sussman and Jack Welch, the team behind this year’s IFComp winner Rover’s Day Out.

I did some design review on this game, although I wasn’t able to beta the finished product.  It’s another well-written, fun little adventure with a tongue-in-cheek Western style that should have wide appeal.  I was very impressed with it.

It doesn’t look like JIG is showing the contest details at the time I’m writing this, but it should be up soon.  Check it out when you get a chance!

Tags:

The Quern is Digg proof thanks to caching by WP Super Cache