Reading Time: 13 minutes

The Hugo series on this blog: Part 1: Hugo's House of Horrors (1990) · Part 2: Hugo II, Whodunit? (1991) (you are here) · Part 3: Hugo III, Jungle of Doom! (1992) · Part 4: Nitemare-3D (1994)

In 1990 a programmer from England who was writing air-traffic-control software in Massachusetts released a shareware adventure called Hugo's House of Horrors. It took off. A year later David P. Gray did what every developer with a hit does: he made the sequel bigger. Much bigger. Hugo II, Whodunit? is a murder mystery with a French maid, a revolving bookcase, a genie, a hedge maze, a snake with a five-minute venom timer and a trip to another planet in what is definitely not a police box.

In part 1 of this series we rebuilt the first game's 1990 engine in Python. This time we did something different: we went through Hugo II's actual game data, 273 scripts and 968 commands, plus the 1992 manual, the source-based engine code in ScummVM and every interview with Gray we could find. Here's what it all reveals about how this game was put together, and why it drove players up the wall.

Spoilers ahead, including whodunit. If you'd rather solve it yourself, the Hugo Trilogy is sold on GOG and by Gray Design Associates, and ScummVM runs it.

A note on the pictures. There are no screenshots in this post. Every image was drawn from the game's own data (the database ScummVM uses to run it) or by our own code. The real thing is still on sale, and MobyGames and Wikipedia have screenshots if you want to see Penelope in her green outfit.

The facts of the case

Hugo II, Whodunit?
ReleasedShareware v1.0, 10 February 1991 (manual revision history)
Later versions1.1 (May 1991, added a 1-800 number), 1.2 (Feb 1992, installer and a trilogy offer), 2.0 (Sept 1992), 2.1 (May 1994)
AuthorDavid P. Gray, Gray Design Associates (Massachusetts)
NeedsEGA or VGA, 330 KB of free memory, 1 MB of disk
Price to register$20 plus $4 shipping; or all three Hugo games for $40 plus $4
You gota hint booklet and a self-playing version; the trilogy deal added a booklet called The Making of HUGO
Re-released1995 for Windows 3.1 as Hugo's Mystery Adventure, with a mouse interface and MIDI music
TodayGOG's The Hugo Trilogy; ScummVM's Hugo engine (added in 1.3.0, 2011)

That self-playing version deserves a moment. Registered copies understood HUGO -p: the game would play itself from start to finish using a recorded file, PLAYBACK.DAT, and score the maximum. The manual suggests it for a child too young to play, who can watch it like a story. HUGO -r let you record your own. In 1991 that was a game shipping with its own speedrun.

The story (spoilers)

Hugo and Penelope, recovering from the first game, visit Hugo's Great Uncle Horace at his mansion in England. Penelope takes a nap. Hugo pulls a book from a bookcase, a secret passage swallows him, and he's gone. Penelope wakes to raised voices, peers through a keyhole, and sees Horace stabbed. She faints.

From here on you are Penelope, and the world is huge: the mansion's three wings, a garden with Venus flytraps and a bug zapper surrounded by killer bees, a stream with a rickety bridge, a dog kennel, caves full of rope and dynamite, a genie in a lamp, a safe with a will inside, an entire hedge maze, and a telephone box that takes you to another planet. There she meets a man who calls himself the Doctor and a metal monster bent on destroying the universe. You'll also run into the old man from Hugo's House of Horrors. He has more trivia questions, and Penelope, unlike Hugo, doesn't have the patience for them.

At six o'clock the police arrive, the suspects are gathered (including, for some reason, the snake), and you're asked who did it. The answer is: nobody. Horace and Cousin Harry were rehearsing a play, and Hugo was locked in the laundry room the whole time. You're entitled to feel a little cheated. Hardcore Gaming 101 certainly did.

Why Penelope?

Gray grew up in Britain on Agatha Christie, and in a 2008 interview with RGB Classic Games he said he'd tried to honour her habit of introducing the murderer early and then barely mentioning them again. Making Penelope the lead was deliberate. In his words it was "an effort to break the mold and have a female hero." As we'll see, under the hood it was done with a very neat trick.

Hugo II by the numbers

