A Basic Adventure Generator Program, by Wes Crump, for the TRS80 M4
====================================================================
This program will help you write a basic adventure game.  There are
two parts ADVGEN4/BAS (the generator) and ADVBEGIN/TXT (common code used
in all the programs). The finished product will be a basic program that
you can load and play by itself.
You must first map out your adventure and decide what objects you want and
which verbs you want the resulting program to respond to.
Let's walk through a typical interaction with the generator.
First you will be asked for the filename of your adventure program.
Then you begin the 
          Room Input...
The program will prompt you to enter a short and a long description
for each room.  If you want to have several rooms with the same
description (i.e a maze of passages all alike) you may enter the number
of the identical room at the appropriate prompt.  When you have entered all
the locations in your game enter a "."(period) at the short description prompt.
If you wish to stop and rest, entering ".."(period period) and the progress so
far will be saved to a file >>filename/sav. To continue latter just enter
the same filename when run the program again and the program will go to
where you left off.
The next section is the
          Object Input...
This is where you enter all the things you want the player to be able
to do things to in the adventure. Doors, panels, grates, lamps, keys, buttons
etc. are some examples of objects.  Each object has a name and a long
description.  The name is used to decode the player's input.  The first five
characters are significant.  The description is what is printed in the game
to decribe the object.  Entering a "." at the object name ends the object
input cycle.  Entering ".." lets you save what you have so far.
If you want to have multiple names for the same object you can enter synonyms.
You can also have the same name for different objects for example you can have
several doors with the same name "door".  The game will try to resolve any
ambiguous inputs by looking for the object that is closest to the player.
Be careful not to put two of the objects of the same name in the same place
if you use this technique! The second object with the same name might become
"untouchable"! You can think of this as two cases: 1) one object with several
names for it >old brass lamp--lamp,light,lantern,brass (synonyms) and
2)several different objects with one name for them >door--a door in room 1
and a door in room 2 and in room 3 etc.  The door the player is talking about
is the one he can "see" when he is in room 1 or 2 or 3.
If this sound confusing --- it is, try experimenting with a small game to get
the feel of it.
Next is the 
         Verb Input...
All the words that cause actions are placed here. I have already provided
some verbs for you...The directions and a GO,ENTER,EXIT,SCORE,QUIT,INVEN,
LOOK,SAVE,and RESTORE verb are already given. Anything else you want to do
is up to you.  Synonyms are allowed here as well.  Entering "." ends verb
input. Entering ".." saves your progress so far.
After the verbs comes the
        Room Direction...
You will be prompted for each room that you entered earlier.  This section
lets you connect the rooms to one another.  Each room is connected in
the 4 major compass directions, the 4 semi-major directions (sw,nw,se,ne),
up, down, and a default direction.  The default is the room that the player
will go to if he enters the verb GO,ENTER,EXIT with no direction specified.
For example if room 1 leads to room 23 to the east, room 12 the the southwest
and defaults to the southwest, you would enter "e23,sw12,df12"
The program will automatically update the adjoining rooms such that if room 1
leads to room 23 in the east, then room 23 will be updated to lead to room 1
to the west.  If you want to overide the automatic feature, begin your input
with an "*".  This will allow you to screw up the directions and construct
confusing mazes and passages to aggravate and frustrate the bold adventurer.
For each room, you can allow for natural lighting (make the player use up his
light source in underground areas)
When all the rooms have been connected and lighted, you have the choice of
changing any of the rooms.  You may stop here or continue to the
           Place Objects...
Here you are asked to place the objects given earlier.  Room 0 is a storage
closet to keep things that will jump out at the player during the game.
Objects all have weights.  This is how the program decides if the player can
carry the object or not.  To make something immovable enter a weight of 999.
I need to talk a bit about obstacles at this point.  Obstacles are objects
that prevent movement of the player. Some examples are doors, panels, grates
and monsters.  Obstacles come in two flavors one way and two way.  One way
obstacles allow passage in one direction but not in the opposite direction.
A giant killer grasshopper might let the player enter a room but never leave!
A door is a two way obstacle. It blocks travel from both directions.
If you make an object into an obstacle, you will need to answer some questions
about it.  Which direction it is blocking.  What message is printed when the
player tries to go through it.  What message is given when he fails to remove the obstacle and what is printed when he is successful.  Experiment with this! It
can add some fun to the game!
Objects can also be treasures to increase the player's score when he finds them
When all objects have been placed, given weight and made obstacles or treasures,the generator will give you a print of what you have done so far.
You get a list of rooms, objects, obstacles and a map of the lay out of rooms.
Now comes the hard part
          The Verb Handlers(if-then generator)...
This is where you take care of what happens when the players gives a command.
The players input is broken into 3 parts the verb the noun and the direct
object.  For example OPEN the DOOR with the KEY,where OPEN is the verb DOOR
is the noun and KEY is the direct object. You will construct the conditions
and actions using these parts of speech.   First you select a verb to work on.
 If you want a condition answer "y" and
you will be given a menu to select on which condition(s) the action will be
taken you may AND or OR conditions before you add the THEN part of the if
statement. To get a NOT, just enter a "-" before the number of the menu
selection.  For example if you want something to happen if the player does
NOT have a particular object, enter a "-1" at the menu and the object number
at the prompt.  Let me stress that the program will let you do crazy things.
Make sure your logic is correct.  You can do just about anything using the
selections from the condition menu and the action menu.  You can operate on
flags and counters.  I suggest playing with the different options to see
how best to make the desired things happen in your game.
When you have completed all the verbs enter a negative value for the verb
number.  You will be prompted for the starting room,the light source, the home
room(score treasures), and the maximum weight the player can carry.
I have tried to forsee all possible things that a adventure program might
 want to do.  I hope I have succeeded without making the operation of
 the program too difficult.
HAPPY ADVENTURE GENERATING!!!
I'm sure there are improvements that could be made, (no program is ever
really finished).
If you have any problems/questions/additions to the program or suggestions
of how to improve the documentation please let me know.
 I can be reached at:
Wes Crump
401 University Oaks Apt. 15 B
College Station, TX 77840
phone # (409) 693-2145
                                             