Blog Info: I wrote a short hack for Super Mario World a while ago using Lunar Magic. Like most hacks, it was unfairly difficult, gimmicky, and had rather long levels. That’s when I really appreciated the challenge of game design. Years, later, playing Portal, I was impressed by the impact of small, well-designed levels. And unlike my hack, the small levels had multiple solutions, so that lazy skilled players could innovate with some complex procedure while newbies had fun just figuring out the basic puzzle. And that’s when I turned my attention back to ROM hacking.
Back-story: ROM hacking really constrains your options. Zelda 3 has a fully-featured map editor, so you’d think that you have the power to re-arrange and re-create rooms like a giant jigsaw puzzle… except that some of the pieces must be in one place, and some of them will automatically re-write themselves with something else. So today, we’ll just take a very shallow dip into the waters of Hyrule Magic, and end with an extra-long discussion section in preparation for next week.
Goal: Fiddle with the opening scene of LttP, changing graphics, text, and object placement.
Now, before we get started, let’s verify that we have the same file.
- Make a file named “Zelda3.hash” in the same directory as your ROM, with the contents:
- Make a file named “Zelda3.hash” in the same directory as your ROM, with the contents:
Jacksum: Meta-Info: version=1.7.0;algorithm=md5;filesep=/;encoding=hex;
sudo apt-get install jacksum
jacksum -c Zelda3.hash
Normally I’d just post the valid file, but I’m not allowed to distribute it unless you also own Zelda3. Sorry for the inconvenience. By the way, if your checksum fails, you can still try editing the ROM in Hyrule Magic, with some chance of success. (For example, your ROM may be headerless).
Please note that Hyrule Magic can royally screw up your ROM. Sometimes this is your fault (i.e., loading an expanded ROM), sometimes it is a bug in the editor, and sometimes it’s a feature of the Zelda3 ROM (e.g., “whoops, that tile can only be used for doors”) and you have no idea how to undo such changes. For this reason, it is highly recommended that you keep rolling backups of your project files, even moreso than you would normally. I’m still looking for a VCS that handles binary files well, so for now I’d just recommend daily backups to USB and server-side backups every time you accomplish anything time-consuming.
A Note About Linux
As you might have guessed, we’ll be using Linux for this tutorial. Why, you ask? Well, first of all, because we can, and I want to be fair to all homebrew developers. Secondly, I’ve got a grand goal of making a totally portable, OS-included thumb drive, and that requires me to learn Linux. Don’t worry, you can follow this tutorial on Windows (I’ve tested it on both). Here we go!
Moving Objects, Changing Message Text
Our goal today is a simple, shallow proof-of-concept hack. Copy the Zelda3 ROM to a new directory, then open Hyrule Magic, click “File -> Open”, and browse to the new copy. Once you open the ROM, a whole list of menu items will appear.
This list is a categorical view of all the data from the Zelda3 ROM that Hyrule Magic understands. Click on “Dungeons” and then double click on “Entrance 00”. Zelda3’s dungeons are set up in a grid-like fashion, and the first one just happens to be your Uncle’s house. You can click and drag various objects –try dragging the table in front of the door:
Hit “Ctrl+S” to save your ROM and “Ctrl+F4” to close the dungeon editor window. Double-click on “Dungeons” to compress the list, then double-click on “Monologue” to edit the game’s text. Double-click on the line which reads:
[Name], I'm going out for awhile. I'll be back by morning.Don't leave the house.
This is the first thing your Uncle says to you after Zelda’s message arrives in your head. The [Name] will be replaced by your character’s name. The  and  indicate where the second and third lines begin. Change the text to read:
[Name], you sneak out too much.I've blocked the exit.You can't leave now!
Then click the “Set” button. In the same way, change message 32:
[Window 02][Speed 03]Help me...I am in the dungeon of thecastle.[Waitkey][Scroll]I know there is a hidden path[Scroll]from outside of the castle to [Scroll]the garden inside.
[Window 02][Speed 03]Zelda here... didn't you learn how to jump?
Save your ROM (Ctrl+S) and close Hyrule Magic. You can now test the Zelda3 ROM you just hacked. Zsnes works on most Linux boxes:
…or just open Zsnes and browse to the ROM. Go through the opening sequence; boy you’re stuck now!
Well, that was fun; let’s do one more quick hack and call it a day. Open your ROM in Hyrule Magic, and expand “Palettes”, then “Clothes”, then double-click “Clothes pal 0”. Like most SNES games, Zelda3 stores each pixel it draws by reference to a “palette”. If you were to change, say, the “white” color referenced in the “sword” palette, that would affect every white pixel in Link’s sword. Right now, we’re going to change the color of Link’s clothes. You should see:
Count the colors from the left: “1, 2, 3…”. So color “5” is black. You can change a color by single-clicking on it and choosing a new one. Change the following:
Color 8 from pink to yellow. (Did anyone else notice Link had pink hair?) Color 6 from orange to dark blue. Color 11 from green to matte blue. Color 12 from lime green to matte yellow. Color 2 from yellow to very dark red. Color 9 from green to a brighter green. Color 10 from green to a slightly lighter green than color 9.
This isn’t scientific; just pick colors you like, really. Now, save and load your ROM. Link’s makeover is complete:
You may have noticed that Link’s face gets all messed up if you pull something. This is not a bug; when we changed orange to dark blue, we affected more than just the trim on Link’s hat. If you were serious about changing Link’s color scheme, you’d probably have to edit the pixels which make up Link’s graphics in addition to the palettes.
Go make yourself a sandwich –or a coffee– we’ll be back after a short break.
You can skip this section if you like; it’s about game design, not hacking. But I think you should read it. Yes, you have to. That’s right.
While you eat your sandwich and drink your coffee, think about your target audience. Realistically, the only people who’d want to play your hack are ones who’ve already beaten Zelda3 multiple times. Probably, you’re one of these people too. So how can you cater to their particular needs?
Well, for one thing, the castle gets pretty boring after you’ve played the later dungeons.
We’re going to use a tried-and-true method of Zelda power-questers today: we’ll deny the players use of the sword for the first bit of the game. The lantern, unfortunately, is a pretty lousy weapon, so let’s give the player some arrows; that should allow for some interesting puzzle construction. But what should we do about Link’s uncle? I see two possible solutions:
The Hacker’s Solution: Scan the ROM and determine the code which gives Link the sword. Switch it so that Link’s uncle gives him the bow. Perhaps alter his sprite to be holding the bow, too.
The Storyteller’s Solution: Just give the bow to Link at his house and delete his uncle in the palace basement; the story can be molded to fit around this.
I’m inclined to go with solution number two —it opens up a lot of creative possibilities. Solution 1 is a bit show-offy, and it doesn’t really fit so well into the story for Link’s uncle to give him anything except a sword. At this point, it’s good to brainstorm and consider a few potential trip-ups, and some tentative solutions (lest we back ourselves into a corner).
Will Link Meet His Uncle Later? Maybe, but we won’t be able to have him in his “wounded” state giving Link anything, since this glitches the game after Zelda is rescued. We have his walkabout graphic; maybe we can replace one of the villagers with him. Or, we can have a mutant in the Dark World say he’s him. Or, we can change the ending credits from “Your Uncle Recovers” to “Your Uncle is Found”.
Why Does Link Have a Bow in His House? Maybe he’s a hunter? Actually, it makes a lot more sense for him to have a bow than a sword. Maybe we can change the general feel of Zelda3 to be more “woodsy” and less “running from the law”.
What About the Game Text? Link’s uncle can say anything; even the same message he says now. Zelda’s second message is easy to replace; something like “Half past the hour; all citizens to bed!”. The first message is tricky. We can have Sora Link monologue (“I’ve been having these… weird thoughts lately.”). Or, we can have him dreaming of his Uncle scolding him for playing around with his bow. Be creative.
Will Link Be Able to Get the Sword Later? This is a very good question, especially if your Uncle can never give you the sword. Can you put it in a chest? At the very least, you can get the Master Sword, so that’ll be our backup.
This was a bit of a digression, but I wanted to impress the importance of thinking creatively and creating a world of your own. The hacker’s solution is elegant, but it actually creates a game that “feels” wrong. The lantern was added to your house to make it feel like you were heading out into the rain, to rescue a princess from some unspecific evil. I’ve always felt this was poorly done in the original game. Grabbing your bow and rushing out into the rain is a lot more romantic. (Stumbling upon your uncle and nabbing his bow is… a non sequitor.)
Even if you were the best ASM hacker in the world, you still shouldn’t desire to change everything. At that point, you might as well just develop an entirely new game. Rather, you want to make a game that plays like Zelda3, but feels totally different. I always take the Quest for Calatia as my inspiration. Here are two innovations this developer makes:
- He uses different trees and houses to imply that Calatia is a colder country.
- He allows you to climb onto house rooftops and hookshot between chimneys.
Those two simple changes really expand the player’s mind as he is exploring. He feels like the fully-equipped link from Hyrule exploring a place which forces him to adapt his strategy.
Another example of great innovation uses ASM:
- Someone modified the game so that you can throw bombs in eight directions, and can throw them either a long distance or a short one.
This mod subtly changes the nature of bombs into something much more utilitarian. I’m sure you could come up with all sorts of puzzles involving bombs and moving platforms, or switches that must be bombed simultaneously.
My early blog entries on Hyrule Magic owe a lot to Orochimaru’s Perfect Guide to Zelda 3 Editing, an in-depth handbook to using this complex and sometimes non-intuitive editor. Feel free to refer to the Perfect Guide on your own time –it’s got lots of great info.
Post Posting Post: Looking at my dashboard, it seems that a lot of people are finding this post after searching for sprite editing. Like “how do I edit Link’s graphics”? instead of just his palette. Believe me, I understand the frustration of getting no good hits on Google. So, I promise to add some sprite hacking to my next tutorial. I can’t just tell you now, since a lot of the graphics in Zelda are compressed, so it’s more complex than that, and I’m in the middle of another RPG Maker article at the moment.