Everything below was counted from the database ScummVM uses to run the DOS version (hugo.dat, which the ScummVM team built with Gray's cooperation). Here it is next to the other two games:

Bar charts comparing the three Hugo games on screens, objects, scripts, script commands, verb words, noun words and maximum score
The trilogy in numbers. Hugo II is the giant: 104 screens, 86 objects, 968 script commands and 350 points.
MeasureHugo 1 (1990)Hugo II (1991)Change
Screens17104 (39 places + 64 maze squares + intro)6x
Objects5386+62%
Scripts / commands156 / 450273 / 9682.2x the commands
Words the parser knows95 verbs, 246 nouns130 verbs, 361 nouns+40%
Exit and trigger zones2777nearly 3x
Maximum score190350+84%
Scripts that end the game46more ways to die

Gray knew exactly what he was doing. He told RGB Classic Games he'd read about the second-system effect: Fred Brooks's warning that the follow-up to a small, elegant system tends to become an overstuffed monster. Then, he joked, he followed that prescription to the letter.

The world, as the data wires it

Each screen in a Hugo game has invisible rectangles, called hotspots, that run a script when you walk into them. Most of those scripts end in NEW_SCREEN, so by following them we can draw the whole map. Solid lines are ordinary exits. Dashed ones are scripted moves: the secret passage, falls and the phone box.

A network diagram of Hugo II's 40 places, coloured by area: mansion, grounds, caves, another planet and the maze
Hugo II's map, generated from its exit scripts. The 64 maze squares are folded into one yellow node.
Animation: the network diagram growing outwards from the front of the house
The same map, explored breadth-first from the front door.

A few of the internal screen names are jokes in their own right. The alien planet is retupmoc, which is computer backwards. The telephone box object is called tardis, and its malevolent metal inhabitant is alek. Gray said the character is definitely not a Dalek and the gadget you're given is a sonar screwdriver, not a sonic one. He also admitted to being a lifelong Doctor Who fan whose favourite is Tom Baker. The data shows the Doctor wanders the room aimlessly while the not-a-Dalek moves in chase mode.

A DOS-style text box describing the Doctor, over a plain blue play area
The game's own description of the Doctor, in the original 8×8 DOS font. (Box drawn by us; text from the data.)

The maze: 64 screens, 16 names

HG101 complained that you have to wander the hedge maze collecting items with no navigation help at all. RGB's reviewer drew a map on paper. In the data, the maze is beautifully economical.

Screens 39 to 102 are maze squares, and a single command, INIT_MAZE, switches the engine into maze mode with five numbers: a grid size (8), a box inside each screen (x from 50 to 260, y from 37 to 154), and where to put you when you arrive. Walk out of the box and the engine does arithmetic instead of following an exit: left is screen −1, right is +1, up is −8, down is +8. It then reuses one shared "new screen" script, overwriting its destination before running it.

An 8 by 8 grid of maze squares, each labelled with its screen name number and index, with the bell, gun and serum bottle marked
The maze as the engine sees it. You enter at 'mazex' from the garden gates. The bell, the gun and the bottle of SERUM all start in here.

Look at the names. All 64 squares share just sixteen screen names (maze1 to maze15, plus mazex for the entrance), and maze6 alone appears eleven times. That strongly suggests Gray drew a small kit of hedge pictures and tiled them into a large, confusing maze for very little disk space. It's a trick worth knowing when your game ships on floppies.

Our first guess was that the numbers 1–15 were four-bit codes for which sides are open, which would have let us rebuild the maze. We tested all 24 ways of assigning bits to directions, and none fits: the best still contradicts its neighbours 44 times. So the numbers are simply picture IDs, and drawing the real maze would need the pictures themselves.

There's a footnote from the 21st century, too. Each screen has a table of things you can type about its scenery, but the table only has 39 entries, one per real location. Type something in a maze square and the original engine reads past the end of it. ScummVM's code carries a workaround labelled as an original bug that returns early when you're in the Hugo II maze.

Why the flytraps feel so unfair

Gray didn't defend the two most-hated scenes. Asked about the Venus flytraps and carrying matches across the bridge, he simply agreed that both were too hard. He thought it was probably an attempt to make the game last longer. HG101 described players stepping pixel by pixel and saving after every safe step, and noted that you can die without touching the plants.

The data explains why. The flytrap screen has three hotspots. Two are ordinary exits at the left and right edges. The third is a rectangle about 267 by 62 pixels covering the whole field, and its script is a death: text, a collapsed Penelope, game over.

A diagram of the Venus flytrap screen: two green exit zones at the edges and a large red death zone between them, with the flytrap heads, flies and magnifying glass marked
Screen 'venus', drawn from its hotspots and objects. The magnifying glass at (95,96) sits one pixel above the red zone.

What makes it cruel is when the engine checks hotspots. It only does so when the walker bumps into a wall, and then it tests the leading edge of the walker's feet. Inside the red box, the plants are walls in the screen's boundary mask. So the rule is not "don't step on a plant" but "don't bump into anything anywhere in this box". The walls are invisible, a few pixels wider than the drawings, and fatal.

The bridge works the same way. A hotspot sits on the bridge, and its script checks whether you're carrying the matches. If you are, they go in the river. You don't fall, you just lose the matches, and you may not discover you've made the game unwinnable until much later.

A five-minute snake

The first Hugo game scheduled events against the current screen. Leave the room and they're cancelled. Hugo II adds a second kind, AGSCHEDULE, a global timer that survives moving between rooms. The game uses it for its nastiest surprise.

A timeline: bitten at 0, warnings at 480, 1600 and 2320 ticks, game over at 2400 ticks
What happens after the snake bite, read straight from script 120.

When the snake in the snake pit gets you, script 120 queues four global events: messages at 480, 1,600 and 2,320 ticks, then game over at 2,400. At eight ticks a second that's five minutes of real time, to find and drink the bottle marked SERUM, which is somewhere in the hedge maze. The bottle is worth 15 points just for picking it up, the joint-highest object value in the game.

The other five deaths are the killer bees by the bug zapper, a fall into the chasm, the not-a-Dalek on the alien planet, the flytraps, and the rock room. Light the dynamite there and a 40-tick timer starts. If Penelope is still in the room after five seconds, she goes up with the rock.

How Penelope becomes the player

Here's the neat trick. The Hugo engine has a hard-coded idea of the hero: object number 0. The arrow keys steer it, the parser measures "near enough" from it, and exits test its feet. Building a second playable character would have meant changing the engine. Gray didn't. He added one script command, SWAP_IMAGES.

Diagram: object 0 'hero' and object 1 'penelope' with a double arrow labelled SWAP_IMAGES
Penelope is a costume. Hugo II swaps the two objects' sprite sets, and the player keeps steering object 0.

Swap object 0's pictures with object 1's and the thing you steer now looks like Penelope, while the "Hugo" in the room is just an ordinary scripted object. Hugo II uses the trick three times, at the hand-overs between the two characters. Hugo III goes on to use it 18 times, and it turns out to be how that game does its famous perspective. More on that in part 3.

Clues hidden in plain text

Most of Hugo II's prose lives in STRINGS.DAT, a scrambled file that isn't in our database, but the replies attached to objects are. They include some lovely touches. In the garden shed, looking at a panel of four coloured buttons gives you a faded label:

Animation: the command 'look at buttons' being typed, followed by a text box describing four coloured buttons and the faded letters b*g *a*pe*
A clue with letters missing: b*g *a*pe* (the bug zapper). Text from the data; screen recreated by us.
  • Reading a letter left on a table turns out to be about Horace's life-insurance policy, a classic Christie red herring, and Penelope politely stops reading.
  • A photo album shows young Hugo with a girl of about his age in front of a huge pointed tower, and Penelope feels she recognises her.
  • The phone box asks for a number, and the will (5 points) only gives up its small print to someone holding the magnifying glass.
  • Cousin Harry is sometimes too convulsed with laughter to talk, and if you try to pry, the game warns that Great Aunt Hester will see you.

The case is a five-bit number

HG101 noticed that the police won't gather the suspects until you've found enough. The data shows exactly what "enough" means. The policeman object carries a number, and five scripts each switch on one bit of it with the new SET_STATE_BITS command. Every time you walk into the lounge, a script checks whether the number has reached 31, binary 11111.

Five boxes, one per clue bit (1, 2, 4, 8, 16), adding up to 31, which summons everyone to the lounge
The five clues as the engine counts them, and who gets summoned when you have them all.

When it has, script 136 moves nine characters into the lounge: the policeman, the maid, Great Aunt Hester, the gardener, the snake, the genie, Cousin Harry, the Doctor and the cook. Twenty ticks later the game asks you who did it. The answer box accepts four different phrasings of the right answer. Get it right and you earn a bonus worth exactly one point. Get it wrong and the story ends the same way, with different text and no point. In a murder mystery, solving the murder is the smallest prize in the game.

Where the 350 points come from

Bar charts of Hugo II's object values and its 30 bonus awards
115 points from 15 objects plus 235 from 30 bonus awards. The engine adds the same two sums to display 'of 350'.

The most valuable things to pick up are the magnifying glass from the flytrap field, the sonar screwdriver and the serum, at 15 points each. The biggest single bonus is worth 20. Compare the first game's tidy 190: Hugo II nearly doubles it, and Hugo III goes back down to 128.

The disk, the files and "We're not proud!"

Hugo's House of Horrors kept each screen in four separate files: a picture, a wall mask, a foreground mask and a foreground-base mask. With 104 screens that would have meant over 400 files, so Hugo II packs everything into three databases.

Diagram of the Hugo II files and the eight 32-bit fields of a SceneBlock record
What's on the disk. Each screen has a SceneBlock header giving offsets and lengths for its picture and three masks.

The masks are compressed with Apple's PackBits run-length scheme. Above that decoder in ScummVM's code, which is based on Gray's original source, sits the comment "(We're not proud!)". Shareware developers borrowed from everywhere.

