Home Open Source Articles Videos AI Newsletter Contact

Adventure established the architecture of all fantasy computer games to follow. It was the first to create structures representing places and items and characters and to let the player explore and interact with the environment.

It was as totally addictive as today's wonderous graphical games that have built on the that very same architecture.

To learn more about the granddaddy of all such games, see: Colossal Cave Adventure and/or google Adventure and Willie Crowther.

Preface


I was working for an aerospace company in the 1970s when someone got a copy of the original Adventure game and installed it on our mainframe computer. For the next month my lunch hours, evenings and weekends, as well as normal work hours, were consumed with fighting the fierce green dragon and escaping from the twisty little passages. Finally, with a few hints about the plover's egg and dynamite, I had proudly earned all the points in the game.

My elation turned to terror as I realized it was time for my performance review. My boss was a stern man, who was more comfortable with machines than with people. He opened up a large computer printout containing a log of the hours each of his programmers spent on the mainframe computer. He said he noticed that recently I had been working evenings and weekends and that he admired that type of dedication in his employees. He gave me the maximum raise and told me to keep up the good work.

Ever since I've had a warm spot in my heart for adventure games. Years later, when I got my first home computer, I immediately started to write my own adventure game in 'C'. First came the tools, a simple dynamic database to keep track of the game state and pattern matching functions to search that database. Then came a natural language parser for the front end. Functions implemented the various rules of the game.

At around the same time I joined the Boston Computer Society and attended a lecture of the newly formed Artificial Intelligence group. The lecture was about Prolog. I was amazed--here was a language that included all of the tools needed for building adventure games and more.

It had a much richer dynamic database and more powerful pattern matcher than the one I had written, plus its syntax was rules, which are much more natural for coding the specification of the game. It had a built-in search engine and, to top it all off, had tools for natural language processing.

I learned Prolog from the classic Clocksin and Mellish text and started writing adventure games anew.

I went on to use Prolog for a number of expert system applications at my then current job, including a mainframe database performance tuning system and installation expert. This got others interested in the language and I began teaching it as well.

While the applications we were using Prolog for were serious and performed a key role in improving technical support for the growing company, I still found the adventure game to be an excellent showcase for teaching the language.

This book is the result of that work. It takes a pragmatic, rather than theoretical, approach to the language and is designed for programmers interested in adding this powerful language to their bag of tools.

I offer my thanks to Will Crowther and Don Woods for writing the first (and in my opinion still the best) adventure game and to the Boston Computer Society for testing the ideas in the book. Thanks also to Ray Reeves, who speaks fluent Prolog, and Nancy Wilson, who speaks fluent English, for their careful reading of the text.

Dennis Merritt
Stow, Massachusetts, April 1996