Article View: rec.games.programmer
Article #1127Re: So... what are you all doing?
From: myers
Date: Fri, 09 Oct 1992 22:50
Date: Fri, 09 Oct 1992 22:50
121 lines
8199 bytes
8199 bytes
Hello All, This is my first post to this group. I am a blind programmer at a small WV college. I have always liked the Infocom games because they allowed me to use my imagination to adventure instead of relying upon special hand-eye coordination. But my wife likes the Searah games due to the good graphics and we both like their music. A few years ago I begun writing my first adventure game (Infocom style) with no books or other help in programming it. I decided to make the entire program as data driven as posible so that I could make changes without recoding the program. I also thought that this would help me in making future games. I got rooms described first and made a very simple program which simply got directional commands from the player and used the info in the room "GOTO" file to move a pointer to point to each new room description in the room description file. This allowed me to create a landscape and "walk around". This was a good beginning so I then decided to add objects. Each object had associated data to describe which room it was in, its' size and weight, a general noun for the object and a specific phrase describing the object. The object's room number refered to the room in which the object was currently found, 0 if the player was carrying the object, negative numbers if the object was inside the object with that negative number, etc. I found that creating objects suddenly made the programming much more complex. I had to add a better command parser and needed several more verb routines. At one point I discovered that the player could pick up the heavy stone bench and put it into his small brown sack and thus carry it anywhere he liked. So I had to add size and weight limitations to the objects which could carry other objects inside them. I added a flag for objects which allowed them to be attatched to other objects or to the particular room. I also added a flag to say that an object was invisible. The objects made the game more interesting. I found that it took to long to get around so I added to my command parser a feature that if it found a comma (,) it would stop and process the command up to this point and then proceed to act upon the next part of the command. This allowed one to type for an example: NE, W, UP, GET BOTTLE, JUMP AND HAVE ALL THESE ACTIONS PROCESSED SEQUENCIALLY IN MORE OR LESS BATCH MODE. I also added GET ALL and DROP ALL to allow for less time consuming gets and drops. I as a blind person did not enjoy hearing the long descriptions of each room listed especially since I already knew what they said so I decided to add the BRIEF and VERBOSE commands. I used a character string where each character represented 8 flag bits for wheather or not the player had visited that room. So for a game of 80 rooms I needed 10 characters which I preset to CHR$(0) and set flag bits for each new room he/she visited. By reading these flag bits the program knew the status of the room when printing its' description. Next I decided to add messages. Each message line pointed to the next message line until it finally pointed to 0 which meant the message was done. I played around with types of messages and created rotating and random messages as additional types. Each of these types contained a list of message pointers to upto 18 messages. For a rotating message the messages would print in order down the list on consecutive calls until the last message on the list was printed. Then the rotating message on the next call would either start the list over or from then on print just the last message on the list. The random message would choose a message from the list at random for each call not repeating any message until all messages had been seen. Then the flags would be cleared and the next call to print the random message would randomly select a message from the entire list again. These messages would be used for printing as the person walks between rooms or to say " You cannot go that way". For example I could create a random message containing 18 message pointers to describe why a person cannot go through a stone wall. Then I could have this single message printed for every occurance where the player's way was blocked by a stone wall and the person would not always get the same message when he/she tried to walk through a stone wall in a particular room. I figured they might also be useful for battles with monsters. The rotating messages could be used like this: You try to enter a castle and a guard throws you out. The next time you try to enter the castle the guard not only throws you out but locks the gate. The third time you try to enter the castle the message informs you that the gate is locked. From then on in the game the message always informs you that the gate is locked. It would allow a bit more reality to the game since the messages can vary a bit. Next I added doors. Each door had to have an associated key that would open it if it was a door type which could lock. Some doors were just gates which never locked but were either open or closed. They could have a random number select wheather they would suddenly blow shut though. If the number was low the gate would randomly shut every 3 to 4 turns and be somewhat difficult to pass. Then there was the doors which were locked or opened. When one unlocked these doors they would spring open. The third door type was the tipical door which could have statuses of locked, closed, or open. For the locking doors a particular key would fit and all others wouldn't. If the person typed "Unlock the iron door with the key" the program would search the person's inventory for any keys. If only 1 key was found then the program would assume that key. If more than 1 key was found it would prompt "Which key, the brass key or the shiny black key?" The person could have entered "Unlock the door with the black key" and avoided the prompting. This took some careful parsing. When I was starting to work on programming the game for monsters I ran into a bit of trouble. The monster needed to be limited to certain rooms so I had to create room flags for each room for wheather the particular monster was allowed to follow one there. The monster I created was a bear which tended to kill the player off too often. Anyhow, about this time I sold my old K-Pro computer as I had a new computer and lost the program in the move. Recently I discovered the program several levels down in the directory tree on my new computer. I decided to work on the program some more. I am on the GARDENS mailing list so I decided to provide them with a virtual garden tour of our flower and vegetable garden. In fact I decided to give them a tour of our entire yard as a game. They can move anywhere in the yard and surrounding lands freely except for inside our house. They must pick up several vegetables and flowers, find the hiden recipe card, get back home with all these items, etc. It would not be a particularly difficult game to write but it would be the first one I had completed. I have now written about 800 lines of room descriptions, connected the 90 rooms, and begun to write messages. After that I still need to place objects, doors, and perhaps create a monster just for fun. So i still have a ways to go on this game. If anyone out there still enjoys writing Infocom style games or has some advice or experience to offer or would like to help out, please write me or post here. Roger Internet address: MYERS@AB.WVNET.EDU Mailing address: Roger Myers Route 3 Box 269-D Philippi, WV 26416
Technical Details
Message-ID:
<1992Oct9.175056.553@ab.wvnet.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!wupost!darwin.sura.net!haven.umd.edu!cs.wvu.wvnet.edu!wvnvms.wvnet.edu!ab.wvnet.edu!myersReferences:
<80761@ut-emx.uucp> <80763@ut-emx.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!wupost!darwin.sura.net!haven.umd.edu!cs.wvu.wvnet.edu!wvnvms.wvnet.edu!ab.wvnet.edu!myers From: myers@ab.wvnet.edu Newsgroups: rec.games.programmer Subject: Re: So... what are you all doing? Message-ID: <1992Oct9.175056.553@ab.wvnet.edu> Date: 9 Oct 92 22:50:56 GMT References: <80761@ut-emx.uucp> <80763@ut-emx.uucp> Organization: Alderson-Broaddus College Lines: 121