Magazine: Ahoy! Issue No.: 54 Date: June 1988 Pages: 39-40 Transcribed by Patrick Kellum -------------------------- PROGRAMMING YOUR OWN TEXT GAMES Part I of III: Create a New World By Cleveland M. Blakemore Something incredible has happened to twentieth century civilization. Literature has come to life. What was once a passive medium has now become an interactive one. The art of reading has lent itself to genuine experience, breathing life into surreal worlds.    This miracle has occurred through the wonderful medium of the electronic computer, a device almost everyone in our culture now has access to. Due to the advent of a piece of software called the text adventure, the reader can become a part of the story itself. The reader is now the protagonist and determines the outcome of the book, choosing from a variety of climaxes and conclusions that the writer.programmer has prepared in advance.    The problem seems to be that while everyone wants to know how to write text adventures, there is an inadequate dissemination of the information required for programming them.The three-part series of articles beginning this month is written for average to advanced BASIC programmers who are interested in creating and playing full-length text games that they have designed, either for their own pleasure or the enjoyment of others. The three programs accompanying the articles in this series range from tiny miniadventures to sprawling epics.    Most of the books I have seen on text games frequently use a very simple collage of print statements and GOTOs to replace good programming logic. This is not practical for large projects, and is a poor way to learn programming.    Using the modular approach described in this series, you should be able to create and debug a full-length adventure game in about 30 to 40 hours of programming time. Later, you will find that it lends itself easily to expansion or modifications.    All text games have a simple structure, the same for any game: * Get the player's input * Analyze his input * Take the correct action * If the player has not won then begin again at step one.    Since the structure and algorithm for every program is identical, you can start work on a new game at any time by just loading in an old game and hacking away at the basic framework. THE IDEA MACHINE    "Where do you get all your ideas from?" is a question commonly asked of me as a programmer. I often feel as though I should ask in return, "How do you stop yor ideas from driving you crazy?!?"    Every human being on earth is a natural dynamo of creative energy. Learning how to tap this energy and translate it to a book, a canvas, or a computer's memory, is a skill that can be learned. It is far from being a gift of the gods, or innate. It is more a state of mind, an openness to your own dreaming soul.    If you are reading this magazine, you have demonstrated an active mind. Now you must learn to twist your mental imagery, your dreams, secret places, and fantasies, into concrete lines of BASIC code. THEMES    What interests you? Suspense stories? Sword and sorcery? Science fiction, science fact? Intrigue, horror, romance?    Belive it or not, all these themes are suitable for text adventures. All of them could probably be enjoyed by people of much wider or varied interests, if they were written in such a way as to convey the excitement of the author over the subject.    Colossal Caves is the grandfather of all text adventures. Written by Don Woods and Will Crowther at MIT on a SAIL PDP-10 mainframe back in the infancy of micros, it would prove to be the forerunner of everything from the Zork trilogy to currently popular games with far more advanced parsers.    The classic text game African Adventure, about a search through darkest Africa for Dr. Livingston, is a public domain adventure game that has delighted microcomputerists for years. It is available on the CompuServe network, as well as many other bulletin boards, and still manages to convey a sense of mystery and adventure years after its creation. Games like that are almost immortal. It will probably still be floating around 50 years from now.    These games have made their authors some money through the years. But I suspect most of them were not written for profit, but from a deep creative urge on the part of the programmers. They had envisioned a world populated by fantastic creatures, wizards, and menaces, and could not rest until they had seen it in a form others could appreciate and enjoy.    If you need ideas for text games, look around you. Books. Movies. Your own dreams, nightmares.    Tolkienesque fantasy is enjoying a great deal of popularity. Tales of wizards and warriors are powerful myth-archetypes that reside in the universal subconscious of mankind. They strike a clear bell in your primitive psyches, playing on the elemental race memories of all humans. Some contend that it's because these images fade in the minds of people as they grow older that they lose their power; it is in young people that they are most likely to stir the mind and excite the imagination.One fact is clear - few things are more fascinating than a computer game with castles, dungeons, ogres, and treasure.    Science fiction allows a great deal of room for originality. It is a medium in which almost anything can happen.Marooned spaceships and interstellar junkyards make good plot devices for text adventures. Aliens make terrific allies, or horrifying enemies.    Suspense and Mystery require the author to stick to more concrete rules for the storyline, but the result can be much more challenging and subtle. Deadly spies hunting the player, hidden time bombs, or mysteriously murdered diplomats make for anxiety-ridden games.    Horror stories about mansions with ghosts and concealed fortunes, or subways with creepy crawling "things"in the shadows, have a neat flavor of their own. Again, the programmer can let his imagination run wild. ONLY ONE WAY TO START...START!    The way to begin is to get three blank sheets of paper. Write the title and theme of the game at the top of Page 1.If it is simply too wierd to label, write "Fantasy" beneath the title. Underneath this, describe the goal of gameplay. This can be as simple as "Get plenty of money and get out" or "Return the Sceptre of Knossos to the Castle Gallstone and save the princess from the evil Serpent God."    Now write a few short paragraphs describing the world in detail. Write down all vital locations. Give them names.Visualize each one as clearly as possible. Make the game world small and modest, with preferably five to ten locations for your first game.    On Page 2, write down all obstacles that will hinder or prevent the player from winning the game. These are the obstacles in the path of game completion. They can be as simple as getting the correct key for the correct door, or as difficult as lowering a resvoir's water level enough so that you can cross over to the other side. On the same page, write a list of every object that the player can carry in this game, up to 12. Give each object a number.    On Page 3, draw a map of the world. Label all locations with a name and a number. Now decide what objects go in which rooms, and draw the appropriate arrows.    These are all the notes you need to make a full-fledged text adventure, from beginning to end. We'll elaborate on each page as we work on our game, but we'll do it on the computer where it counts, not on paper. Because this is mostly interested in the interactive use of BASIC as a programming medium, we'll keep the "dry computing" and "flowcharting" to a minimum.It's boring and futile, as you will undoubtedly make changes once you get on the machine.    Have patience, however. It's to take a little work to get that world in your mind to sit up and act right within the computer.    But it's also worth it.    You'll have until next month to refine that vision on those three sheets of paper into a perfectly conceptualized storyline, when we'll begin walking through the step-by-step procedure of creating the code to breath life into it.    To whet your taste buds and warm you up, Lost Dutchman's Mine is included in this issue. Type it in and enjoy it. It's simple, but don't worry if you can't understand it. Next month I'll demonstrate how I changed three pieces of paper, just like the ones you have, into a complete program. Also in Part II will be another program, slightly more advanced than this month's offering.The third and final installment of this series will offer a text adventure rivaling commercial programs in challenge and complexity.    Until then...dare to dream! It makes fools into great men, and great men into fools. SEE PROGRAM LISTING ON PAGE 80 EOF