In This Zelda-Style Game, You Hack the Source Code With Your Sword

I was a little bit intimidated when I sat down to play Hack 'n' Slash, a Legend of Zelda-style adventure that challenges you to solve puzzles by actually reprogramming the game.
Image Double Fine Productions
Image: Double Fine Productions

SAN FRANCISCO -- I'm not a hacker. I don't know how to code. A programmer friend recently joked that I "couldn't tell Boolean from bit shifting" and I don't know what that means.

So I was just a little bit intimidated when I sat down to play Hack 'n' Slash, a Legend of Zelda-style adventure that challenges you to solve puzzles by reprogramming the source code of the game itself.

But if you don't have any programming knowledge—as I assuredly did not—don't worry. Like most intrepid adventure game heroes, you're probably more prepared for the journey than you imagine.

“Hacking is just puzzle solving,” says creator Brandon Dillon as we sit down to play the game at Double Fine Productions' office. “Anyone who engages with a puzzle action game like Zelda—they've already got the skills to understand all this.”

At first glance, Hack 'n' Slash seems like a comfortably familiar homage to the iconic Nintendo game: an elf hero crawling through dungeons and battling enemies with a magic sword. Take a closer look at the end of that blade, however, and you'll notice something very unusual: a USB plug.

“The sword doesn't do normal damage,” says Dillon. This is a weapon designed for a very different kind of hacking. Rather than slicing open your enemies physically, the blade is a digital scalpel that allows you to cut into the code of the game itself. Swing your sword at any item or foe with a USB port, and it opens a hacking interface that gives you access to the variables in your target's code: speed, movement, power, etc.

That's when you realize this game isn't trying to imitate The Legend of Zelda. It's trying to show you how much fun it would be hack The Legend of Zelda.

The hero of Hack 'n' Slash, which is available now for $20 on PC, Mac and Linux, is an elf named Alice. It's partly a reference to Applied Cryptography, a seminal hacker book that often illustrated its ideas through parables about characters named Alice and Bob. (Bob shows up later in Hack n Slash as well, as a sprite similar to Navi from The Legend of Zelda.) It's also a shoutout to Alice in Wonderland, a story whose main character demonstrates the sort of “cleverness and bravery in the face of the the universe's essential weirdness” that Dillon wanted to demonstrate in his own protagonist.

As Alice, you win not by defeating enemies through traditional combat, but by finding elegant or ingenious ways to negotiate the world around you by altering the code that defines it. Faced with a hulking, brutish guard brandishing a spear, you can't damage him physically, but you can disarm him by sneaking up behind him, swinging your USB sword, and changing the value of his "damage" variable to zero.

Alternately, you can set his speed to a negative number, so that whenever he tries to chase you, he ends up moonwalking in the opposite direction.

Although this sort of code manipulation is usually seen as breaking the rules of videogames, Hack 'n' Slash makes it fundamental to the game. It's not a way of cheating your way to a solution—it is the solution. The puzzles are designed to demonstrate the pleasure of digging down into the code and finding clever ways to turn the traditional rules of an adventure game on their head.

It's a fascinating inversion of the traditional Zelda adventure—not just conceptually, but on the most basic, mechanical level. Where most games like this use code to emulate combat, Hack 'n' Slash uses combat to emulate code.

Screen Shot 2014-04-29 at 7.03.24 PM

Manipulating other variables in the game allows you to slow down time, change the way characters move and even hack into your own character to change how you look and behave. Does a bridge need to be longer in order to reach across a chasm? Head into the room that controls it and change the “data crystal” that controls the number of tiles. Now it's longer. This isn't a superficial manipulation, either; when you use your sword to change the code of the game, you actually change the code of the game.

“If you can change the code itself, doesn't that mean that you can break the game?” I ask.

“Oh yeah, totally,” says Dillon. “Because you're basically writing code, you can absolutely do something that would introduce a crash.”

But just like dying in a video game where you have infinite lives, breaking Hack n' Slash isn't the end of the world. If you make a catastrophic code change, you simply roll the game back to where you made a mistake, and try something different. Restoring a saved game now becomes a lot like debugging, which in turn is a lot like trying to solve a puzzle. But instead of lighting torches or flipping switches to reveal secrets, you're reaching into the fundamental structure of the game itself to hack them open.

“For me, the origin of all of this was playing old NES games and emulators when I was a kid,” says Dillon. (The Hack 'n' Slash trailer even parodies a memorable Zelda commercial from the 80s.) Using emulators, he could mess around in the memory of games and change certain values to give himself infinite health, or make enemies less difficult, the same sort of things that cheat devices like Game Genie used to enable.

“I did not have the emotional maturity to deal with Contra at the time,” he laughs. “But when I brought that game into an emulator, I got to make it my own.”

Even though Dillon wasn't getting the gameplay experience that the game's creators had intended, he didn't see his adjustments as cheating. He saw it as creating a different version of Contra entirely, one that worked exactly the way he wanted it to.

With Hack 'n' Slash, Dillon has created a game that allows every player to have that same sort of experience: peeling back the layers of a classic game, throwing open the locked doors or its mechanics, and playing it from the inside out.

Later in the demo, opening a treasure chest reveals a book whose title looks awfully similar to a filepath. That's because it is actually is a filepath.

“The books in the game are literal files in the game's file system,” says Dillon. “When you modify a book in the game, you're actually changing one of the files that the game uses... None of this stuff is fake. It's all generated from the actual source code that we compiled into the game.” Eventually, he says, your character will encounter an entire library that contains most of the files in the game and allows you to manipulate them at will.

The sheer openness and transparency of the game can take a moment to fully comprehend, particularly if you're accustomed to playing by the rules. In one room, opening a treasure chest yields an “artifact” that controls the maximum health of your character. (He tells me this is a “global variable” in programming terms. In Zelda language, it's how many hearts you can have.)

I watch as Dillon increases it from three hearts to ten, then fifty, then a hundred and climbing. When I ask him what the limit is, he shakes his head. There isn't one. “We could hold this button down for days.” Briefly, I wonder what the point of the game is if you can't die anymore, but then I realize that is the point.

“One of the joys of having a game where you can hack everything is that you can break all of the basic mechanics that you're used to in a game like this,” says Dillon. “Once hearts don't mean anything, where do we go from there? The game has to become about something else.”

Dillon hints that later in the game, the player will have to battle—or more likely, circumvent—something very much like DRM. “Hackers are playing a different game, which is: 'Can I hack the developer?'” says Dillon. “The developers who actively participate in that... are actually putting stuff in their code to prevent or detect hackers, so the natural endgame here is the game fighting against you as you're trying to hack it.”

The irony, of course, is that while Hack n' Slash might pretend to resist your manipulations, it not only wants you to hack it; it demands it. Rather than emulating Zelda, it asks you to drop Inception-style into the second, more complex game inside it, where the real battle is not against the enemy on the screen, but the gears that turn behind it.