|
16K Cassette/24K Disk
by Brian Moriarty
Adventure is an entertainment ideally suited to the home computer. No arcade game can offer the logical challenge and intellectual involvement of a good adventure program.
Unfortunately, most of the adventures available for the ATARI require more than 16K of memory to run. This prevents many owners of the Atari 400 System from enjoying the excitement of adventure. And very few text adventures take advantage of the ATARI's unique hardware capabilities to produce clear, easy-to-read displays.
A.N.A.L.O.G.'s Adventure in the 5th Dimension addresses both of these problems. It's a beginner's-level text adventure with all the features you'd expect in a commercial product - a large vocabulary, blinking cursor, independent scrolling window and the ability to save and load games.
Don't be fooled by the fact that Adventure in the 5th Dimension is written in ATARI BASIC. The program uses machine-language subroutines to give you speed-performance that rivals even the most expensive commercial adventures. Best of all, the whole thing will fit (just barely) in a 16K cassette-based system.
Few of our national treasures are more secure than the original Declaration of Independence. It's kept at the Library of Congress in a closely guarded display case, sealed in an atmosphere of inert gas to preserve its integrity. The entire display can be retracted deep into the earth at the touch of a button. Stored in this underground vault, the Declaration is capable of surviving the most viscious enemy assault, including a thermonuclear attack.
One afternoon, as a gaggle of tourists stood admiring the priceless document, a shining door on light appeared over the display case. The crowd watched in helpless amazement as alien beings reached their 5-dimensional fingers through the bulletproof glass, snatched the Declaration and vanished without a trace!
You are a top-notch private investigator, hired by the government to retrieve the Declaration. You must search the city of Washington for clues, find a way into the alien universe, locate the Declaration and return it to the police station.
In your search, you will encounter weird technologies and multi-dimensional terrors never before seen. It takes skill and insight to outwit the aliens - and plenty of patience to navigate the streets of Washington!
You will notice that our source listing for The 5th Dimension is unencoded; that is, the code has not been scrambled to prevent you from seeing possible clues. We decided not to scramble our listing because encoded programs are very hard to type, and they make it nearly impossible to learn how the program works.
It is VERY IMPORTANT that you type each line of the program EXACTLY as you see it printed. Include all of the spaces and control characters; yes, even the REM statements! Save every few lines of new code in case your cat pulls out the power cord. Be especially careful with the DATA statements at the end of the program. And don’t try to RUN anything until you have used D:CHECK or C:CHECK to guarantee the accuracy of your work.
After your copy of The 5th Dimension has passed the CHECK routine without errors, SAVE a perfect copy into a disk or tape. Now you can type RUN. The title screen will appear along with the message“Initializing.”After about five seconds, you’ll see the following prompt:
Press START to being new game.
Press OPTION to restore old game.
Press the START key. Your screen should now look like this:
The screen is divided into five imaginary text areas or “windows.” The black response window at the bottom accepts commands from the user, and displays descriptions of objects and the results of your actions. A blinking cursor in the response window indicates that the program is waiting for new commands.
The location window at the top of the screen gives you a brief description of your immediate surroundings. Underneath it is the compass window, which indicates all of the possible exits from that location.
The objects window shows a list of all objects visible at the current location. The bottom of the blue screen area is the inventory window, which lists whatever items you may be carrying.
Like most text adventures, The 5th Dimension understands two-word sentences in the form VERB-(space)-NOUN. Try typing the sentence TAKE PAPER on the starting screen. The “Morning paper” will vanish from the objects window and reappear in your inventory window.
You can interact with objects on the screen just like you can in real life. Watch the response window as you type the sentences EXAMINE PAPER and READ PAPER.When you’re done, the sentence DROP PAPER will return it to the object window.
Part of the fun of adventuring is finding out which verbs and nouns the program will understand. If you type an illegal or misspelled word, you’ll see the message “I don’t understand - try again” in the response window.
The 5th Dimension also understands a limited number of single-character
commands. These are used to control your movement, and to perform other special
functions.
MOVEMENT COMMANDS:
N - North S - South E - East W - West
U - Up D - Down
OTHER COMMANDS:
I - Inventory H - Help Q - Quit/Save Game
The movement commands let you go in any of the directions indicated in the compass window. The “I” command updates the inventory window so you can see what you’re carrying. The inventory window is also updated whenever you TAKE, DROP or THROW anything.
The “H”command will give you a brief hint appropriate for that location. "Q" is used to exit the program, and to save games.
The 5th Dimension allows you to save your current game status on disk or tape. To use this feature, make sure your storage device is properly connected and loaded with a blank tape or formatted disk. Type the command Q(Quit) and answer Y to the “Save Game?” prompt. Then indicate whether you are saving to disk or tape.
Don’t be frightened when the screen goes black. The program turns off ANTIC during the game saving and loading functions to prevent the display from going crazy. When the save is complete, the screen will return in all its glory and you can continue the game. I/O errors will cause the console to squawk with irritation, and the “Disk or Tape?” prompt will reappear.
To load a previously saved game, type Q/ RETURN and then RETURN again to exit. RUN the program again and press the OPTION key after the initialization is complete. When the screen appears, the game will be restored to exactly the way it was when you last saved it.
Don’t try aborting the game with the BREAK key. The program disables it to prevent you from crashing the machine-language routine that blinks the cursor. Hit SYSTEM RESET and you will return safely to BASIC without erasing the program.
1. Draw a map. You’ll get hopelessly lost in the streets of Washington if you don’t draw a map. The alien universe also contains areas that can be tricky to navigate without careful mapping.
The easiest way to map an adventure maze is use the "Hansel and Gretel” technique. Drop an item to mark your place and move one step in each direction, noting where it brings you. Then retrieve the item, drop it somewhere else and repeat the procedure.
The method works even better if you have more than one item to drop. Be careful - some directions loop around in circles, while others bring you back to the location you just left! With careful and methodical mapping, you should be able to figure out the entire street maze in less than 15 minutes.
2. Use the "H" (Help) command. Different locations have different hints. Some of these hints may prove very useful.
3. Examine everything. Objects may have important features that will not be evident unless you examine them closely. You should also keep track of the items you discover - most of them are essential to your success.
4. Save your game frequently. Use the "Q" command to save your current status after every important discovery, and before you try anything that might be dangerous. Otherwise you’ll have to go back to the street corner and start all over again.
5. Try anything. Don’t be afraid to find out what you can or can’t do. The worst that can happen is that you will be blown into a million pieces.
6. Don’t give up hope. It is possible to retrieve the Declaration and return it to the police station - I promise! If you’re really stuck, ask for other peoples’ suggestions. A fresh outlook might uncover a solution you didn’t think of.
7. Don’t call A.N.A.L.O.G. We are absolutely, positively and definitely not giving adventure hints over the telephone! If you’re really stuck, drop us a desperate note and we’ll print it in our next “Letters” column along with an appropriate reply.
And remember to run D:CHECK or C:CHECK on the program before you try to play it. One byte in the wrong place can make Adventure in the 5th Dimension as hard to beat as an alien force field!
C0-C710
Common variables. You can save lots of memory by defining commonly used
constants as variables. I use the “C” prefix to indicate “common.”
Unfortunately, I couldn’t use variables for common line references because I
wanted to make the program compatible with the Datasoft BASIC Compiler. See
review elsewhere in this issue.
Q,W,I,X,Y,Z
General-purpose working variables.
FLAG
Used to indicate whether the inventory window should be updated. See line 75.
M$
The master location matrix. It contains the data which determines the objects
and legal exits available at each location. M$ is divided into 24 16-character
sections or modules, each holding the data for one location. The first character
position in each module is a unique letter from A-Y which identifies that
location. The next six positions correspond to the six possible directions of
movement. A letter in any position indicates which location you will enter if
you go in that direction. A "?" character indicates no exit in that direction.
Positions 8-16 contain "?" characters unless an object is present; if so, the
code letter for that object is inserted in any location to a maximum of 8.
Position 7 was a flag byte used in an early version of the program. I was too
lazy to remove it.
CL$
The current location buffer. Every time you move into a new location, the
program copies the appropriate location module from M$ into CL$. Any changes in
the status of a location (objects dropped or taken, new exits opened, etc.) are
made in CL$; when you leave that location, CL$ is copied back into M$ and a new
module is copied into CL$. This insures that M$ will always reflect the latest
status of every location.
CL, CL8
The address of CL$ and the address of position 8 in CL$.
ST$
Player status buffer. The first four positions will contain a "?" character
unless you have picked up an object; then the code letter for the object is
stored into one of the positions. Dropping an object replaces the letter with a
"?". Your inventory can contain no more than 4 objects simultaneously. Position
5 is a code letter indicating your current location.
ST
The address of ST$.
VERB$,NOUN$
These are the lookup tables for the legal verbs and nouns. The first four
characters of each word are stored along with a unique alphabetic identifier. A
machine-language routine rapidly compares the user input with the data in these
tables. If a match is found, the routine returns the word's identifier code; if
not, it returns a zero.
V,N
The addresses of VERB$ and NOUN$.
C$
The lookup table for single-character commands. It is scanned whenever you input
a single character. A match returns the position of the matching character; no
match yields a zero.
K$
The keyboard input buffer.
V$,N$
When you enter a sentence and press RETURN, lines 56 and 57 break K$ into verb
and noun segments by determining the location of the space character. These
segments are stored in V$ and N$ for later comparison with the lookup tables.
LOOK$,DLI$,F$,D$
Used to store the program's four machine-language subroutines. LOOK$ is a
general-purpose character locator. DLI$ contains a display list interrupt
handler that blinks the cursor and changes the color of the response window at
the bottom of the screen. F$ is a high-speed screen clearing routine. D$ is the
noun/verb decoder.
OK$,DH$
Used to store commonly used text phrases. See line 214.