]Eamon Adventurer's Guild Online

   

Call-A.P.P.L.E.ô  Vol. VI, No 3 / March 1983

Reprinted with Permission of
Apple Pugetsound Program Library Exchange
www.callapple.org

Special thanks to Bill Martens for his help in obtaining this article!


Call-A.P.P.L.E. ô

Volume VI Number 3
March 1983
$2.50 ($3.00 Canada, £1.75 UK.)

A CALL -A.P.P.L.E. REVIEW: Anatomy of an Eamon Adventure

Download a PDF file of this article (19.90 MB)

Reprinted with Permission of
Apple Pugetsound Program Library Exchange
www.callapple.org


Anatomy of an Eamon Adventure

Robert Plamondon

How the EAMON Adventure System Works.

        COMPUTERIZED adventure games have been surrounded by an aura of mystery that has nothing to do with their story lines. Simply stated, the mystery is this: no one knows how they work.
        Like most mysteries, adventure programs are pretty straightforward once the hidden parts are revealed. To bring these secrets to light, letís look at the EAMON adventure system by Donald Brown, which is a set of BASIC programs for the APPLE ][ and available to members at $4.00 each on the A.P.P.L.E. "As Is" software series. EAMON is a good choice because itís a good system, itís all in BASIC, and itís in the public domain, which means that you can adapt or copy it at will. It does most of the things that all-text adventures do, so studying it can give you a good idea of how adventure games work.

The Structure of EAMON.

        EAMON is a set of programs on disk which call each other as necessary, passing data through text files. The number of programs varies slightly depending on whether you have the original version or an altered one. In my own version I have merged several of the programs together, reducing the number of programs somewhat.
        Warning: This gets a little intricate. If you donít care to know about the different programs, and just want to get the crucial stuff, skip this section.
        The HELLO program runs when you boot the EAMON Master Disk. It loads an impressive picture of a dragon to the high-resolution graphics display to give you something to look at, then it runs a pro gram called THE WONDERFUL WORLD OF EAMON.
        THE WONDERFUL WORLD OF EAMON is the program that comes up with characters for you to play in the adventure. It prompts for your characterís name, then tries to find an existing character of the same name in the file CHARACTERS. If it doesnít find him, it asks if you spelled if correctly (giving you a chance to try again). If you insist your spelling was correct, the program decides that you must be starting a new character and creates one for you, storing the data in the file CHARACTERS, and the name of your character and his record number to the file THE ADVENTURER. It also gives you a chance to read the instructions (Listing 1).
        If the name you gave matches with an existing record in CHARACTERS, his name and record number are writ ten to THE ADVENTURER. In both cases, the next thing the program does is to issue the command, "RUN MAIN HALL."
        The MAIN HALL is where characters go to buy and sell weapons, buy armour and spells, and depart for adventures. The MAIN HALL reads the number stored in THE ADVENTURER, then reads in the character record of the same number from CHARACTERS.
        After doing all the buying and selling that appeals to him, the player has two options: he can send his character on an adventure, or quit. If he quits, his updated character record is resaved in CHARACTERS. If he decides to go on an adventure, the character record is partially erased (although the data still exists in pro gram variables), and the player is prompted to insert the disk with the adventure on it. The characterís data is written to a file named FRESH MEAT, and the file EAMON.NAME is read. EAMON.NAME contains the name of the adventure program. The MAIN HALL then runs the program of that name, and the main adventure begins.
        Okay, so itís complicated. The code that does all the file manipulations is a lot shorter than the explanations, though, and passing parameters between programs is not the crucial part of EAMON, anyway. Weíll get to the good stuff in a minute.
        The reason why the character record is partially erased before the character embarks on an adventure is to make sure that if he dies on the adventure, he stays dead. As it is, there are only two ways to get your characterís statistics back into the CHARACTERS file. One is to survive the adventure. The other is to use the RESURRECT program on the EAMON Utility Disk (which contains other interesting programs, as well). Resurrecting a character is considered cheating by purists, but everyone does it anyway.
        The program called by the MAIN HALL usually prints out introductory material for the adventure; telling you whatís going on, what your character is supposed to do, and so forth. This program in turn calls another program (donít worry, weíre almost there): the BASE DUNGEON PRO GRAM, which does the actual adventure. The rest of this article will deal with the BASE program.

A (Nearly) Infinite Loop.

        The main activity of an adventure program is a loop: the program gets a command from the player, figures out what it means, goes to the appropriate routines to carry out the command, and returns to get another command. This loop continues until the adventure is completed, the character dies, or the power is turned off.
        Getting commands is an easy job. All it takes is a statement like "INPUT As." Breaking the command into words, and identifying the actions corresponding to the words is also pretty easy, it turns out. The routines that carry out the actions are usually fairly simple, too.
        So whereís the hard part? The individual parts are all easy, but there are a lot of individual parts. A pro gram that puts them all together can be immense. This makes the design job difficult enough that most people whoíd like to write adventures never get started. Fortunately, EAMON makes a good base for all sorts of adventures, and the design work for the programs has already been done.

One Program, Many Adventures.

        One of the most useful things about the EAMON system is that the same BASE program is used (with minor alterations) with all the EAMON adventures. This is possible because all the information about a specific adventure is kept in text files, and this data is what controls the adventure.
        For example, the information about which rooms connect where is kept in a text file, which is loaded into an array at the beginning of the adventure. This data controls where the adventurer can go. Monster data is likewise kept in files, so the creatures you encounter will vary from one adventure to the next.

The files for each EAMON adventure are:

  1. EAMON.DESC, which contains the long descriptions for each room, artifact, special effect, and monster in the adventure.
  2. EAMON.ARTIFACTS holds the data on artifacts (i.e., objects) in the adventure, including names, values, initial placement, etc.
  3. EAMON.MONSTERS contains monster data, and is similar to EAMON.ARTIFACTS.
  4. FRESH MEAT holds information on the character.
  5. EAMON.ROOMS holds the information on which room connects where.
  6. EAMON. ROOM NAMES holds the names of each room.

These files provide all the information required to run a unique adventure.

The Program Listing.

        Reading the listing of the EAMON adventure system is necessary if you want to understand the way EAMON works. I have added a large number of remarks to the listing to make it more comprehensible (there are very few comments in the original program.) Once you under stand how this program works, you should be able to write your own adventure program, if that appeals to you. If you want to write adventures, but donít want to design a new pro gram, EAMON is the system for you. Itís only available for the Apple 11 (as far as I know), but it would be fairly easy to convert it to run on other machines.
        This is my version of the BASE program, which is a modification of John Nelsonís modification to Donald Brownís original. John Nelsonís version is the one on the Dungeon Designer Version 5.0; mine is Version 5.1, and previous versions are (as far as I can tell) Donald Brownís original creation. A number of routines have been changed. Some of these make the program run faster, some correct errors in coding or concept in the original, and some make the output more readable.

A Brief Overview of the Program.

        Lines 100-900 make up the main loop. Lines 100-200 print out a description for the room and each monster and object in it. If something has been encountered before, its name is printed. If something is being seen for the first time, the long description is printed.
        Lines 200-290 get the playerís command and process it. The input is broken into a subject and verb (S$ and V$), and the verb is compared to the list of commands in the string array C$. If a match is not found, an error message is printed along with a list of acceptable verbs. If there is a match, the appropriate routine is jumped to in line 290. If the player just hits RETURN, rather than typing anything, his previous command is repeated.
        Lines 300-900 control combat. Each monster in the room gets its chance to attack. Morale is checked for each monster: if the morale check fails, the monster flees from the room. A monsterís morale decreases as it is wounded. Line 900 is "GOTO 100" - forming the (nearly) infinite loop.
        Lines 1000-2000 handle initialization. Variable and arrays are set to their initial values, and data is read in from disk. The list of command words is in line 1920.
        Lines 2000-3000 handle the end of the game. If your character lives, he gets to sell his treasures and return to the MAIN HALL program. If he died, the MAIN HALL program runs THE WONDERFUL WORLD OF EAMON, giving you the chance to start a new character.
        Lines 3000-4000 handle movement. The program determines which direction you want to move, and checks to see if itís possible. If it is, you are moved into another room.
        Lines 3600-3900 handle monster reaction. If the monster hasnít been met before, "dice" - random numbers - are rolled and compared to its "Friendliness." The monster will be either friendly, neutral, or hostile. If may follow you from room to room (it will always do so if friendly, never if neutral, and will sometimes chase you when hostile). This makes monster reaction important to the movement routine.
        Lines 4000-5000 handle picking things up. It checks to see that the item is in the room, and isnít too heavy. If the character is unarmed, and the item is a weapon, the weapon becomes his "ready" weapon - the one he is prepared to fight with. The command "GET ALL" causes the character to pick up everything thatís not too heavy for him.
        Lines 5000-6000 make up the DROP routine, which is the GET routine in reverse. DROP is used to get rid of unwanted baggage, and is helpful in combat to arm a comrade who has lost or broken his weapon. If a weapon is on the floor, any unarmed combatant will pick it up. (GIVE doesnít work during combat, though perhaps it should.)
        Lines 6000-7000 are the LOOK or EXAMINE command, which is usually used in the form of "EXAMINE SWORD." The long description in EAMON.DESC is printed if the thing youíre looking at is in the room.
        Lines 7000-8000 make up the combat routine. The combat system is suspiciously similar to that in RuneQuest, a popular fantasy role-playing game (not a computer game). Each creature has a chance to hit with each category of weapon (axe, bow, spear, and sword). These numbers are in the range of zero to something over 100. If a random number between 1 and 100 is less than the chance to hit, the creature hit its opponent.
Critical Hits do extra damage, and Fumbles cause the attacker to drop his weapon or hurt himself.
Armor absorbs damage, but reduces the wearerís chance to hit because of its weight and bulk. Armour Expertise is the skill of compensating for the hampering effects of wearing armour.
If a creature scores a hit, there is a chance that his skill at the weapon he is using will increase (practice makes perfect).
        Lines 7700-7900 handle dying creatures. When a creature dies, its weapons and possessions fall to the floor, and his dead body (an artifact) is placed in the room. Its Courage is reduced to 75% of its current level in case it is resurrected by a POWER spell (having just died, it would think twice before risking its life again). If the playerís character dies, the game is over (this is one way out of the nearly infinite loop).
        Lines 8000-9000 handle the FLEE command. The character flees through a randomly selected exit. Sometimes your enemies follow, and sometimes they donít.
        Lines 9000-10000 are the GIVE routine. You can give anything you are carrying to a monster. This sometimes makes them friendlier. If you use a number, as in "GIVE ORC 500" the program assumes you are giving that many gold pieces to the monster. Money makes a good bribe.
        Lines 10000-11000 form the IN VENTORY routine, which prints out the name of everything your character is carrying.
        Lines 11000-12000 form the BLAST spell, which is used to wound opponents. All spells in EAMON decrease in effectiveness with use: if you have an 80% chance of success on the first attempt to use the spell, it is reduced to 40% on the second try, 20% on the third, and so on. This is not a very effective way of limiting spell use, but no one has changed it yet.
        Lines 12000-13000 form the HEAL spell, which cures wounds on your character, but canít be used to heal his friends (someone ought to fix this).
        Lines 13000-14000 are the POWER spell, which does unpredictable things - from causing things to vanish to raising the dead to collapsing the roof on your head. Many adventures have a BASE DUNGEON PROGRAM with a modified POWER spell, just for variety.
        Lines 14000-15000 make up the SPEED spell, which increases agility and the base chance to hit. SPEED is nice because you can cast it on your self before a battle (when spell-casting is safe), and it lasts a reasonably long time.
        Lines 15000-16000 are the SMILE command, which is a way to try to make friends. It doesnít really have any effect on the creatures, but it does tell you how they feel about you.
        Lines 16000-17000 make up the SAY command, which give you an alternate way of casting spells, and little else. Some adventures use magic words, so this routine is modified to let you open doors by typing "SAY OPEN SESAME."
        Lines 17000-18000 let you READY a weapon. You can carry a huge number of weapons, but you can only fight with one at a time. READYing a weapon is how you specify which one youíre using.
        Lines 18000-19000 are the "Save Game" routine, added to the pro gram by John Nelson. The pointers to the start and end of variable and array space are saved into a binary file, and then the variable and array spaces are saved into two more binary files.
        Lines 19000-20000 restore a saved game. By retrieving the variables and variable pointers, the game begins exactly where it left off.
        Lines 50000-60000 are the error- handling routines, consisting of a short machine-language program that helps fix APPLESOFTís ON- ERR GOTO bugs, a routine to print out the error message (which is disabled by ONERR GOTO), and a jump back to 100. This doesnít always work, but itís helpful. If you are running an EAMON adventure that doesnít have the error-trapping routine, you can get back to where you left off by typing

POKE 51,0 : GOTO 100

        The Base Program is shown in Listing 2. Table 1 gives an explanation of the variables in the program.
        The basic instructions for playing EAMON are given in Listing 1, and tell a lot about the game, especially the combat details.
        The Dungeon Designer Disk contains a number of programs that help you to create adventures. The most important of these, DUNGEON EDIT, is used to create the descriptions of rooms, monsters, and artifacts. There are several other useful programs, as well as the Playersí Manual and the Dungeon Designersí Manual (which come on text files, with a program to print them out to the screen or a printer).
        Getting EAMON There are two good sources of EAMON adventures. One is good old A.P.P.L.E., the other is the Apple Avocation Alliance, Inc.
        A.P.P.L.E. has a number of adventures available on its "As Is Software" disks, which cost $4.00 each.
        The Apple Avocation Alliance is in business to do essentially the same job as A.P.P.L.E.ís "As Is Software" - the distribution of public-domain software at low prices. Ron Maleika runs 3A almost single-handedly, and although he has complained about being swamped with orders recently, service has consistently been very fast - my orders have been filled from six days to two weeks from the time of mailing them in. A.P.P.L.E. averages about four weeks.
        3A will ship disks on DOS 3.2 or 3.3, and Ron is actively acquiring all the EAMON adventures in the known universe. Not a bad deal. Table 2 gives a list of the EAMON adventures in 3Aís October, 1982 catalog, plus two more that Ron told me about later.
        If you are not an A.P.P.L.E. member, you may order direct from:
Apple Avocation Alliance, INC.
721 Pike Street
Cheyenne, Wyoming USA 82009
and enclose $2.00 for a catalog, and $3.00 for yearís subscription. 3A has a huge number of public-domain pro grams which they sell for $1.00 plus the price of the disk (currently at $2.15). 3A has over thirty EAMON adventures, including the EAMON Master Disk (which you must have to run the adventures), the Dungeon Designer Disk, and two EAMON Utility Disks.

Conclusions.

        A lot of the features in EAMON are inelegant, and some are downright crude. Still, EAMON makes a very good system for adventure games, especially combat-oriented adventures. Since itís in the public domain, anyone can use it and try to improve itóbut in its present form it is eminently playable and very enjoyable.
The BASE PROGRAM shows you one way to write an adventure game, and makes a good starting point for those who want to write their own adventure systems. People tend to start out by just playing the adventures, but eventually they canít resist the temptation to write one. Before they know it, theyíre writing their own adventure system.
        Whether youíre one of the fanatics described above, or just like to play adventure games, EAMON is worth looking into. The price is right, the variety is stunning, and the quality is surprisingly high.
Happy adventuring !

The EAMON Adventures:

  1. EAMON Master Disk and The Beginners' Cave
  2. Minotaur's Lair
  3. Caves of the Mind
  4. Zyphur River Venture
  5. Doom Castle
  6. The Death Star
  7. The Devil's Tomb
  8. The Abductor's Quarters
  9. Assault on the Clone Master
  10. The Magic Kingdom
  11. Molinar's Tomb
  12. The Quest for Trezore
  13. Treasure Island
  14. Furioso
  15. Heroes Castle
  16. The Caves of Mondamen
  17. Merlin's Castle
  18. Hogarth Castle
  19. The Death Trap
  20. The Black Death
  21. Marron Quest
  22. The Senator's Chambers
  23. The Temple of Ngurct
  24. Black's Mountain
  25. Nuclear Nightmare
  26. Moleman Assault
  27. Moleman Revenge
  28. London Tower
  29. The Lost Island of Apple
  30. The Underground City
  31. Gauntlet
  32. House of Ill Repute
  33. Nobbin's Hell Hole

EAMON Tournament Adventures:

  1. Castle of Count Fuey
  2. Search for the Key
  3. The Rescue Mission

Utilities


Table I

Variables used in EAMONís
BASE DUNGEON PROGRAM
from A Manual for EAMON Adventure Designers
by Donald Brown

AC - ARMOR CLASS of player
AD%(*,*) - ARTIFACT DATA The first subscript is the number of the artifact, and the key for the second is: (1 = Value, 2=Type, 3=Weight, 4=Room, 5=Complexity, 6=Weapon Type, 7=Dice, 8=Sides, 9=Flag If Seen)
AE - ARMOR EXPERTISE
AN$(*) - NAME OF ARTIFACTS
BANK - GOLD PLAYER HAS IN BANK
C - HOLDS NUMBER OF COMMAND GIVEN
C$(*) - VERBS PROGRAM RESPONDS TO
CH - PLAYER CHARISMA
CZ$ - LAST COMMAND GIVEN
DF - DEFENDER
DIE- LOGICAL FLAG, 1=PLAYER DIED
DK$ - HOLDS CTRL-D FOR DISK COMMANDS
DR%(*) - ROOM MOVED IN EACH DIRECTION
EA - EFFECT OF ARMOR ON ODDS-TO-HIT
FD%(*) - FULL DAMAGE OF SIDE IN COMBAT
FR - FUMBLER ROLL/FRIEND RATING
GOLD - GOLD PLAYER HAS ON PERSON
HIT- LOGICAL FLAG IF HIT IN COMBAT
INC - LOGICAL FLAG IF ABILITY INCREASED
LK - LOGICAL FLAG IF ĎLOOKEDí ALREADY
MD%(*,*) - MONSTER DATA First subscript is monster number, second key is:1 =HARDINESS, 2=AGILITY, 3=FRIENDLINESS, 4=COURAGE, 5=ROOM, 6=WEIGHT, 7=DEFENSIVE ODDS (%), 8=ARMOR, 9=WEAPON #, 10=ODDS TO HIT (%), 11=W DICE, 12=W SIDES, 13= DAMAGE, 14=REACTION; 0-NOT MET, 1-UNFRIENDLY, 2-NEUTRAL, 3-FRIENDLY
MN$(*) - NAME OF MONSTER
MR - MONSTER MORALE
NA - NUMBER OF ARTIFACTS
NBTL - LOGICAL FLAG IF IN BATTLE
NC - NUMBER OF COMMANDS
NM - NUMBER OF MONSTERS
NW - TOTAL COUNT OF WEAPONS IN GAME
NZ - NUMBER ARTIFACTS NOT PLAYER WEAPON
OF - NUMBER OF OFFENSIVE MONSTER
RAISE - LOGICAL FLAG IF POWER RAISED
REC - PLAYER RECORD IN CHAR FILE
RL - RANDOM NUMBER 1-100
ROOM - ROOM PLAYER CURRENTLY IN
RR- RANDOM NUMBER 1-100 FOR POWER
S$ - SUBJECT OF COMMAND GIVEN
S2%(*) - CURRENT SPELL ABILITY
SA%(*) - TOTAL SPELL ABILITY
SEX$ - HOLDS ĎMí OR ĎFí FOR PLAYER
SPD - NUMBER OF TURNS SPEED SPELL TO GO
SUC - LOGICAL FLAG IF SPELL SUCCEEDED
TD%(*) - DAMAGE TAKEN FOR SIDE
TP - TOTAL PRICE OF TREASURE
V$ - VERB OF COMMAND
V%(*) - FLAGS IF PLAYER BEEN IN ROOM
WA%(*) - PLAYERíS WEAPON ABILITY
WD%(*) - FOR WEAPON, DICE OF DAMAGE
WN$(*) - NAME OF PLAYERíS WEAPON
WO%(*) - WEAPON COMPLEXITY
WP%(*) - WEAPON POINTER (IN CLOSE)
WS%(*) - SIDES/DIE OF DAMAGE FOR WEAPON
WT - WEIGHT PLAYER CARRYING
WT%(*) - WEAPON TYPE
WZ - NUMBER OF WEAPONS PLAYER BROUGHT


Listing 1

You read the instructions and they say - Information About THE WORLD OF EAMON

You will have to buy a weapon. Your chance to hit with it will be the weapon complexity, plus your ability in that class, plus twice your agility.

The five classes of weapons (and your current abilities with each) are Ė
Club/Mace 20%
Spear 10%
Axe 5%
Sword 0%
Bow -10%

Every time you score a hit in battle, your ability in the weapon class may go up by 2%, if a random number from 1-100 is less than your chance to miss!
There are four armour types, and you may also carry a shield if you do not use a two-handed weapon. These protections will absorb hits placed upon you (almost always!) but they lower your chance to hit. The protections are -

Armor Hits Protect Odds Adjust
None 0 -0%
Leather 1 -10%
Chain 2 -20%
Plate 5 -60%
Shield 1 - 5%

You will develop an armour expertise, which will go up when you hit a blow wearing armour and your expertise is less than the armour you are wearing. No matter how high your armour expertise is, however, the net effect of armour will never increase your chance to hit.
You can carry weights up to ten times your hardiness, or 150 gronds. (A measure of weight, one grond = 10 DOS.)
Additionally, your hardiness tells how many points of damage you can survive. Therefore, you can be hit with 15 1-point blows before you die.
However, you will not be told how many blows you have taken. You will be merely told things such as -

"Wow! That one hurt!"
or "You donít feel very well."

Your charisma (20) affects how citizens of EAMON react to you. You affect a monsterís friendliness rating by your charisma less ten, difference times two (20%).
You start off with 200 gold pieces, which you will want to spend on supplies for your first adventure. You will get a lower price for items if your charisma is high.
After you begin to accumulate wealth, you may want to put some of your money into the bank, where it cannot be stolen. However, it is a good idea to carry some gold with you for use in bargaining and ransom situations.
You may also hire a wizard to teach you some magic spells. There are four spells you may learn.

Blast -Hurt your enemies from a distance.
Heal -Remove damage from your body.
Speed -Double your dexterity for a time.
Power -Does something weird. The exact effect is unpredictable.

Other types of magic may work in various adventures and items may have special properties. However, these will not work in other adventures than where they were found. Thus, it is best (and you have no choice but to) sell all items found in adventures, except for weapons and armour.
The man behind the desk takes back the instructions and says, "It is now time for you to start your life." He makes an odd sign with his hand and says, "Live long and prosper."
You now wander into the main hall.


A listing of the Eamon Adventure Base Program 2.1 concluded the article, but is omitted from this internet version.

** THATíS ALL, FOLKS!
Call -APPLE. March 1983