8-bit NES Legend of Zelda Map Data

I've created Python & Pygame script that lets you walk around the overworld map of the original Legend of Zelda game on the 8-bit Nintendo. There are no monsters or levels or items; it is simply a walking tour. The Link walking sprite animation is implemented by my Pyganim module.

More importantly, this program does provide the raw map data the entire world map (something I haven't been able to find on the web.) Getting this from the Zelda ROM is actually a pain due to the tricks used to store the map info. The game doesn't store individual tiles and their XY location, but rather have one of three color schemes for the border and a color scheme for the center tiles. Even then, the game only stores columns of tiles, and then each room references which columns it uses. (You can notice the same columns being used in different rooms, even though their color scheme may change.)

These tricks aren't really needed with today's computers for a game as simple as Zelda, so I've compiled the tile map data for each individual location on the map. Here's the world map data file (it is also included in the main download below.)

Download the Zelda Walking Tour program.

View raw tile map data.

(Just unzip all the files and run the nesZeldaWalkingTour.py file with Python. Runs with both Python 2 and Python 3. Requires the Pygame module to be installed.)

You can also download the code from the GitHub project.

Blocking is not implemented, which means you can freely walk through walls:

The tiles are stored in overworldtiles.png:

To find which tiles correspond to the hex numbers in the world map data file, use this key (the numbers start at 0 and simply increasing going to the right):

And just for grins, I have a pixel-perfect single image of the entire world map, without enemies or anything else polluting it. The colors may be a bit off from the actual game, but they are consistent:

If you'd like to work on a similar project to this, here's a good page I've found that I wish I had seen before I started: More GPU Tile map demos (Zelda)

Some general stats about the NES Zelda map data:

  • The entire overworld is 4096 x 1344 pixels, 16 x 8 rooms, and 256 x 88 tiles in size.
  • Each room (a single screen) is 16 x 11 tiles in size (the bottom row only shows the top half of the tile). It is 256 x 176 pixels in size (if you count the bottom half of the bottom row).
  • Each tile, including Link himself, is 16 x 16 pixels in size.
  • There are seven colors used on the overworld map (though the RGB values may not be perfect):
    • (32, 56, 236)  blue
    • (252, 252, 252)  white
    • (200, 76, 12)  brown
    • (0, 168, 0)  green
    • (116, 116, 116)  gray
    • (252, 216, 168)  tan
    • (0, 0, 0)  black

9 thoughts on “8-bit NES Legend of Zelda Map Data

  1. Saw this on Reddit today, and wow. I've always been on the fence about Python, but I am seriously impressed that this could have come out of it, and I'm very impressed that you managed to reverse-engineer the original Zelda map data (sounds like it wasn't easy), and now it's available for small-time hacks like me to go tinker with.

    Anyway, how did you get the full-sized render of the whole map? I was just casually replacing tiles, and put water in place of ground, and thought that would make for a great "Wind Waker" type of world, and just wanted to see it in its entirety.

    So, very inspiring post, now I want to go delve into doing similar things with all kinds of NES games, or port this into Java or C#, my mind is racing at this point. Well done sir.

  2. Sigh. i dont know how to feel about this. I went out to learn python by recreating Zelda as close as possible about a couple weeks ago. Im still learning about collision and animation right now, and then I see this pop up today. What are the fucking odds. 100% i guess

  3. I've been playing around with this, and also working on my own clone of Zelda (that's how I found this).

    I'm really confused about why when you load the tileset you "wrap" around the end of the image file and then have duplicates of the first two tiles. For example, the brown staircase is tile 00 and tile 12? And yet there are no tiles of 00 in the map data. Is this just an artifact of how you had to get the map data out of the ROM?

    Regardless, this code has been really helpful in learning how to do something more meaningful with pygame. Thanks!

  4. This is pretty cool, but:
    a. you go right through trees and other objects
    b. Link disappears when the screen scrolls
    c. It gets very boring very fast.
    Nonetheless, it's cool that you have this, and it might be possible to use it for a more complex and interesting game!

  5. Oh yes, I almost forgot!
    Also, it would be pretty cool if you could get some of the sound files from the game as well!
    (I heard GIMP is a pretty cool program for image editing, by the way, although not specifically designed for tile-making...)

  6. Where is the best place to unpack this in ubunto, I have it on my desktop and am getting errors about missing files that are actually in the folder, obviously it cant find the route to the files.
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>