Advent Calendar 20: "Silly. Didn't you know? This IS Hades!"

Testing a video game is an involved process. There's a lot of content to get through. While simple platformers or shoot-'em-ups tend to derive their "playtime" from skill-building repetition, and visual novels from multiple story paths, RPGs tend to be 20+ hours just to get through the main linear plot, and run up to 60+ hours of "playable time" if you feel the need to 100% all of the side quests and minigames. Playtesting the very beginning of the game is easy -- just pop it in and start a new quest. But how do you check the rest of it? You cannot demand that your playtesters run through thirty hours of gameplay to test one thing you changed near the end and report back "yo, it's still broken".

Enter the "debug room".

In order to understand what these are and how they work, you need to know a little bit about how RPGs are constructed. The game tracks your progression through the plot through "flags", specific variables that are set to "true" once a condition is fulfilled, but remain set to the default "false" if it isn't. These flags record whether the player has viewed a particular cutscene, possesses a particular item, defeated a particular monster, attained (or exceeded) a particular level, or chosen a particular option in a conversation tree. Any time the player reaches a spot in the game where a story event may at some point occur, the game checks all of the relevant flags, and presents content based on what combination of them are set/unset.

As a simple example, let's say the player is supposed to see a short cutscene the first time they walk into a town, and only the first time. So every time the player walks into that town, the game checks to see if a flag called "town_already_visited" is set. If and only if the flag is still set to "false", the game plays that scene and then sets the flag to "true". If the flag is set to "true", then the scene is skipped. 

Obviously things get much more complicated in an RPG where there are a bazillion things the player needs to do in sequence to get to the end of the story. Technically, the Nth plot point depends on all of the preceding (N-1) plot points having been completed, but the list balloons very quickly, especially if the game offers alternate paths to achieve the same goals, so most of the time the programmer will just check for one or two of the most important things that must have happened to get the player to this point, and assume that all the conditions to meet those previous goals have also been fulfilled. This is what speedrunners are taking advantage of when they "sequence break" -- they work out what specific flags must be set to trigger other flags necessary to progress the game, and try to figure out alternate ways of getting them set so they don't have to go through the entire preceding chain of dependencies.

All of this boils down to the idea that testing "later parts of the game" isn't really testing "what happens after you've been playing for a long time", but "what happens when a specific combination of flags is set". So what a debug room does is give the testers a way to control which flags are set, one by one, without having to play through the events that would normally control them.

Why is it a debug room though? Well, the most orderly way to access the flags is through a set of nested menus. Games with simpler progression logic like platfomers or shmups usually just use a dedicated debug menu, with options to edit the player's health, number of lives, and power-ups, and then select which level to play directly. They're pretty small and a lot of times they're just left in the game code for release, with or without remembering to disable player access first. This would be a daunting proposition for an RPG, though. They are exponentially more complicated; you would basically have to build an entire temporary interface for all of the layered menus necessary to access all the variables that need to be tested, and playtesters would quickly get lost in the pages and pagers of hierarchical text. 

Instead of wasting time on that, programmers just build a menu system that is more visually navigable, hence easier to keep track of, using assets that are guaranteed to be there because they're used by the rest of the game. They create a map, or set of maps, disconnected from the maps that make up the player-accessible game world, and populate them with people or objects that can be interacted with to trigger text boxes with dialogue options that serve to navigate through the various story flags. RPG stories are generally organized into logical 'chapters' or 'sections' (which may or may not be made visible to the end user) with nested sequences of flags largely confined to that chapter. Once all of the chapter flags are set appropriately, the 'chapter end' flag is set, and the game moves on. Debug rooms are used as a quick and easy way to set either these big flags, or a series of smaller ones within chapters, and as a more universal way to change stats, equipment, or party members in games where you can swap characters in and out.

Perhaps the best-known debug room (at least in the English-speaking world) is the one in Final Fantasy VII. The game was a smash hit on Playstation, and the subsequent rapid release of the PC port allowed hackers to get into the debug room directly, without having to buy a cheat device like the GameShark as was necessary on the PSX release. TetraBit Gaming has an excellent overview of what's in there; if you want the more technical side of things, The Cutting Room Floor is a good place to start.

This one has for the most part been translated into English, as have many other examples. You may wonder why that happened, inasmuch as bug testing would have been completed on the Japanese original. For starters, the localization team may not have realized they were translating the dialogue in the debug room -- translators don't get a game script per se, just a big spreadsheet containing all of the individual dialogue bubbles and text labels in the game, row by row. They don't necessarily know where any of them occur until the first rough translation draft has been reinserted into the game, and testers can see them in context. The debug room is handy for that, so while they may not bother to fix typos or go back and translate anything they skipped the first time, they generally just leave whatever rough draft translations happened to land back in said debug room for the benefit of localization playtesters. Other "text" in the debug room may simply be graphics used as floor textures (or occasionally drawn using tiles, which the translators can't see because they don't get the map files), which are left alone.

There are a few cases where "debug rooms" were not used directly for testing, but as a creative error trap. One dude who worked on a bunch of Sega Genesis games got tired of having to track down bizarre bugs that relied on things almost no one would ever do, like leave the game running unattended for days on end, and started redirecting errors to a "secret time warp" in Toy Story, or "secret level select" in Sonic 3D. Rather than crashing, this allowed the game to quietly reset itself to a known good state so it could carry on. 

A similar error trap exists in The Legend of Zelda: A Link To The Past, which drops Link into a "top secret room" whenever it loses its place during a map transition and can't figure out what room Link is supposed to be entering. There's an additional mystery attached to this one: The North American release calls it the "Chris Houlihan" Room, ostensibly named after a kid who won the honor as a prize in a contest run by Nintendo. In the three decades since, no one has ever come forward to identify themselves as the Chris Houlihan in question, and despite a fair amount of looking, no one has ever been able to find him. On top of that, no one has ever been able to track down the author of the first internet post describing how to get into the room, or pin down exactly when the discovery was made.

Comments

Popular posts from this blog

The mystery of "Himmmm"

Fun things to feed rats