Adventure Games and Interactive Fiction

Experimenting with Hypertext

by Gamefic on September 25, 2014

Graphics and sound have been goals in Gamefic ever since I began the project. This month I added graphics support through the new standard-multimedia library. The new web interface already supports it, and I plan to release a game that uses it soon.

This led me to another idea: parser-based games with a hypertext interface. Is it possible to make a pure point-and-click frontend for a traditional text adventure?

Gamefic uses HTML natively, so implementing hypertext commands is easy. The difficult part is determining when to display the links, and how.

For this experiment, I wrote a point-and-click library thatĀ supplements a game's output with links. The links fall into four categories: exits, objects, characters, and actions. Exits are known portals in the current room. Objects and characters comprise anything with which the player can interact. Actions are anything else that the player can currently do. The interface can determine how to display the commands based on category. Exits, for example, can be displayed as points on a compass.

Some of the rules I put in the library:

  • Always provide the current room's exits.
  • Always provide the inventory command.
  • When looking at a room, add links to look at all the objects and characters.
  • When looking at a portable entity, add a link to pick it up.
  • When looking at an item in your inventory, add a link to put it down.
  • When looking at an openable entity (i.e., a container or a door), add a link to open or close it.
  • When looking at a lockable entity, add a link to lock or unlock it.

Games can specify their own custom actions wherever necessary. A game like Deadline, for example, could add links to accuse or arrest characters when the player looks at them.

I think this feature will be especially useful for developing adventure games that work well on mobile devices. Everything could be done through clicks, but the game would still be more like traditional IF than CYOA.