King’s Quest VI – Tile Maze

We gotta do one for the speedrunners. They say we never do one for the speedrunners!

Tile maze diagram from a one hundred page speedrunning guide

A hobby of mine is hunting and eradicating Sierra bugs for ScummVM. A fun part of this has been discovering how many subcultures are out there. My favorite is the King's Quest speedrunning (speedrunning?!) community. As the name implies, they're obsessed with completing old adventure games as fast as possible, but what I can't get over is that they've been doing so for years and are thriving. In just the last few days these plucky fanatics have broken their own world records and whenever one of them streams an attempt they all seem to attend. These people are clearly afflicted but have channeled what should be a crippling debilitation into an implausible delight.

I'm now convinced they're the only ones using computers correctly.

Speedrunners are the best bug hunters. They click too fast, they go looking for trouble, and they relentlessly cover the same worn ground again and again with endless enthusiasm. When they find something new they write it up and post videos. I'll take that over a bug tracker any day! The King's Quest VI community* has been on the warpath lately and flushed out a bunch of interesting crashes and random lockups. Each of these abruptly ended someone's run but gave me the footage to figure out the problem and write a patch. Thanks to their heroic sacrifices, these game-breaking bugs from 1992 are now fixed in ScummVM forever. It seems only fair to return the favor.

just sluicin' through the tile maze, no big deal

The KQ6 tile maze is the last in a series of intensely integrated copy protection puzzles. It's a room with twenty tiles that have to be stepped on in the correct order. One misstep and you git got by flying spikes. A printed guidebook includes a poem with the necessary clues which I was floored to figure out in 1993.

The tile maze isn't difficult, but it is a tax. Once memorized, you can knock it out pretty quickly. Speedrunners have gotten this down to an obscene four to five seconds but it requires a lot of concentration and plenty of runs end right there. Have they considered just... skipping it?

The tile maze can be completely skipped by pressing the ALT key. Now that's how you bury a lede! ALT‑clicking bypasses all of the tile code and allows you to walk about the room freely. Just ALT‑click to the final blank tile and then exit the room normally and you can even claim points for solving the puzzle. That's an important detail to speedrunners because they have a "100%" category for getting every point. Puzzle bypasses rarely give credit, and this is the first bypass for this game, so it will be interesting to see how they litigate.

Is this a cheat code? A debugging shortcut for developers? A random mistake? It's hard to find those kinds of answers in a compiled program. Even in simple software, an author's underlying intent is often impossible (or impractical) to determine just from low level instructions. And adventure games are hardly simple, they take on as much complexity as they can handle... or more, judging from all the script patches. It doesn't help that everything is steeped in obsolete technology. And yet it's answers I crave. At the heart of it I think that's what the speedrunners do too. I stopped playing computer games a long time ago because they stopped making these kind, the kind I like, but I didn't stop holding software grudges. I still have questions and I need closure! And that's where it gets interesting, because here in the future we find ourselves in an unusually great position to finally get all of these answers out of Sierra games. Someone oughta blog about it! Speaking of which...

Bypassing the tile maze is indeed a bug. The ALT key isn't special, someone just forgot it existed, and so it slips through some complex code. The tile maze contains custom event handlers to override the normal walk behavior and enforce the path by snapping the player to a tile. Custom handlers intercept events before the normal code and that means they're on the hook for not getting confused by interesting input. Anyone who has written code like this knows that's a terrible position to be in. Obscure shortcuts like CTRL-click and SHIFT-click (which cycle the cursor) must be detected and passed on for normal processing or else they'll unexpectedly trigger the custom code. The tile code handles this by inspecting the modifiers of incoming events to see if it should pass them on, but instead of checking for CTRL or SHIFT explicitly, it bluntly checks if any modifiers are set. That's simpler but it accidentally promotes ALT from an unused modifier to a secret code bypass button. There are a half-dozen or so rooms with this code pattern and ALT glitches them all in various ways. The tile maze just happens to be the one room with useful side-effects.

Now that we understand the bug we can do even better. The tile room exists within a large catacombs maze where each generic room is really the same Sierra room in a different configuration. That's a standard way to make a maze, otherwise you'd be programming sixty rooms instead of one, but it means that both exits in the tile room link to the same room. Extra code is needed to tell the maze which exit was taken but that's the exact kind of code we've been given a physical button to disable at our pleasure. ALT‑click on the edge that you entered from and you'll warp to the opposite room without even walking across the screen. Flaunting spatiality doesn't get you any points but it is faster. Speedrunners also have an "Any%" category where they complete the game with no regard for points so this gives them a different strategy for each.

just warpin' around the tile maze, no big deal

I guess we'll be seeing some new world records! That would be true even without this bug, but this will save those maniacs a few more seconds. I hope it makes their world a little more fun and little less stressful. It it sure looks stressful to me!

This bug is a good example of the kind I won't fix. ALT‑clicking is harmless fun because it rarely does anything and nobody would do it in the first place. Even if you know about it you really have to go out of your way to break things. No normal player is going to trip over this, otherwise I wouldn't be the one breaking the news today. I'm convinced that the tile maze is the only useful ALT‑trick but maybe the speedrunners will find another now that they're on the scent. I wouldn't bet against them, it's what they do. It's all they do.

Of course what KQ6 speedrunners really want to bypass is The Cliffs Of Logic, a literal and figurative monument to copy protection. It's best to not dwell on how long they've spent staring at those stones. The whole ordeal takes several minutes, seventy steps, five puzzles, no mistakes, and a lot of waiting. Minor glitches have been found, and those fuel the dream, but paychecks depended on defending this puzzle. I'm not optimistic. Besides, if you focus too much on the obvious obstacles, you might miss something much more interesting. Just a thought.

Congratulations, you just read an entire article about pressing ALT! Stay tuned for the next time King's Quest VI comes up in the rotation.