Archive for November, 2008

DrupalZM - The Lurking Horror

One more quick update - I figured that if Zork I worked so well all the way up to the Troll room, that I could try giving another Zmachine a whirl and see how far it got. I added a node for "The Lurking Horror", one of my favorite Infocom games of all time. There was one opcode that it used to manually call for a refresh of the status line that I needed to add, but after that.....

You've waited until the last minute again. This time it's the end of the term, so all the TechNet terminals in the dorm are occupied. So, off you go to the old Comp Center. Too bad it's the worst storm of the winter (Murphy's Law, right?), and you practically froze to death slogging over here from the dorm. Not to mention jumping at every shadow, what with all the recent disappearances. Time to find a free machine, get to work, and write that twenty page paper.

THE LURKING HORROR
An Interactive Horror
Copyright (c) 1987 by Infocom, Inc. All rights reserved.
THE LURKING HORROR is a trademark of Infocom, Inc.
Release 203 / Serial number 870506

Terminal Room
This is a large room crammed with computer terminals, small computers, and printers. An exit leads south. Banners, posters, and signs festoon the walls. Most of the tables are covered with waste paper, old pizza boxes, and empty Coke cans. There are usually a lot of people here, but tonight it's almost deserted.

A really whiz-bang pc is right inside the door.

Nearby is one of those ugly molded plastic chairs.

Sitting at a terminal is a hacker whom you recognize.

>s
Second Floor
This is the second floor of the Computer Center. An elevator and call buttons are on the south side of the hallway. A large, noisy room is to the north. Stairs also lead up and down, for the energetic. To the west a corridor leads into a smaller room.

>w
Kitchen
This is a filthy kitchen. The exit is to the east. On the wall near a counter are a refrigerator and a microwave.

Sitting on the kitchen counter is a package of Funny Bones.

>open fridge
Opening the refrigerator reveals a two liter bottle of Classic Coke and a cardboard carton.

>take coke
Taken.

Worked great!

DrupalZM - It is pitch black.

After fixing a dumb bitwise math bug and fixing a piece of the insert object logic (after removing an object, it wasn't setting siblings correctly), things are looking pretty awesome. I would call the following a pretty successful test!

ZORK I: The Great Underground Empire
Copyright (c) 1981, 1982, 1983 Infocom, Inc. All rights reserved.
ZORK is a registered trademark of Infocom, Inc.
Revision 88 / Serial number 840726

West of House
You are standing in an open field west of a white house, with a boarded front door.
There is a small mailbox here.

>n
North of House
You are facing the north side of a white house. There is no door here, and all the windows are boarded up. To the north a narrow path winds through the trees.

>e
Behind House
You are behind the white house. A path leads into the forest to the east. In one corner of the house there is a small window which is slightly ajar.

>open window
With great effort, you open the window far enough to allow entry.

>go in
Kitchen
You are in the kitchen of the white house. A table seems to have been used recently for the preparation of food. A passage leads to the west and a dark staircase can be seen leading upward. A dark chimney leads down and to the east is a small window which is open.
On the table is an elongated brown sack, smelling of hot peppers.
A bottle is sitting on the table.
The glass bottle contains:
A quantity of water

>take bottle
Taken.

>w
Living Room
You are in the living room. There is a doorway to the east, a wooden door with strange gothic lettering to the west, which appears to be nailed shut, a trophy case, and a large oriental rug in the center of the room.
Above the trophy case hangs an elvish sword of great antiquity.
A battery-powered brass lantern is on the trophy case.

>take lantern
Taken.

>move rug
With a great effort, the rug is moved to one side of the room, revealing the dusty cover of a closed trap door.

>open door
Which door do you mean, the wooden door or the trap door?

>trap
The door reluctantly opens to reveal a rickety staircase descending into darkness.

>i
You are carrying:
A brass lantern
A glass bottle
The glass bottle contains:
A quantity of water

>take sword
Taken.

>d
You have moved into a dark place.
The trap door crashes shut, and you hear someone barring it.

It is pitch black. You are likely to be eaten by a grue.
Your sword is glowing with a faint blue glow.

>turn on lantern
The brass lantern is now on.

Cellar
You are in a dark and damp cellar with a narrow passageway leading north, and a crawlway to the south. On the west is the bottom of a steep metal ramp which is unclimbable.

>n
The Troll Room
This is a small room with passages to the east and south and a forbidding hole leading west. Bloodstains and deep scratches (perhaps made by an axe) mar the walls.
A nasty-looking troll, brandishing a bloody axe, blocks all passages out of the room.
Your sword has begun to glow very brightly.
The troll swings; the blade turns on your armor but crashes broadside into your head.

>kill troll with sword
You are still recovering from that last blow, so your attack is ineffective.
The troll swings his axe, but it misses.

>g
You charge, but the troll jumps nimbly aside.
The axe sweeps past as you jump aside.

>g
The troll is staggered, and drops to his knees.
The troll slowly regains his feet.

>g
The fatal blow strikes the troll square in the heart: He dies.
Almost as soon as the troll breathes his last breath, a cloud of sinister black fog envelops him, and when the fog lifts, the carcass has disappeared.
Your sword is no longer glowing.

>score
Your score is 35 (total of 350 points), in 18 moves.
This gives you the rank of Amateur Adventurer.

DrupalZM - Opening the Small Mailbox Reveals…

Even though it seems like I encounter a new set of issues at every step, things are progressing really nicely with the zmachine module. The lexical parser is done, it parses the input buffer and creates the parse table, looking up each word in the game dictionary. I had a few bugs with memory addressing and setting attributes of objects, but those are cleared up now.

I dont have any user interface to put commands into the input buffer yet, but I am able to set a "script" in the program so it will execute commands one by one, as can be seen below. This shows how much progress is done - as can be seen, it recognizes commands properly, but there are still a few bugs (notice how even though I take the leaflet and its in my inventory, its still in the mailbox as well - I'm not updating the objects 100% correctly yet). Also, if you try to move from the first room it crashes, which I think is actually related to the previously mentioned object issue. But anyway - here's a nice transcript of how much is working so far!

ZORK I: The Great Underground Empire
Copyright (c) 1981, 1982, 1983 Infocom, Inc. All rights reserved.
ZORK is a registered trademark of Infocom, Inc.
Revision 88 / Serial number 840726

West of House
You are standing in an open field west of a white house, with a boarded front door.
There is a small mailbox here.

>open mailbox
Opening the small mailbox reveals a leaflet.

>take leaflet
Taken.

>read it
"WELCOME TO ZORK!

ZORK is a game of adventure, danger, and low cunning. In it you will explore some of the most amazing territory ever seen by mortals. No computer should be without one!"

>look
West of House
You are standing in an open field west of a white house, with a boarded front door.
There is a small mailbox here.
The small mailbox contains:
A leaflet

>i
You are carrying:
A leaflet

>jump
Are you enjoying yourself?

>jump
Wheeeeeeeeee!!!!!

>jump
Very good. Now you can go to the second grade.

>take me
How romantic!

>hello sailor
Nothing happens here.

>look at me
That's difficult unless your eyes are prehensile.

>quit
Your score is 0 (total of 350 points), in 11 moves.
This gives you the rank of Beginner.
Do you wish to leave the game? (Y is affirmative): >
Ok.

Now to fix things up with the objects!

Next Page »