Walk Through Testing in Sharpee

Walk Through Testing in Sharpee

I started porting Mainframe Zork to burn through the Sharpee platforms issues. This has been an excellent choice since Dungeon is a masterpiece of crazy puzzle illusions.

In order to run testing, I implemented GDT (Game Debugging Tool) which was a part of the original Dungeon PDP-10/11 implementation. It allows the Imps and other developers to debug issues with "god mode". This helped in some ways, but walkthroughs require logic because the game has random reactions to actions. In Dungeon, treasures may have been picked up by the Thief, the Round Room exits randomly until you solve the Tea Room puzzle, and combat uses a melee logic system with odds-based health and hit points.

So we invented a way to write walkthroughs with assertions and logic blocks. Here is the first section of testing in Dungeon (spoilers!):

title: Get Torch Early (Save Lantern Battery)
story: dungeo
description: Priority path - get the torch ASAP to minimize lantern usage. Torch is unlimited, lantern has 330 turns.
---

# ============================================================================
# GOAL: Get torch as quickly as possible
# Critical path: Attic (rope) -> Living Room (lantern, sword) -> Underground -> Dome Room -> Torch Room
# ============================================================================

[GOAL: Collect essential items from house]
[ENSURES: inventory contains "rope"]
[ENSURES: inventory contains "lantern"]
[ENSURES: inventory contains "sword"]

# Start at West of House
> look
[OK: contains "West of House"]

# Enter house via back window
> north
[OK: contains "North"]

> east
[OK: contains "Behind House"]

> open window
[OK: contains "open"]

> west
[OK: contains "Kitchen"]

> west
[OK: contains "Living Room"]

> take lantern
[OK: contains "Taken"]

> take sword
[OK: contains "Taken"]

> turn on lantern
[OK: contains "on"]

> east
[OK: contains "Kitchen"]

> up
[OK: contains "Attic"]

> take rope
[OK: contains "Taken"]

[END GOAL]

# ============================================================================
# GOAL: Enter underground and kill troll
# ============================================================================

[GOAL: Enter cellar and defeat troll]
[REQUIRES: inventory contains "lantern"]
[REQUIRES: inventory contains "sword"]

> down
[OK: contains "Kitchen"]

> west
[OK: contains "Living Room"]

> move rug
[OK: contains "trap door"]

> open trapdoor
[OK: contains "open"]

> down
[OK: contains "Cellar"]

> east
[OK: contains "Troll Room"]

# Kill troll - melee combat with DO/UNTIL loop
# Loops attack until troll dies or player dies (retry handles player death)
[RETRY: max=5]
[DO]
> attack troll with sword
[UNTIL "slumps to the floor dead" OR "removes his head" OR "He dies" OR "You are dead"]
[ENSURES: not entity "troll" alive]
[END RETRY]

[END GOAL]

# ============================================================================
# GOAL: Navigate to Dome Room and use rope puzzle
# ============================================================================

[GOAL: Get to Dome Room]

> north
[OK: contains "East-West Passage"]

> north
[OK: contains "Deep Ravine"]

> west
[OK: contains "Rocky Crawl"]

> east
[OK: contains "Dome Room"]

[END GOAL]

# ============================================================================
# GOAL: Tie rope and descend to Torch Room
# ============================================================================

[GOAL: Get the torch]
[REQUIRES: inventory contains "rope"]
[ENSURES: inventory contains "torch"]

> tie rope to railing
[OK: contains "rope"]

> down
[OK: contains "Torch Room"]

> take torch
[OK: contains "Taken"]

[END GOAL]

# ============================================================================
# GOAL: Switch to torch, save lantern battery
# ============================================================================

[GOAL: Switch light sources]

# Torch is always lit (perpetual flame) - no need to switch on
> turn on torch

> turn off lantern
[OK: contains "off"]

# Verify we still have light
> look
[OK: contains "Torch Room"]

# Down to underground
> down
[OK: contains "North/South Crawlway"]

# South and Northwest to Gallery
> south
[OK: contains "Studio"]

> northwest
[OK: contains "Gallery"]

# We'll get the painting on the way out of the bank

[END GOAL]

# Save checkpoint for next walkthrough
$save wt-01

And here is the second:

title: Bank of Zork Walkthrough
story: dungeo
description: Get portrait and zorkmid bills from Bank. Restores from wt-01 (starts at Gallery).
---

# Restore state from wt-01 (player at Gallery with torch, lantern, sword, rope)
$restore wt-01

# Start at Gallery (from torch transcript)
# Path to Bank: Gallery → W → Bank Entrance

# Navigate to Bank Entrance
> west
[OK: contains "Bank Entrance"]

# First get portrait from Chairman's Office
> northeast
[OK: contains "East Teller"]

> south
[OK: contains "Chairman"]

> take portrait
[OK: contains "Taken"]

# Now navigate to Safety Depository for the wall-walk puzzle
> north
[OK: contains "East Teller"]

> west
[OK: contains "West Teller"]

> west
[OK: contains "Safety Depository"]

# Wall-walk puzzle sequence:
# 1. Curtain → Small Room
# 2. South wall → Safety Depository (unlocks curtain to Viewing Room)
# 3. North wall → Vault (get zorkmid bills)
# 4. North wall → Safety Depository
# 5. Curtain → Viewing Room (escape)

> walk through curtain
[OK: contains "disoriented"]
[OK: contains "Small Room"]

> walk through south wall
[OK: contains "disoriented"]
[OK: contains "Safety Depository"]

> walk through north wall
[OK: contains "disoriented"]
[OK: contains "Vault"]

> take zorkmid bills
[OK: contains "Taken"]

> walk through north wall
[OK: contains "disoriented"]
[OK: contains "Safety Depository"]

# Curtain now leads to Viewing Room (set by south wall walk earlier)
> walk through curtain
[OK: contains "disoriented"]
[OK: contains "Viewing Room"]

# Exit via Bank Entrance
> south
[OK: contains "Bank Entrance"]

# Return to Gallery
> east
[OK: contains "Gallery"]

# Verify we have both treasures
> inventory
[OK: contains "portrait"]
[OK: contains "zorkmid"]
[OK: contains "torch"]

# Save checkpoint for next walkthrough
$save wt-02

I'm going to skip to the sixth test because it has round room complex logic gates:

title: Exorcism (Bell/Book/Candle Ritual)
story: dungeo
description: Perform exorcism ritual at Entry to Hades. Restores from wt-05.
---

# Restore state from wt-05 (player at Living Room with torch + lantern)
$restore wt-05

# ============================================================================
# GOAL: Verify starting state
# ============================================================================

[GOAL: Verify starting state]

> look
[OK: contains "Living Room"]

> inventory
[OK: contains "torch"]
[OK: contains "lantern"]

[END GOAL]

# ============================================================================
# GOAL: Navigate to Round Room
# Living Room -> Cellar -> Troll Room -> EW Passage -> Round Room
# ============================================================================

[GOAL: Navigate to Round Room]

> down
[OK: contains "Cellar"]

> east
[OK: contains "Troll Room"]

> north
[OK: contains "East-West Passage"]

> east
[OK: contains "Round Room"]

[END GOAL]

# ============================================================================
# GOAL: Traverse Round Room carousel to Grail Room
# Carousel is spinning (isFixed=false) - exits are randomized.
# Any direction you pick, you land at a random exit EXCEPT where you tried to go.
# Use DO-UNTIL: go south (not east, since east=Grail Room would be excluded),
# handle each possible landing, navigate back to Round Room, repeat.
# ============================================================================

[GOAL: Get to Grail Room via carousel]

[WHILE: not location = "Grail Room"]
  > south
  [IF: location = "East-West Passage"]
    > east
  [END IF]
  [IF: location = "Deep Canyon"]
    > southeast
  [END IF]
  [IF: location = "North/South Passage"]
    > southwest
  [END IF]
  [IF: location = "Winding Passage"]
    > northwest
  [END IF]
  [IF: location = "Engravings Cave"]
    > north
  [END IF]
  [IF: location = "Maze"]
    > northeast
  [END IF]
[END WHILE]

[END GOAL]

# ============================================================================
# GOAL: Navigate to Altar and collect exorcism items
# Grail Room -> UP -> Temple -> E -> Altar
# ============================================================================

[GOAL: Get exorcism items]
[ENSURES: inventory contains "bell"]
[ENSURES: inventory contains "book"]
[ENSURES: inventory contains "candles"]