The script language grew too. Hugo II introduced commands for the maze, global timers, flags (set, clear and test individual bits on an object), moving objects between screens, talking lips and palette changes:

A table of script command types and how often each game uses them, with new commands highlighted
Every script command used by the trilogy. Yellow names never appear in the first game.

The music: nine PC-speaker songs

Like the first game, the DOS version has no sound card music. Songs are short strings such as .O2L1CEG^C., played one note per eighth of a second through the PC speaker. We rendered them with the interpreter from part 1, now extended for the ^ and v octave symbols Hugo II prefers.

The tune outside the house (16 seconds).
Piano roll of the Hugo II house tune
The house tune as notes over time.
The organ room: the longest song in the game, first 20 seconds.
On another planet: a pulsing bass figure. Draw your own conclusions.

There's a leftover too. Hugo II's song table still contains the mummy and dog tunes from Hugo's House of Horrors, note for note, yet none of its 273 scripts plays them.

Secrets from the source code

Gray's original source has never been published, but ScummVM's data generator, create_hugo, rebuilds the game data as C source, keeping the original identifiers and many comments. Matched against the database, those names give every one of Hugo II's 272 scripts a label.

  • The right answer is called cheat. The script that runs when you correctly name nobody as the murderer is kALcheat. The wrong-answer ending is kALdidnt. The accusation itself is kALclimax, and gathering the suspects is kALparty.
  • It is a Dalek after all. The robot's object noun is alek, but its kill script is kALdalek and its texts are kSTSdalek1-3. Because the parser matches substrings, typing "dalek" still finds "alek". The Doctor's gift is scripted as kALsonic, and dialling in the phone box runs kALwho.
  • The snake timer is kALnasty, and its four stages are kALpois1 to kALpois4.
  • A script called blah shows a message and then reschedules itself every 96 ticks, which is 12 seconds of someone droning on. Penelope's attack on the old man is kALomgag, and Hugo vanishing behind the bookcase is kALhugone.
  • The flytrap rule is in the original comments. Hotspots "are only checked when hero collides with a boundary, therefore they must always contain a boundary."
  • Nothing is dead. All 272 scripts are reachable and every bonus can be earned, unlike Hugo III (see part 3).

