Archive

Posts Tagged ‘Interactive Fiction’

The Problems with Paths

Navigation is a fairly straightforward process in Interactive Fiction, and it can be implemented in a number of ways, depending on the authoring system you are using. With Inform 7, which is a powerful yet relatively simple plain-English system, you can create a path between two rooms very easily;


The Library is room
The Parlor is south of the Library.

The code above immediately creates a room/location called Library. The a second room is created in a relative position, south, from the first room, and the second room is call Parlor. Since Inform 7 manages the room relationships, when executing the above snippet will have you “starting” in the Library, and you will be able to go south into the Parlor, and then north again back into the Library simply by typing “south” and then “north” in the automatically provided prompts.

This is one of the advantages in using Inform 7 when creating your game, as the system manages all location relationships (among other things). In this way you can create a fairly complex geographical space which to explore, without having to do a lot of work setting up variables, arrays, conditional statements and so on.

Unfortunately, this kind of high-level ease comes at the price of less granular control and flexibility over what can be done in the program. One of the functions that Inform 7 does not provide (without creating extensions) is the ability to think of paths between map locations as “locations” themselves, with their own descriptions and attributes. Additionally, paths should have different descriptions based on the direction of travel. Using an typical programming language this can be implemented straightforwardly through the use of arrays.

In order to add this and other functionally to the project, I decided to move the program from Inform 7 to the LiveCode language (an open source version is available). I selected LiveCode because of it’s robust built-in text processing functionality, which means the parser that I build can easily identify words and phrases without having to do any character counting. LiveCode is also loosely typed, so I can deal with variables much more easily.

Using LiveCode, I’m able to conceptualize paths as locations, yet I’m able to have the program “pass through” without stopping or identifying the paths as specific places to stop or break the action. This means I can leave one building to cross the street to the entrance of another building, and action can take place in the street along the way. Consider the mini-map below.

There are two locations here. Location 37 which is west of Location 19. There is a path between the two, which you may assume is bi-directional. So if I were in Location 37 and typed “east” as my command, I would be taken to Location 19. It might look something like this in my display:


You are in Location 37.

>> west

You are in Location 19.

Certainly I could change the description of Location 19 to include a little bit of travel observation, such as:


You are in Location 37.

>> west

You walk across the rough grass to Location 19.

But this introduces more programming complexity. First, what if I could enter Location 19 from the north and the south as well? At that point, adding the path description into the location description would not make sense.

Instead, in LiveCode I am able to create another array that keeps track of path descriptions and other attributes. I can use the format:

aPath[x, y, z]

Where aPath is the array name, the variable x is the initial location and the variable y is the destination location. The variable z can be used for a number of attributes such as the path description, path status (if there is an open or closed door), etc. For example:

aPath[37, 19, 0]

would signify the path description when moving from Location 37 to Location 19, and reversing the direction would yield a different description:

aPath [19, 37, 0]

There is quite a bit more that can be accomplished with this separate path designation, including allowing players to find or leave objects on paths, encounter non-player characters, experience different weather conditions, and find barrier puzzles that need to be solved. From my point of view, it’s much easier to manage this through LiveCode (or any other high-level language) rather than using Inform 7, which makes certain assumptions as to how Interactive Fiction should work.

Advertisement

Latest Williamsburg Game Map

I’ve been working on updates to the building interior locations. This map reflects the latest navigation scheme. I’ll have the next playable release available to Kickstarter backers up shortly.

williamsburg-game-map-15

Latest Playable Release – HWLN12

This report recently went out to all of the game Backers on Kickstarter. The actual download location is available only to the Backers.

**********

Greetings, Backers!

I new version is available for download at [URL HIDDEN]. Included in the .zip archive is a map of the locations.

A quick word about the map: where you see the location names highlighted in blue, the blue portions indicate a shortcut in the game navigation system (meant for speedier play testing only). For example, on the map is the “Military Encampment” location with the word “Military” in blue. When you are playing the game, type “xmilitary” at the cursor and you will be immediately taken to the Military Encampment. This will work for any of the locations in blue.

A big “thank you” goes to backer Vivianne D. for her work on the navigation code in Inform 7. Now when you type “dir” at the cursor, the game will display all possible directions (unless specifically hidden) based on room relative location definitions. Previously, I had been hand coding all those directions.

Otherwise, changes in this version are not major. Cleaned up more descriptions, added some detail, etc. Feel free to play it and let me know what you find.

In an upcoming release I will be publishing a guide that provides a listing of the possible commands.

Hap

Revised Game Map

I’ve revised the game map slightly from the last published version. In this new map, there are some altered and additional paths between locations. Also, several of the buildings (represented by red squares) have interior rooms, providing more locations for exploration. These buildings are marked with the light blue circle around them. This map is being implemented in version 11 or the test program. I’ll have that version published soon for the HWLN Kickstarter backers.

 

Williamsburg Game Map 07

Doors, Doors, Everywhere!

An interesting note about dealing with doors in Inform 7. I’m having to come up with unique names to identify the individual rooms/locations in the game. While it’s possible for me to use designations like “location001,” “location002,” etc. and then assign display names with the “printed name” command, that’s not as useful to me from an ease-of-review programming methodology. So I’m having to come up with some fairly lengthy yet nicely descriptive names.

All this makes me realize how many doors I have in the game. The Governor’s Palace alone is four stories (including a basement), and it has a whole lot of bedchambers that need unique names, for example.

But at least the players will be able to open and close doors in the game–at least those that aren’t locked. Or hidden.

Interested in getting started with Interactive Fiction?

If so, this primer by Andrew Plotkin will give you an introduction. The handy-dandy reference card is especially helpful.

http://eblong.com/zarf/if.html

A Starting Screen

While I’m doing Glulxe testing, I thought I’d take one more screen shot of the game, this one all text. This is right after the game intro screen comes up, and the player presses the space bar to get into the game proper.

You’ll notice the first command issued by the player is followed by more descriptive text. “More” is a custom command I’ve added to the system that displays more detailed information about the location surroundings. Ultimately, it’s all to help the player make sense of the game.

firstscreen

Running on Glulxe

It’s quite easy to release Inform 7 games for the Glulxe interpreter, which in turn makes it easy to test. So that’s what I did to get this screen shot with the Capitol, and there’s a portion of descriptive text on the screen as well.

Parser-based or CYOA? What is IF?

I have an article published over on Storycade. Topic is parer-based versus CYOA; what should be considered “real” Interactive Fiction? Check it out!

New Navigation QA Version

August 23, 2014 1 comment

Version 2 of the Navigation Test is now available here. Updated with the following:

  • Gives verbose or brief descriptions of each location. Type “verbose” or “brief.”
  • Clear screen by typing “clear.”
  • Goes back to starting position by typing “reset.”

In this version, check for navigation accuracy (compared to the map), and make sure that Location X is consistent with location as identified in status bar.