top of page

Link’s Awakening: An Ironic Exploit

  • bigmekben
  • Jun 17, 2023
  • 2 min read

Do you remember the first Zelda game for Game Boy? There was a shop where you had to bring the item to the clerk at the counter to pay for it.

  • If you carried the item to the shop exit without paying, the clerk’s dialog would prevent you from exiting the store. To leave, you either had to put the item back on the shelf or pay for it.

  • But you could also shoplift the item. The clerk would turn to follow you as you moved around the room, even if you walked behind him. So, you could “kite” the clerk’s vision by walking around his desk in circles. This would allow you to exit without the blocking dialog.

After doing this, NPCs would start calling you ‘THIEF’ instead of whatever name you picked for your save file. This must have been deliberately programmed into the game code, so it couldn’t be a glitch or bug. If it was a bug, how would the NPCs know to start calling you “THIEF”? I’d call it an Easter Egg.

Here is the irony that I see: nowadays, programming something like this would be no big deal, let’s say using Unity or Unreal, PyGame, etc. But in the Game Boy days, every line of code took up precious bytes of space on the small chip in the cartridge. The coding and testing were more involved, too. The mechanic (detecting when the player turns to a life of crime) only occurs in one place in the game, the one shop. There is no reusability demonstrated. So, who approved this use of resources and how did they justify it?

When I say "use of resources", I include the following considerations:

  • Paying someone to write the code.

  • Paying someone to test the code. (I assume the exploit wouldn’t be kept a secret from the testers; as in, “let’s see if the testers notice it”.)

  • Dedicating space on the ROM chip in the Game Boy cartridge.

  • Risking other code being difficult to reach using assembly language code flow, since the rest of the code would be displaced by however many bytes. (At least there was no cache miss to worry about.)

Another way to look at this is as a puzzle or challenge. The producer must have approved the use of resources to code the clerk watching the player. Perhaps it only took a few extra bytes of code to set a flag if the player escaped the shop with the unpaid item. Then, the code that loads NPC dialog might have a simple check to determine what player name to insert into the dialog. Perhaps it doesn't amount to too many extra bytes of assembly, after all.

But on the other hand, the whole mechanic of the clerk watching you and commenting on trying to leave with unpaid items certainly takes a significant amount of assembly code. My point about someone approving that use of resources still stands. And remember, this shop/shoplifting mechanic is only used in one place in the game!

Food for thought, if you were the producer of a game back then of similar scope, using Game Boy technology, would you approve this mechanic? Please give your thoughts in the comments.

 
 
 

Comments

Couldn’t Load Comments
It looks like there was a technical problem. Try reconnecting or refreshing the page.
bottom of page