Was it any good?

Reviewers disagree, often within the same review. PC Gamer's Richard Cobbett found it endearingly crazy and better drawn than its predecessor, but hated the puzzle design. Adventure Classic Gaming praised its scope and humour. Hardcore Gaming 101 called it the worst in the series, because of the pixel-perfect scenes and dead ends, but also the best written. Everyone agrees it's much longer: about 45 minutes if you know what you're doing, against 10–15 for the first game.

Gray's own last word on the hard bits is the best one. When he made the 1995 Windows version, he added point-and-click movement where the computer walks Penelope for you. He told RGB that this made it too easy, and you can't please everyone.

What we learned

  1. Engines grow by verbs. Hugo II didn't need a new engine, only a few new script commands: maze mode, global timers, bit flags and image swaps. Data-driven design paid off within a year.
  2. Reuse is invisible when it's done well. 64 maze screens from 16 names, a second hero made from a sprite swap, and music carried over from the first game.
  3. Difficulty can hide in the code, not the design. The flytraps weren't meant to be a precision test. They became one because hotspots are only checked on collision, and the walls were invisible.
  4. Global state is a new kind of fun and a new kind of bug. The five-minute snake needed timers that survive leaving a room. A table sized for 39 screens in a 104-screen game produced a bug that ScummVM still works around.
  5. Second systems are fun to dissect. Gray saw the trap coming and walked into it on purpose.

Sources

  • Hugo II, Whodunit? MANUAL.DOC (1991–92), via the textfiles.com Discmaster archive.
  • Interview with David P. Gray, RGB Classic Games, 2008, and its Hugo II page (version history).
  • David Gray interview, Adventure Classic Gaming, 2011.
  • Hardcore Gaming 101's Hugo series (2017, read via the Internet Archive while the site moves servers).
  • Wikipedia, which summarises the PC Gamer and Adventure Classic Gaming reviews.
  • ScummVM's Hugo engine (GPL-3, based on Gray's source) and its hugo.dat database, which every count and diagram here is built from.

The Hugo series on this blog: Part 1: Hugo's House of Horrors (1990) · Part 2: Hugo II, Whodunit? (1991) (you are here) · Part 3: Hugo III, Jungle of Doom! (1992) · Part 4: Nitemare-3D (1994)

← All articles

Related articles