About Interactive Fiction
Interactive fiction is one of the oldest forms of computer game, and has grown as a medium to include many interactive stories and experiences that cannot exactly be called games at all.
A new medium of writing, 1976-
Interactive fiction is thirty years old. Though there were precursors, it really began with the original adventure game of Crowther and Woods, a simulated exploration of a network of caves, stocked with treasures and hazards both realistic (expiring lamp batteries) and fantastical (a dragon perched on a carpet). With no graphics of any kind, the game described the situation in which "you" find yourself, and then asked what you wanted to do: and so the story elaborated in a long dialogue.
Such textual explorations created a popular and highly commercial genre of computer game in the 1980s, and while much of the market consisted of derivative works now forgotten, a number of design houses pushed the format into a cultish new art-form: Melbourne House, Level 9, and above all Infocom, Inc., whose three dozen works were as influential to IF as the classic Tintin albums were in shaping the graphic novel of today.
Strictly textual IF disappeared from the commercial marketplace around 1990. Today's games console franchises, like Prince of Persia or Tomb Raider, may be deeply rooted in 1970s adventures, but they could not really be called dialogues. Yet that apparent abandonment turned out to be a beginning, not an end. Around 1992, the growing Internet allowed IF enthusiasts to come together, and to develop tools to create their own works - something which contemporary home computers were only just powerful enough to do. Among these tools was Inform, which in its successive versions has been used continuously since 1993.
When a new medium comes along, we have to invent new words to go with it. Radio has "listeners" (not "hearers"); telephones have "callers"; when the BBC opened its first television service, a committee decided on "viewers". (Even though we say "to watch TV", we don't talk about "watchers" or "the watching figures".) With IF, we talk about "players", and "playing", not "readers". No surprise, because the first decade's worth of IF consisted almost entirely of games. But today's IF can be as far from those old cave-crawling games as abstract art is from an Indiana Jones movie. So when we talk about "players" and "games" on this website, we really do mean something much broader.
This is the barest sketch of a lively corner of cultural history. To find out more, try the excellent Wikipedia entry on IF.
How IF is written
Will Crowther's original draft of the first Adventure game, sometimes called Colossal Cave after one region of the Kentucky cave system it simulated, was written in FORTRAN. This historic code was lost for almost thirty years, but was at last found on Stanford backup tapes used by Don Woods in November 1977. Here's a typical passage:
C DRINK 5504 IF((IPLACE(WATER).NE.J.AND.IPLACE(WATER).NE.-1) 1 .OR.PROP(WATER).NE.0.OR.JOBJ.NE.WATER) GOTO 5200 PROP(WATER)=1 JSPK=74 GOTO 5200
FORTRAN is much mocked nowadays, but it was far more legible than the machine-level code it replaced, and you can at least get a sense of what Crowther was doing here - it's to do with drinking water from a bottle.
Infocom's games of 1979-88 were written using ZIL, essentially a form of LISP. Here's the cellar from Zork I, for instance:
<ROOM CELLAR (LOC ROOMS) (DESC "Cellar") (NORTH TO TROLL-ROOM) (SOUTH TO EAST-OF-CHASM) (UP TO LIVING-ROOM IF TRAP-DOOR IS OPEN) (WEST SORRY "You try to ascend the ramp, but it is impossible, and you slide back down.") (ACTION CELLAR-FCN) (FLAGS RLANDBIT) (VALUE 25) (GLOBAL TRAP-DOOR SLIDE STAIRS)>
IF of the 1990s was mainly written with C-like languages, with TADS 2 and Inform 6 perhaps being preeminent. TADS 3, a very sophisticated development, looks a little like this:
bridgeEntry: Room 'Bridge Lab Entryway' 'the Bridge entryway' 'hall' "This entry hall reflects the different sense of proportion architects had in the 1920's: it's a bit too narrow and a bit too tall to the modern eye. At the south end of the hall, stairs lead up and down, and a doorway at the north end leads outside. A display case is set into the east wall. " vocabWords = 'bridge lab laboratory entry entryway/hall' north = millikanPond out asExit(north) up = beStairsUp down = beStairsDown roomParts = (inherited() - defaultEastWall) ; + ExitPortal 'doorway' 'doorway' "The doorway leads outside to the north. " ;
From Return to Ditch Day, by Mike Roberts.
It's really not possible to give any proper picture of any of these styles of coding with just one excerpt, but we wanted to mention TADS 3 especially. Inform and TADS diverged in their approach to IF-writing in the 2000s, and that gives today's IF writers a choice - indeed, some leading figures use both systems, and questions like "which is better?" aren't useful.
For more on TADS, check out: http://www.tads.org/