Followers of this site (ed. yeah like that’s a thing) will remember a few years ago I created a in-browser playable version of the Applesoft BASIC game Haunted House for this site. Over the past month or so I got it in my head to push my skills as a programmer and make a much more fully realized version of the game. Today I am releasing my new version of the game, Haunted House: Remastered! It’s a vast improvement on the original in almost every way possible. In other words, it’s actually fun to play.
While it’s nowhere near the level of sophistication of an Infocom game, I think it does some pretty impressive stuff (for my skill level as a programmer). It’s still a two word parser, but the vocabulary is increased. There are full-page help screens, triggered story events, a retro-styled monochrome monitor look, and a bunch of scary sound effects! Please take a few minutes and give the game a try. It’s not too long and I try to keep the puzzle reasonably fair.
The previous post in this series explained how to get Graphics Magician images to display from Applesoft. Now, I’d like to go over the structure of the program listed in Write your Own Adventure Programs. The bulk of the program listing consists of the game data including objects, room descriptions, verbs and state flags. Most of the remaining code is comprised of a series of conditions that check how the player’s actions affect the objects in the game world.
Haunted House used a simple, two-word input parser: VERB NOUN. But I wanted this new game to simplify the number of verb choices in the same way the LucasArts adventures streamlined the interface of Sierra-style adventure games. The player will be limited to around a dozen verbs that are entered with a single keystroke.
The verb list is largely based on the options in Monkey Island. PUSH and PULL have been combined into MOVE. To move you must hit Go then enter either North, South, East, West, Up or Down. This is a little annoying, but there are only so many letters in on the keyboard and I needed that D, U and S elsewhere. Other commands require you to hit the keystroke, then type out an object NOUN and then hit Return. “Guess the verb” will no longer be an issue… welcome to 21st century “guess the noun” technology!
Each verb then get’s its own subroutine which contains the logic that triggers the various game actions (or provides a default message if nothing special happens). By assigning a number value VB to each verb, I can use the following to branch to the various subroutines: ON VB GOSUB 1000,600,800,850, ...
The game data is set in the program by assigning strings and numbers to several arrays. In Applesoft you need to declare the size of an array by dimensioning it with the DIM command. For the rooms I will set the size of the rooms array to the number of rooms RM by declaring DIM RM$(RM). Then, near the start of my program I read data into the array by using GOSUB to a loop like this:
5000 DATA "Room description 1","Room Description 2", [...]
5005 FOR I = 1 to RM : READ RM$(I) : NEXT
The DATA can be listed anywhere in the code and it’s important to make sure that there are exactly as many data strings as READ commands. Otherwise, you might get OUT OF DATA errors.
This method of declaring rooms and object will eventually make your Applesoft program very long and hard to edit. I was pretty sure that I could figure out a way to read the data in from an external text file. But more on that later.
Having recently played the Apple ][ game Transylvania and its sequel, I was inspired to mess with the art program which those games used. The Graphics Magician was a huge hit for Penguin Software, but I never actually had a chance to use it when we had an Apple ][. I just remember it being advertised in every computer magazine I had.
My go to art program back in the day was always Alpha Plot from Beagle Bros. It wasn’t the easiest software to use. In fact, it came bundled with a cardboard overlay for your keyboard so you had an immediate reference as to what the various keys did. Still, I managed to draw pixel by pixel and create masterpieces like this:
The Graphics Magician is something altogether different though. Instead of meticulously drawing each point on the screen, you create images programatically using a language of lines, fills and brushes. The end product is what today we would call vector art.
The advantage of vector art is that file sizes are small. The other advantage is that these drawing routines can be used within one’s own Apple ][ programs.
This gave me an idea for a project. Take the text-based adventure game I had made years ago, and use these routines to add graphics to the game. As I type this, I am already pretty far along in the project, but I will be going back and documenting my progress. Hopefully someone might find this informative and, if I am able to follow through, maybe I will have a releasable game in the end. It’s doing more than I ever imagined already:
The book takes you step-by-step through the process of creating a simple text adventure game using Applesoft Basic. The final product is an adventure called “Haunted House.” It’s about as crude and bare bones as a work of interactive fiction can be, but it does what it needs to: there are objects, rooms and key puzzles.
What you see pictured here is some of the DVD packaging for the independently produced documentary film about text adventure games, Get Lamp. In the digital age, packaging matters and the creators of Get Lamp went above and beyond in creating a DVD package that satisfies collectable object fetishists like myself. The inner gatefold sleeve is covered with a nostalgic fantasy illustration that looks like it came straight off of an Atari 2600 cartridge. The DVD also came with a fancy numbered and editioned coin (mine’s number 1540), which would seem kind of cheesy (alá the tin coin that came Ultima V) but is actually very well crafted and, dare-I-say cool. All this comes together in a well made cardboard DVD case that alone almost justifies the $40+ dollar price tag. Thankfully, the film is very good and, as one might expect, the discs contain the usual DVD extras, featurettes and bonus footage. As an added reward, you also get a nice selection of actual, playable games on the DVD -ROM partition of the disc. If you have any interest in text adventures, video games and computing history, you should check this out! More on the film itself later.
(Okay, Masterpiece should probably be in quotes too!) I have been on a bit of a retro computing kick this evening. I have been playing around with AppleWin, which is the best Apple ][ emulator for Windows that I know of. I played a little bit of the original Castle Wolfenstein and then decided to fire up my trusty Apple ][gs and port some of my old Applesoft programs to PC.
The process of transforming a 5.25″ floppy to a disk image is somewhat complicated, but not too bad if you have the right tools. First, I turned on my ][gs and booted the System 6 disk. I then ran the awesome program Asimov (by Ninjaforce) which can create and “burn” Apple ][ disk images. I was able to save six 5.25″ disk images onto a single 3.5″ ProDos floppy. The next step is taking this 3.5″ floppy down to my System 9 Mac which I keep stowed away in my basement. The old Mac system could read ProDos disks so I am able to pull the files off the floppy and then save them to a PC formatted 3.5″ floppy (or send them over a network, but I am not connected in my basement). I have a USB floppy drive on my PC specifically for this purpose. Once the disk images are on my PC’s hard drive (with a .dsk extension) I can boot them in AppleWin.
I spent a few hours running my old programs. Most of them are pretty stupid, but I can’t believe I wrote them as a 10 or 11 year-old. I will post some screenshots in the near future. However, sometime in my sophomore or junior year of high school I took the time to create a full text adventure called, “Malfunction.” My code was based on the code in the book Write Your Own Adventure Programs For Your Microcomputer by Usborne Computer Books. The book guided you through the creation of a haunted house game. I was taken step-by-step through the process of game design–from creating maps and puzzles to programming a text parser. This was a great book, and I’d love to see an updated, perhaps Flash actionscript oriented, version.
Now, more than 20 years later, I have decided to publish my game!
In order to play the game you will need to install an Apple 2 emulator. For windows, I use AppleWin. It’s really simple and runs near-perfectly. As for other platforms like Mac, I’m not-so-sure. Look to Google for your answers.
The game is mediocre at best, but I am pretty proud of it. I learned a ton about programming when I created this. I hope you enjoy it. Please feel free to leave me some comments about what you think.
Recently I have discovered the joys of DOS emulation on my Windows XP machine. DOSbox is an open-source project which provide MS-DOS emulation that is tailored to gaming. There are builds for Win XP, Mac and Linux.
The great thing about the emulator as opposed to just running MS-DOS on my old Win 98 box is that it can handle all the goofy memory configurations and set-up weirdness that I never quite understood when I used MS-DOS for real. It can’t really handle the more complicated Doom-era games, but those aren’t the games in which I am most interested.
I am currently reveling in Sierra 3-D adventure games like the King’s Quest series and Leisure Suit Larry. As a kid, these were the only PC games that could draw me away from our family’s Apple ][. The economy of pixel usage in the art and animation is truly brilliant and the game play still holds up pretty well. I just finished King’s Quest I this evening for the first time. I finished with 136 points of a total 158. Made in 1984, this was the first of the Sierra 3-D adventures. It doesn’t quite hold up to some of the later entries in the series in terms of story and puzzle complexity. Without warning, the game can also be rendered un-winnable if you eat/use certain items at the wrong time. This is a big adventure game no-no in my opinion. But aside from these gripes, it was still fun twenty years after its release.