Sunday 18 August 2013

Castle of Fear (The Micro User type-in) - 4: Solution / Walk-through

This game has several random events, so the walk-through cannot be guaranteed to work every time.

Goal of the game: to win the game, you must to collect all three coins (Bronze, Silver and Gold) and then place one each in 3 consecutively-aligned rooms. At the same time, a wandering troll is attempting to do the same with the jewels found in the castle. If he succeeds first, then you are struck to death on the spot!

However the starting position of the coins is the same with every game. The following walk-through should result in a win after a few tries.

Castle of Fear Walk-through
Starting from the Guests Lounge: E, N, N, W, W, S, S, D, G (get Bronze coin), E, E, U, G (get Silver coin), W, U, E, N, N, W, W, G (get Golden coin), L (drop Golden coin in North end of King's bedroom), E, L (drop Silver coin in Queen's bedroom), E, L (drop Bronze coin in Northern end of N/S passage). If all has gone well, all three coins should now be aligned in a straight row and you win!

Castle of Fear (The Micro User type-in) - 3: Hints

Some hints for playing:

1. What do I need to do to complete the game?
2. How do I escape from the Trap room (north of the Guests' Lounge)?
3. How many coins are there in the game, and where are they?
4. How is the type of coin that you pick up determined?
5. How many jewels are there in the game?
6. What are the rules for picking up and dropping objects?
7. What purpose is the FEED ME room?
8. Where does the coin go when dropped in the Queen's dressing chamber?
9. What is the troll trying to do? 
10. What is the meaning of the messages "You hear a distant SLUURP!" and "You hear a distant WHOOF!"
11. What benefit is the Attack command?
12. Where does the coin go when stolen by a sprite?

Hint 1:

The aim of the game is to collect all 3 coins (Bronze, Silver and Gold) and then place them in a straight line, by leaving one in each of 3 consecutive rooms in the castle. This must be done within the time-limit of 100 turns, and the game will end if the wandering troll similarly succeeds in placing 3 jewels in a straight line in the castle.

Hint 2:

It is not possible to escape from this room, so avoid going north from the Guests' Lounge. If you accidentally wander in, you will need to restart.

Hint 3:

There are 3 coins in the game. At the start of the game, the coins are in the following rooms: North end of King's bedroom, South end of dining room and Bottom of well.

Hint 4:

The type of coin that is picked up is determined by how many coins the player is carrying already. If it is the first coin, it will be Bronze; if it is the second coin, it will be Silver; if it is the third coin it will be Golden.

Hint 5:

There are 4 jewels in the game. The game starts with the troll carrying one, and there are 3 others placed in the castle.

Hint 6:

The player can pick up only coins; the troll can pick up only jewels. The player cannot drop a coin in a room that already contains an object (jewel or coin).

Hint 7:

This is a red herring. Dropping a coin here results in it being lost permanently, making the game unwinnable.

Hint 8:

If you drop a coin in the Queen's dressing chamber, it rolls away down a hole and is placed in the Trap room (making the game unwinnable).

Hint 9:

The troll wanders the castle, randomly choosing between a room with a jewel, the room the player is in, or another random room. He will attempt to pick up a jewel if it is in the room he visits, and drop a jewel if the room is empty (if he is carrying one). His objective is to place 3 jewels in a straight line in the castle i.e. one jewel in 3 consecutive rooms. If he does this, the player loses and is killed instantly.

Hint 10:

These messages occur when the wandering troll picks up or drops a jewel, respectively, and is in another room.

Hint 11:

There is no benefit in using this command, and it can result in your death (if you use it when the troll is in the same room and is carrying a jewel).

Hint 12:

It is placed in a random room in the castle (except for the Trap room). You can find it again by searching the castle.

Saturday 17 August 2013

Castle of Fear (The Micro User type-in) - 2: Random Events

As you wander the castle, there are various random events taking place, leading to various messages on the screen.

  • "A small dwarf walks up to you, says 'Hurry up', and then walks off." This message occurs with a 9% probability at first, and shows with increasing frequency as the number of turns used increases. It is just there to pressure the player.
  • "Listen, you can hear strange voices." Just a random message for atmosphere.
  • Your coin is stolen by a sprite: if you are carrying a coin, there is a chance (7%) it will be taken from you and placed in a random room of the castle. There is no way to avoid this.
  • Troll behaviour:
    • Movement of the troll: each turn, the troll moves randomly to one of the following rooms: a room that contains a jewel; the room the player is currently in; or a random room in the castle (note, he does not actually traverse the rooms in-between!).
    • The troll may in fact carry multiple jewels at once, however this is not obvious to the player who is told only that the troll is carrying a jewel.
    • If the troll is carrying a jewel, he will drop it in the room if it does not contain one already. This gives the message "You hear a distant WHOOOF!"
    • Otherwise, if the room a troll is in contains a jewel, then the troll will pick it up. This gives the message "You hear a distant SLUURP!"
    • There are 4 jewels in total. At the start of the game, there are 3 jewels placed around the castle and the troll is carrying one.
  • You are killed suddenly by an event (such as a pendulum dropping from the ceiling). Although it is not obvious to the player, this is actually triggered by the troll's interaction with the jewels. You are killed if he succeeds in placing a jewel in each of 3 consecutively-aligned rooms in the castle.

Castle of Fear (The Micro User type-in) - 1

Game Description

Castle of Fear is a text adventure that was published in August 1984 edition of The Micro User magazine as a BASIC type-in. The input method is restricted to a small set of command keys (representing compass directions, GET, DROP, INVE, ATTACK etc).

Castle Of Fear: instructions (but they don't give away much!)

Game Locations

All the game's 27 locations are accessible to you from the start (although one room is a trap and has no exits; at least the game does warn you not to enter!).

There are no typical adventure-like puzzles involving keys or other problems to be found. However there is a troll who wanders the rooms, randomly dropping or picking up jewels (you are unable to pick these up). There are also 3 coins to be found in the castle which you can collect. The type of coin you pick up is determined by how many you are holding already; your first coin is denoted as a Bronze coin; the second is Silver and the third is a Golden coin.

Game Objective

The magazine blurb for the game points out that it was written so that even the person who types it in cannot work out how to solve it. Having said that, the game offers no real clues as to its solution that I have been able to find, so I took a look at the code in more detail. Fortunately, unlike the last text adventure game I looked at (Adventure by Program Power) the code is not obfuscated greatly and can be examined fairly readily.

Castle of Fear: game in play
The instructions merely instruct you to "escape" from the castle and give you a time limit of 100 turns in which to do so.

From examining the program code, to win the game you must to collect all three coins and then place one each in 3 consecutively-aligned rooms in the castle. The trick here is that the type of coin (Bronze, Silver or Gold) is decided when you actually pick it up, based on how many you are carrying already. If you are carrying no coins, the next coin you pick up will be Bronze; if carrying one coin then the next will be Silver; if carrying two coins then it will be Gold.

At the same time, a wandering troll is attempting to do the same with the jewels found in the castle. Caution: if the troll succeeds first, then you are struck to death on the spot!

Castle of Fear Disk Image

An image of the game suitable for playing with the BeebEm emulator can be found at the 8-Bit Software site. Click here for a direct link to the image (zipped).

Wednesday 7 August 2013

Adventure by Program Power - 6: Odds and Ends

Having a look through the message text table for the game reveals several interesting messages which are in fact never used in the game. They suggest features which may have been originally planned but were not implemented.


  • Your treasure has been stolen. In the classic Colossal Cave adventure there is a thief who randomly steals your belongings. However there is no thief in this version.
  • Night is falling. Perhaps this was intended to be displayed as a warning that time is running out.
  • Splendid, splendid. At a guess, this may have been the intended response for when the player confirms the game's question "Are you carrying a lamp?". (In the actual game, there is no response).
  • Do you really want a hint? Presumably it was intended for the game to prompt the player after a command of HELP / HINT.
  • Are you bored with this? This could have been meant for inclusion as one of the random comments (e.g. "I am bored, bored, bored" etc) that is made by the game when more than 100 turns have passed.
  • There is bread here. Aha, the dream sequence refers to eating bread, but it is not present in the game.
  • There is a giant here. Perhaps he was to be waiting at the top of the giant beanstalk...
  • There is a sword on the floor. Hm, looks like another weapon was planned (perhaps to slay the giant?)
  • Crash! Tinkle! Dear me! There are fragments of your bottle here. Looks like the bottle was intended to be as fragile as the Ming vase.

Tuesday 6 August 2013

Adventure by Program Power 5: Walk-through Solution

Warning: do not read further unless you wish to see the complete solution for the game.



NO (to answer the question of whether you are a wizard; this is just a tribute to an obscure feature of the classic Colossal Cave adventure game. You then begin on a twisty north south road). SOUTH, GET LAMP, WEST, NORTH, WEST, SOUTH, GET AXE, EAST, EAST, SOUTH, NORTH, OPEN SESAME (the cavern opens), YES (to the question of whether you have a lamp), LIGHT LAMP, NORTH, KILL FROG (the princess runs off), EAST, EAST, EAST, EAST, NORTH, NORTH, GET INGOT (treasure 1), SOUTH, RUB LAMP (transported to Magician's bedroom), WEST, WEST, SOUTH, GET VASE (treasure 2), NORTH, WEST, EXTINGUISH LAMP, HOOT (Owl kills the rat), LIGHT LAMP, IN, GET COIN (treasure 3), OUT, EAST, NORTH, NORTH, WEST, KILL SPIDER (with the axe), SOUTH, GET RUBY (treasure 4), NORTH, NORTH, EAST, EAST, DROP AXE, SOUTH, GET WINE, DRINK WINE (for the empty bottle), NORTH, WEST, SOUTH, RUB LAMP (transported back to black room), WEST, FILL BOTTLE, SOUTH, SOUTH, SOUTH, SOUTH, IN (put treasures in the Left Luggage Office), LEAVE VASE (do not use DROP which smashes the vase), DROP COIN, DROP RUBY, DROP INGOT, GET KEYS, STEAL COIN (thrown into the Dungeon, with keys intact), GET RING (treasure 5), UNLOCK DOOR, DROP KEYS (leave them here for next time), OUT, WATER PLANT (tiny plant grows into a beanstalk), SOUTH, EAST, SOUTH, GET AXE, EAST, GET PRINCESS (hooray!), WEST, WEST, SOUTH, EAST, WEST, GET PEARL (treasure 6), SOUTH, SOUTH, EAST, FILL BOTTLE, WEST, DROP PEARL, STEAL PEARL (get thrown into the Dungeon again, as a shortcut back to the castle), GET KEYS, UNLOCK DOOR, DROP KEYS, OUT, WATER BEANSTALK (grows into a giant beanstalk), DROP BOTTLE, UP, GET DIAMOND (treasure 7), DOWN, SOUTH, EAST, SOUTH, WEST, SOUTH, RUB LAMP (transported back to black room), GET PEARL, WEST, SOUTH, SOUTH, SOUTH, SOUTH, IN, DROP PEARL, DROP RING, DROP DIAMOND, SCORE (Well done - you have achieved your goal of collecting all 7 treasures and rescuing the princess, using minimum turns!).

Finally (with the patched "winnable" version of the game): type DROP PRINCESS to win.

Adventure by Program Power - 4: A Few Fixes & Enhancements

Analyzing the Program Code

Athough the program can be listed quite readily, it still presented a bit of a challenge to dissect as it is written in a heavily obfuscated manner - probably to save memory rather than being intentional - with liberal use of GOTOs, global variables, variables in place of line number destinations and so on. The main program is written in BASIC, with text, location exits and other status information being stored and looked up separately in memory.

Below is a list of minor fixes / enhancements made to the program. The main motivation was to improve the display of the text and to make the game winnable by giving some feedback to the player once the princess is rescued.

Enhancement 1: Fix Loader for BBC Version

The first problem was that the BBC disk image I found online did not work "as is" when run from disk. I was able to get this working using a technique similar to that used in the Electron version, which involved adjusting the loader program to run at a more suitable memory location and tacking on a short assembly language routine to the end of the main program which switches to *TAPE mode (to avoid overwriting game data that is loaded into an area of memory that can be corrupted), sets PAGE appropriately and then runs the program.

Enhancement 2: Fix for Word Wrapping

The game is happy to let words in the location descriptions & other messages break across the end of a line. This was easily remedied by adding a check for the cursor location before printing the next word, and moving down a line if needed.

Enhancement 3: Mixed Case

The game stores all its text in memory in capital letters, and looks up the appropriate word or phrase to print. While printing all in capitals simplifies the program code, it is much easier for the player to have mixed case.

It turned out not to be too complicated to add support for mixed case by adjusting the message printing routine to add the following logic rules:
(1) The first word of every sentence should start with a capital letter.
(2) If a full stop, exclamation mark or colon is found then start the next word with a capital letter.
(3) Otherwise print in lower case.

Original text display: words are all-caps and break across lines

Easier to read: word wrapping and mixed case

Enhancement 4: Adjust Check for Dropping the Princess

One puzzle/frustration in the game is that the princess will "run off into the dark" if she is dropped in any location, whereupon she is moved back to the white tower. However the game does not differentiate between locations, leading to the bizarre situation of her running back into the caverns (presumably through the closed cavern entrance) even if dropped outside at the Left Luggage Office!

To remedy this I added a small check so that she only runs off if the location is a dark one (i.e. one that requires your lamp to be lit). This feels more in keeping with the intention of the message. This means that she can be dropped without running off once you are outside the caverns, or in a location that is not considered to be dark.

Enhancement 5: More Informative SCORE

The player's score is linked both to the number of turns taken (which decreases the score) and the number of treasures found (which increases the score). To help track their contribution to the score, and to provide some feedback on progress with the treasure hunt, SCORE now shows the number of turns taken and the number of treasures found so far.
Extended SCORE information: turns & treasures found

Enhancement 6: Making the Game Winnable

Finally, the original game logic does not contain any logic to check if the player has succeeded in bringing back the Princess, leaving the player feeling unsatisfied. After considering what would be an appropriate condition for winning, I enhanced the logic to print a successful end-of-game message on DROPping the princess in the Left Luggage Office (to be consistent with the location where you drop the treasures).

Monday 5 August 2013

Adventure by Program Power - 3: Puzzle Hints

Spoilers alert! This is a hints page for anyone who may be stuck on a certain puzzle or at a certain place without wanting to resort to a full walk-through. To use it, look for the question that matches your current problem, then search below for its corresponding hint.

1. What do I need to do to complete the game?
2. How do I refill my lamp with the oil?
3. What should I do with the red scarf?
4. How do I get into the closed cavern entrance?
5. I can't move anywhere from the Edge of the Precipice.
6. What should I do with the frog?
7. How do I use the cage?
8. What should I do with the glass slipper?
9. How do I get past the lake?
10. How do I kill the rat?
11. How do I kill the spider?
12. What use is sleeping?
13. What do I do in the banquetting room?
14. I am caught in the scrubby landscape past the dragon.
15. What is the password for the question at the start of the game?
16. What do I do with the tiny plant?
17. Where does the princess run to? How do I stop her?
18. What are the seven treasures?
19. Where is the pearl?
20. Where is the ring?
21. How do I get into the dungeon?
22. How do I escape from the dungeon?
23. How do I prevent the Ming vase from breaking when I drop it?

24. Where does rubbing the lamp have any effect?

Hint 1:

There are two goals in the game. As outlined in the instructions, the main aim is to bring back the princess from the magic caverns, while a secondary goal is to collect the treasures scattered around (there are seven in total). Your progress is reflected in your score (type SCORE): you receive 50 points per treasure that you are carrying, and 100 points per treasure that you have placed in the Left Luggage Office which is found near the starting location of the game. Deducted from your score is the number of turns you have taken, so the less moves you require the higher your score.

Important: due to a bug (oversight?) in the original game, there is no "end of game" winning message even if you return with the princess and have located all treasures! In addition, do not drop the princess at any location as she will run back to the caverns. Since there is no game logic to check for successful completion of your adventure, it can be considered as when you have all 7 treasures in the Left Luggage Office & are carrying the princess.

Hint 2:
It is not possible (or necessary), as your lamp has unlimited light. The oil is not used in the game.

Hint 3:
It is not used in the game.

Hint 4:

Give the magic command. Hint: Ali Baba and the Forty Thieves.

Hint 5:

Although you cannot move in any compass direction, you can use GO BACK to move to the previous location.

Hint 6:
Try various actions - not all will lead to a successful result however. You may need to resort to violence.

Hint 7:
It is not used in the game.

Hint 8:
It is not used in the game.

Hint 9:

You cannot, however it can be a useful source of water.

Hint 10:

You can't kill it directly; instead you need to attract an owl to help (you may have heard one hooting nearby). He does not like your lamp light though.

Answer 11:

You can find a weapon in the forest outside the caverns.

Hint 12:

For something fun, you can try dreaming. However it does not progress you further.

Hint 13:

There is nothing special here.

Hint 14:

Unfortunately this is a nasty trap, and there is no way to escape from the landscape. Avoid going this way.

Hint 15:

This is red herring; there is no correct password. You must answer "no" to the question asking whether you are a wizard. (This is a tribute to an early version of the original Colossal Cave adventure, which used this question to allow administrative access).

Hint 16:

Find a way to water it.

Hint 17:

There are two situations where the princess runs off. The first is when you free her from the spell; in this case she can be found again in the Black Magician's bedroom in the castle. The second situation is if you are carrying her and drop her, no matter where you are (even outside the caverns!). In this case, the princess  runs to the bedroom in the white tower. There is no way to prevent her from running, apart from never setting her down once you carry her.

Hint 18:

The seven treasures are: valuable coin, large diamond, silver ingot, superb pearl, gigantic ruby, golden ring, Ming vase.

Hint 19:

It is in the maze of tunnels.

Hint 20:

It is in the dungeon.

Hint 21:

You will be thrown into the dungeon for either of two actions: attempting to KISS the princess, or attempting to STEAL one of the treasures. However in only one of these cases will your keys be removed from your possession!

Hint 22:

Unlock the dungeon door with the bunch of keys. You must find a way to bring the keys with you into the dungeon - if you do not have them then there is no way to escape.

Hint 23:

Use LEAVE instead of using the usual DROP command.

Hint 24:

In two locations: the mysterious black room & the magician's room.


Sunday 4 August 2013

Adventure by Program Power - 2

After some time spent reacquainting myself with this game, I was able to make good head-way in solving the puzzles in the adventure, but I ran into a brick wall trying to get the game to recognize a successful completion of the game (see below).

In terms of first impressions, the text looks a little harsh as it is output entirely in capital letters, making for rather tiring reading for long stretches. Words also occasionally wrap off the end of one line to the next which looks a little sloppy.
Text display: all text is in capitals, with words occasionally breaking
across lines - such as "WEST" in the first location of the game.

I'll look at enhancing the program code to improve this.

The game itself keeps a running score (which you can check using SCORE) which starts at 100 points and decreases by one point for each turn taken, hence encouraging the game to be completed in the minimum number of turns. Although not specified in the game instructions, to receive maximum points for each treasure found you place it in the Left Luggage office which is found near the beginning of the game (a treasure is worth 50 points when carried, and 100 points when stored in the office).

As well as a number of "typical" puzzles found in adventure games of the time (e.g. bunch of keys to open a locked door, axe to kill a spider) there are also some which are original to the game. One which is probably most memorable among people who have played the game, is how to get past a fierce rat which blocks your way later in the game. The solution involves calling an owl to do the dirty work for you, but it it doesn't like the light of your lamp!

The game has its fair share of red herrings. For example, there are also several objects found lying around which in fact have no use in the game. These include a red scarf (at the beginning of the game), a wicker cage and even the dragon. Particularly nasty is the desert landscape location past the dragon, from which there is no escape as all exits lead back to itself (and the use of the command GO BACK, which is recognized elsewhere in the game, is disabled deliberately for this location). While these add somewhat to the atmosphere, they also lead to a lot of wasted time. At least the lamp never runs out of oil...

Apparently the cassette inlay text boasted of this adventure  having "over 100 locations" in the game, but there are in fact exactly 63.

The one fatal flaw with the game, after playing through as far as possible, is that there is no end-game sequence. I  had to dig into the code to convince myself! Even after successfully finding the princess and carrying her back to the Left Luggage office, nothing happens and you are left wondering what to do. To make matters worse, if you drop the princess at any location in the game - including the Left Luggage office - you are told she "runs off into the dark" and she is placed back in the middle of the caverns again. This must have been immensely frustrating to anyone making it this far, and I can only think that it was an oversight that an end-of-game message was not implemented.
Let's set the princess down - this should be the end of the game...
Oh no! The princess runs off into the dark!

However, this offers the opportunity to create an enhanced version of the game by adding my own end-of-game check and message - and at the same time tidying up the text presentation on the screen.

Adventure by Program Power - 1

"Adventure" is the simple name of a text adventure game that was published back in 1982 by Program Power, who later became Micro Power. The author (according to one of the messages in the game) was J Spilsbury. The instructions on the loading screens state the objective: rescue a beautiful princess from the Magic Caverns, collecting any treasures you find on the way. From some of the game locations and puzzles, it was clearly inspired by the classic Colossal Cave adventure game, which was not uncommon for adventure games back then. I was able to get a certain way in the game, but would invariably end up stuck.
Adventure: introduction and instructions 

Interestingly, there is not a lot of information regarding how to solve this game on the net even now. So I decided to sit down and put in a concerted effort to get to the end of the game, referring to the code as necessary to get to the bottom of it all, the ultimate goal being to make available a solution to the game after all these years!

Versions of the game were produced for the Electron, the BBC Micro and even the Acorn Atom. The Electron version is identical in content to the BBC version except that it runs in MODE 6 (white text with a blue "Venetian blind" effect) as compared to the BBC version which uses colour to a limited extent in teletext MODE 7.
Electron version: "Venetian blind" effect
BBC version: easier-to-read Teletext display

Disk image of Adventure for BeebEm

A disk image of Adventure (BBC version) for running with BeebEm  can be downloaded from
my post on this page of the Stardot forums. This is a patched version I have made (see later posts) which improves the text display and adds logic to recognize a successful end of game.

Other websites contains disk images for the Electron & BBC versions, but only the Electron version works if running from disk under an emulator - the BBC version fails to run as it is trying to loads data into an area of memory which is reserved for the disk filing system - presumably it assumes the machine is loading from tape. The version linked above has been patched so that it loads properly.

BeebEm - a BBC Micro Emulator

To run the old BBC games on my PC, I use the emulator BeebEm which is very easy to set up and run. You can download and install it from the BeebEm homepage.

One nice thing about using an emulator to run the games is the extra functionality it provides which wasn't available when running on the original hardware, such as the ability to redefine keys or save the state of a game at any point.

The other thing needed is disk image files with software to run. A site which has a vast collection of BBC software is Stairway to Hell.

Saturday 3 August 2013

Welcome to the blog of the 8-Bit Tinker

Welcome to the start of the 8-Bit Tinker blog! I'll be putting up the occasional post about looking into a few of the old games for the BBC Micro that I used to enjoy with a kid. In particular, I'd like to dig into their inner workings - looking at the software code to see how they were put together (something I never really got far with with as a kid, being too interested in playing them...). It should be an interesting chance to brush up on BBC BASIC / 6502 assembly language, and perhaps get to the bottom of how to solve some of those seemingly unsolvable text adventure games over which I gnashed my teeth all those years ago...