GROW An adventure game that can grow The game “GROW” first made its appearence back in the late 1970s. I first encountered it in the 1980s, in the form of a photocopied listing from Creative Computing magazine. It is an “extensible adventure” that, borrowing ideas from the games “Adventure” and “Animal”, can grow. Like the traditional adventure games, such as the classic Crowher game “Colossal Caves”, GROW takes you from scene to scene, updating your score when required, giving you some task to solve, and moving on in response to your typed instructions. Information for each scene is recorded in its own data file, which, in this implementation, has the filename extention “.GRW”. Perhaps the word “node” is better, as each scene can be represented by more than one data file. Like the game “Animal”, which is a good introduction to data structures and linked lists for programming classes, it is able to extend its repetoire when it encounters a scene that no-one has visited before. One of the advantages of using a system such as GROW is that not only can it be used as a fully customizable game, it can also be used as a CAI (Computer Aided Instruction) tool. Getting Started Playing GROW is fairly straightforward. Just start the program, and, letting the computer act as your eyes and ears, type in your instructions. The computer will respond to what you type in. This implementation comes with simple instructions that you can display when you start the program, and a bare-bones game that you discard if you want. Node Structure The starting point for all games is a “node” called “INIT”. Have a look at the file INIT.GRW. It is a simple text file, which contains an introduction to the game which is displayed on the screen when the game begins. Following the introduction is a list of KEYWORDS. This is a list of words that GROW can respond to. You will notice that in INIT there is a keyword “init”, followed by a word “intro”. When GROW starts, it behaves as if you had typed in the word “init” at the keyword. Following the words “init” and “intro” is a list of ACTIONS to be followed whenever you are at node INIT and either “init” or “intro” is typed in. The thing to notice at this point is that any particular group of keywords is treated as a list of synonyms and that fairly simple pattern matching is used. In the supplied INIT.GRW, if either “init” or “intro” is typed in, the following actions are performed: PYou can talk about just about anything PIf I don't know about something, Ptry to EXTEND my repertoire. The “P” at the start of the line indicates that the text following the P is to be displayed on the screen. Following the actions is another group of keywords: starship kirk mccoy spock and another group of actions: PBeam me up, PScotty +2 As before, the “P” signals that something is to be displayed. The new feature is the “+2”. This means that your score is increased by 2. You can also use “-” to reduce the player's score. Now look further down the file. If the player types in “enterprise”, “ncc1701” or “NCC1701”, then the action “GSTARSHIP” is used. “G” means “GO TO” and transfers the player to a new node. GROW looks for a new file, STARSHIP.GRW. If this file exists, it is loaded up and the description is displayed. However, if STARSHIP doesn't exist, this is one place where things get interesting. The player is asked to describe the problem to solve at the starship, and GROW creates a new node! Type in a scene description, one line at a time. When you have finished entering your description, just press Enter As you might have guessed, the first letter on each line in the “actions” section of the data file indicates how the game is to respond to a keyword it recognises. Valid actions are: P - Print (display) something on the screen G - Go to a new scene. It does not need to have been created (yet) Q - Quit (leave) the game + - increase the player's score - - decrease the player's score X - eXtend the game's repetoire of responses for the current scene/ Node DEFAULT If GROW can't find a keyword to respond to in the current node, it consults node DEFAULT. This is probably the best place to have the EXTEND command, because you might not want to have a CAI tutorial altered too much, if at all. Although it's not normally used, it's a good idea to include a description in DEFAULT.GRW, just in case some misguided soul includes GDEFAULT in a scene they have extended. Damaged Nodes After GROW has been used for some time, it is possible that the data files have been damaged. A utility FIXGRW.EXE is included to help repair the damage. It accpes two paramaters, a file name and an optional parameter /C, which inserts assembler-style comments to help you identify which blocks of data will be recognised as keywords and actions. Run it with the /C paramater, then edit the file with your favourite text editor, and rerun FIXGRW without the /C