> up
[OK: contains "Temple"]

> east
[OK: contains "Altar"]

> take bell
[OK: contains "Taken"]

> take book
[OK: contains "Taken"]

> take candles
[OK: contains "Taken"]

[END GOAL]

# ============================================================================
# GOAL: Navigate to Entrance to Hades
# Altar -> W -> Temple -> D -> Grail Room -> E -> Narrow Crawlway
# -> SW -> Mirror Room -> E -> Cave -> D -> Entrance to Hades
# ============================================================================

[GOAL: Get to Entrance to Hades]

> west
[OK: contains "Temple"]

> down
[OK: contains "Grail Room"]

> east
[OK: contains "Narrow Crawlway"]

> southwest
[OK: contains "Mirror Room"]

> east
[OK: contains "Cave"]

> down
[OK: contains "Entrance to Hades"]

[END GOAL]

# ============================================================================
# GOAL: Perform exorcism ritual
# Ring bell, read book, light candles (order doesn't matter)
# Daemon checks completion each turn - wait after all three steps
# ============================================================================

[GOAL: Perform exorcism]

# Step 1: Ring the bell
> ring bell
[OK: contains "resonant"]

# Step 2: Read the black book
> read book
[OK: contains "exorcism"]

# Step 3: Light the candles
> turn on candles
[OK: contains "on"]

# Wait a turn for the exorcism daemon to complete the ritual
> wait
[OK: contains "Time passes"]

[END GOAL]

# ============================================================================
# GOAL: Verify exorcism success - passage east should be open
# ============================================================================

[GOAL: Verify exorcism success]

> east
[OK: contains "Land of the Dead"]

[END GOAL]

# ============================================================================
# GOAL: Return to Living Room
# Land of Dead -> W -> Hades -> UP -> Cave -> W -> Mirror Room
# -> NE -> Narrow Crawlway -> W -> Grail Room -> W -> Round Room
# -> carousel WHILE -> Maze -> W -> Troll Room -> W -> Cellar
# -> UP -> Living Room
# ============================================================================

[GOAL: Return to Living Room]

# Back through Hades to Cave
> west
[OK: contains "Entrance to Hades"]

> up
[OK: contains "Cave"]

# Cave -> Mirror Room -> Narrow Crawlway -> Grail Room
> west
[OK: contains "Mirror Room"]

> northeast
[OK: contains "Narrow Crawlway"]

> west
[OK: contains "Grail Room"]

# Enter Round Room (carousel is still spinning)
> west
[OK: contains "Round Room"]

# Traverse carousel to reach Maze (Maze-01 has WEST -> Troll Room)
[WHILE: not location = "Maze"]
  > south
  [IF: location = "East-West Passage"]
    > east
  [END IF]
  [IF: location = "Deep Canyon"]
    > southeast
  [END IF]
  [IF: location = "North/South Passage"]
    > southwest
  [END IF]
  [IF: location = "Winding Passage"]
    > northwest
  [END IF]
  [IF: location = "Engravings Cave"]
    > north
  [END IF]
  [IF: location = "Grail Room"]
    > west
  [END IF]
[END WHILE]

# Maze-01 -> Troll Room -> Cellar -> Living Room
> west
[OK: contains "Troll Room"]

> west
[OK: contains "Cellar"]

> up
[OK: contains "Living Room"]

[END GOAL]

# ============================================================================
# GOAL: Verify final state for next segment
# ============================================================================

[GOAL: Verify inventory for next segment]

> inventory
[OK: contains "torch"]
[OK: contains "lantern"]

> look
[OK: contains "Living Room"]

[END GOAL]

# Save checkpoint for next walkthrough
$save wt-06

# SUCCESS! Exorcism complete
# Spirits banished, passage to Land of Dead now open
# Player in Living Room with torch + lantern + bell + book + candles
# Ready for next segment

We now have 13 working walkthroughs and over 500 points with only a few more puzzles to solve, then the end game. I wildly underestimated the complexity of Dungeon when I started this port and was wildly over-confident in the level of completion Sharpee had reached. I'd still say the foundation of Sharpee has held up. Fewer and fewer platform changes occur as the port of Dungeon nears completion and most of those are very small bugs, not systemic issues.

Subscribe to My So Called Interactive Fiction Life

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe