An Adventure In Small Computer Game Simulation
IntentThis paper will cover the basic philosophy and structure of the data base for the Adventure Program.
What Is Adventure?Adventure is a copyrighted program designed to run on a small personal computer such as the Radio Shack TRS-80.
An Adventure consists of two parts: 1) the Adventure Program, and 2) the Adventure Data Base. Adventure is designed to allow the user to explore an imaginary world. The player travels from location to location while manipulating objects he finds there. In short, Adventure is a role playing simulation. The goal of an Adventure varies; for one it might be to discover treasures and another to perform a certain mission within a critical time limit.
AcknowledgementsTo my wife Alexis for her patience, to Ted Heeren, my "sounding board" and chief play tester, to Paul Sharland for some good ideas, to the TRS Computer Club of Orlando for some good sessions, to Ron Austin of the Little Computer Co., for some good ideas, and to Crowther & Woods for the inspiration.
Scott Adams, Stromberg-Carlson, P.O. Box 3435, Longwood, FL 32750.
The player communicates with the program through 2 word English sentences consisting of a verb and a noun. Some examples and their possible results:
Many commands could be entered in more than one way, such as:
A) RUN NORTH
B) LIGHT LAMP
These might do the same thing.
A sample scenario from Adventure 1 follows: (Human inputs are underlined):
What software makes up Adventure?For an adventure there are 3 parts:
Adventure is so written that by changing the data base an entirely new adventure is created. The adventure editor is used to create adventure data bases which are then implemented by the adventure interpreter. The adventure editor requires a TRS80 32K single disk system to run while a created adventure can run on TRS-80 Level-II 16K cassette system. (Usually with no memory left over!) The size of an adventure though is set when initially built with the editor. It is posslble for an adventure to be written that requires a 48K system!
Adventure Data BasesThe Adventure Data Base is made up of five tables: Commands, Vocabulary, ObJects, Rooms and Messages. These 5 tables and a few control words are all that is needed to define a complete Adventure.
VocabularyThe vocabulary table is broken in 2 parts: Verbs and Nouns. This allows the interpreter to run slightly faster than if the vocabulary was one long array.
In the vocabulary table is found all legal words for the Adventure. Synonyms are signified by an (*) asterisk in the first position following the main word. Example: 1) GO 2) *WALK 3) * RUN 4) EAT
Here we see Walk and Run are synonyms for Go. Wherever a vocabulary word is needed in other Adventure tables only the main word is allowed, the synonyms are only for the players input.
Certain positions are reserved in the verb and noun tables for key words. Other than that they may be in any order. Following are some key words and the positions expected: VERB: 0) AUTO 1) G 10) GET 18) DROP. NOUN: 0) ANY 1) NORTH 2) SOUTH 3) EAST 4) WEST 5) UP 6) DOWN
When the Adventure interpreter runs, it will convert the two words that the player enters into two numbers representing the respective offsets in the verb and noun tables.
RoomsThe rooms table contains all information for each location a player may find himself in. It is broken into two parts: Description and Directions. Room #O is a "Holding" room for objects. The player never ends up here.
The Description Table contains the description of a room which will be preceded by a "I'm in a" when it's printed out or optionally if the first character is an asterisk it will be output without this. Example: DESCRIPTION Greyroom Swamp *I'm on a Branch WHAT'S OUTPUT I'm in a Grey room I'm in a swamp I'm on a branch. The Direction Table contains one entry for each of the 6 possible directions. (see Vocabulary entries 1-6). Each entry consists of a room number Where this direction leads to or a zero if there's no exit via this direction. When the description ot the room is output, the visible (all non-zero) directions are also output. Rooms may also be entered or left without benefit of this table (by using a Command table entry) Once an entry is built into the room table, it cannot change at any time while the Adventure is being played
Example of a room:
Objects (or Items)This table contains all information on the various objects that wlll be found by the player. This table is the only one in the Data Base that is modified as the Adventure progresses. The objects table is broken into 2 main parts: room numbers and description.
The room numbers part contains the room where the object currently is. A room number of 0 says the item is currently not anywhere. And a room number of -1 says the player is carrying the item. The room numbers are what gets modified as items are moved around in the adventure.
The description part contains the description of the item followed optionally by the take/drop control.
The take/drop control is a vocabulary enclosed in slashes (/) and signifies the vocabulary word which is used to automatically take or drop this item. This will be further explained in thc Command Table section.
Example of some objects: ROOM 0) -1 1) o 2) 5 3) 5 4) 0 DESCRIPTION Rusty Axe/ Axe/, Pencil/pen/, Large Tree, Empty Bottle, Bottle of Water.
In the above example, the axe is being carriod, and the large tree and empty bottle are in room 5. The rusty axe can be plcked up and dropped by saying GET AXE or DROP AXE. The same is true of the pencil. The bottles can only be manipulated if there are specific commands for them in the Command Table. Note that the bottle of water is in no room, possibly waiting to exchange room with the empty bottle on the player command: GET WATER (see Command Table explanation for further discussion). If the player said GET TREE and there has no entry for it in the Command Table then the message "It is beyond my power to do that" would be output automatically by the interpreter.
MessagesThe message table contains all adventure messages to be output. The message numbers range from 1 to 51 and 102 to 149. Some examples: 1) Nothing Happens 2) The box exploded 3) I see no tree here 4) The dragon attacked me!
CommandsThe Adventure Table contains one entry for each valid command a player may give. The table consists of two major sections: Auto Commands and Player Commands. Each command entry is broken into 3 parts: Vocabulary, Logic, Action.
The following is a typical command breakdown: The Vocabulary part consists of the verb noun which matches the players entry, such as LIGHT LAMP or CLIMB TREE if the noun is "any" then any noun is allowed. Example. A command CHOP ANY would take a players input of CHOP or CHOP TREE or CHOP HOUSE and still be valid. Once the interpreter matches the verb and noun parts of a command to the player input, the logic section is then activated.
The logic part of a command consists of from 0 to 5 conditions which must be satisfied before the action section will be executed. If there are O entries here, the command is always valid; otherwise, all the logic conditions must be met. Each logic has a secondary number associated with it depending on the logic. A short list of logics and examples follow:
If any logic Item proves false the interpreter continues scanning starting with the next command in the Command table.
The Action Section consists of from 1 to 4 actions which will be performed if and only if the vocabulary matches the players entry and all logic conditions are true. Note that to printout a message its number needs only to be entered as an action. Some actions require an item or two to work on. In these cases the logic list is scanned for the next item with logic control 0.
A short list of some Actions:
Example of Typical Command Table
ASSUME FOLLOWING TABLE SETUP:
(Player commands and what happens)
LOOK TREE 1 ) Command Table is searched 2) Match on
Command #40 is found 3) Action Item 10 is performed.
Message #10 is output "The tree is large". 4) Auto mode
entered (to be explained later)
The Object Table will now look like this:
(Using the new obJect table)
GET WATER 1) Command Table is searched 2) Match found on command #42 3) Logic Item 2,1 is false! Water is not in current room! 4) Command Table search continues 5) Match found on command #44 6) Logic Item 12,2 is true! Empty bottle is not in room or being carried. 7) Logic Item 2,1 is false! Water is not in current room. 8) Command Table search continues. 9) End of Command Table found 10) MSG - "I can't do that yet" is automatically output 11) Auto mode entered.
Assume following Object Table and person in room 1.
GET WATER 1 ) Command Table is searched 2) Match on command #42 is found 3) Logig 2,1 is true. There is water in current room (room #1). 4) Logic 3,2 is false. Empty bottle is not being carried or in room #1. 5) Command Table search continues 6) Match on command #44 is found 7) Logic 12,2 is true. Empty bottle is not in room or being carried. 8) Logic 2,1 is true. There is water in current room (room #1) 9) Action 12 is performed. Message #12 "no, I can't do that" is output. 10) Action 11 is performed . Message #11 "I've no container" is output. 11) Auto mode entered.
Mentioned earlier was the auto phase of the Command Table. The commands are built the same as in the player phase with the following differences: 1) Verb is "AUTO" 2) Noun is a number from 1 to 100 3) Unlike player phase all auto commands are scanned. In the player phase only 1 command at most is executed then player phase ends. 4) Instead of matching on players input, a match is made of a random number from 1 to 100. Therefore, a command AUTO 80 has an 80% chance of being activated during the AUTO phase. 5) The AUTO phase is always executed immediately following the player phase!
Note that by using the special flags and AUTO 100 commands any player command can be extended from the limit of only 4 actions. The AUTO commands are always found at the beginning of the Command Table and end on the first non-AUTO entry.
Example of Command Chaining usinn AUTO
One other special phase can be entered. This is the AUTO drop/get phase. If the player enters a get or drop and there is no match in the Command Table for The the Objects Table is scanned to find the requested object. Example: If in the Command Table you have:
42) Get mud with logics and actions
and in the Objects Table you have:
MUD/MUD/ HAY SEEDS/SEEDS/
Following will happen:
GET MUD if command table is true it is executed otherwise "I can't do that yet" is output. DRPP MUD - AUTO Drop is activated. Object is dropped. GET HAY - MSG "I don't understand your command" is output (i.e., hay cannot be picked up this way!) DROP HAY If Command Table is true, it is executed else message "I can't do that yet" is output. GET SEEDS - AUTO Get is activated. Item is picked up. DROP SEEDS - AUTO Drop is activated. Item is dropped.
The AUTO Drop feature basically means that an item can be picked up or dropped by the player by including "/NAME/" at end of the objects description, without having to enter a Get or Take command in the Command Table tor each item. When the AUTO Drop/Get is activated it may also output message, such as "Item is not here" or "Item is not being carried."
Control WordsThe following are some control words found in an Adventure:
SPECIAL FLAGS: There are 15 special flags (0-14) which may be set or reset by Command Action. Initially all are reset.
DARK FLAG: When this flag is set, then it is dark in the Adventure and unless object #9 is in the current room or being carried then it is too dark to see. Also if players move while it is dark and goes in an invalid direction he may fall and break his neck! (Object #9 is always an artificial light source!)
LIGHT BURNING: # of turns that a light source (Object #9) may burn before going out. The light is considered to be burning if person is carrying Object #9.
SummaryThe Adventure Data Base is flexible, allowing a wide variety of Adventures to be written. From magic to outer space to the old west almost any scenario can be set up *NOTE that the Adventure interpreter and Data Bases are currently available through national distributors (such as Creative Computing and Softside among others). Adventure may currently be purchased for the following computers: TRS/80, PET, CP/M. and Apple.
Adenture seems to have taken the computer
world by storm. I first saw it in Toronto at the
Canadian Computer Conference in 1977 running in
Fortran on a prime computer. Tracking back I found it
was written originally by Will Crowther and greatly
expanded by Don Woods. But it goes back even
further to a computerized version of Dungeons and
Dragons which originated at Bolt, Beranek, and
Newman, a consulting firm in Cambridge, MA.
Dungeons and Dragons as a serious fantasy board
game written by Gary Gygax and Dave Arneson in
1974 and published by TSR Hobbies, Inc., Lake
21st January 1999: aaiscgs.htm