Adventure Book

version 1/110101 by Edward Griffiths

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter One -- Parts of an Adventure Book

    [The basic unit of fiction in an Adventure Book is the page. Gameplay consists mostly of printing the current page and allowing the player to select one of its choices. Some pages are called dead ends. When the game reaches a dead end, it returns to the previous page and allows the player to select a different choice. This allows us to create options like "Examine the cake", which would take us to a page that prints the cake's description, then returns us to our previous menu to try something else. A "special" page is ignored by debugging reports, and should really only be used by "meta-pages", such as The Last Page.]

    A page is a kind of thing. The initial appearance is usually "". A page can be a dead end. A page is usually not a dead end. A page can be special. A page is usually not special.

    [Jon Ingold's original work supported a player inventory, represented by a series of flags. By using so-called "invisible items", the game could also keep track of various information relating to the game state. In this system, we'll use flags and inventory items in mostly the same way, but we'll distinguish them by name to make it easier for the author (or anyone reading the code) to differentiate.]

    [As a curious side effect of the way Jon Ingold handled inventory items, it was valid to use the "use inventory item" option to create a sort of "magic word" that the player could type in a specific situation if the inventory item required was never otherwise referred to. The effect was demonstrated in the game Aliens!. I've decided to allow this behavior as well.]

    A flag is a kind of thing. A flag can be on or off. A flag is usually off. An inventory item is a kind of flag. A magic word is a kind of inventory item.

    [Choices are very simple. When the player selects one, he is taken to the destination page. A choice may not be available to the player depending on its relationship to the flags in the game, as explored in the next chapter. A choice that's only available when you type the name of an inventory item is called a use.]

    A choice is a kind of thing. A use is a kind of choice.