Moonwell Dancers
Welcome to the home of

Moonwell Dancers

May You Never Walk Alone
Moonwell Dancers

B. How to make the Minimap

In this appendix of ‘Fun with the Minimap’, I outline the various steps required to make a copy of the full minimap. To get started, we need to first locate the WoW file that contains the raw data for the minimap. This file is called common.MPQ {1}, and its full unix path name on my Mac is

/Applications/World of Warcraft/data/common.MPQ

At this point I should mention that it is a good idea to make a copy of the common.MPQ file to play around with. An inadvertent error committed while manipulating the original common.MPQ file could have a disastrous impact on your WoW playtime!

Next, we have to open common.MPQ, not with WoW, but with a utility that lets us examine and extract the contents of the common.MPQ file. The ‘MPQ extractor’ utility for the Mac works well for this purpose.

As always you should employ safe computer practices and be sure any downloaded code comes from a trusted source/

Using an MPQ extractor, open your copy of the ‘common.MPQ’ file and extract the enclosed data. Its worthwhile noting that common.MPQ is over 3.5Gb in size and it took me about 40 minutes to extract all the files. The MPQ extractor I used dumps everything into a folder called ‘common’ named after the ‘common.MPQ’ file. This folder contains a bunch of interesting stuff that is fun to explore. Especially interesting to me are all the music and environmental sound files. Using Garage Band, it was easy to convert the murloc agro sound to a ring tone for my iPhone. Blizzard should convert their sound files to ring tones and sell them!

For the purpose of constructing the minimap, we will focus on the common/textures/minimap folder. This minimap folder is what we want, and inside the minimap folder are nearly 9000 128x128 bitmaps of, you guessed it, various portions of the minimap. Here is one of those 128x128 bitmaps,

This is a small patch of the ‘Searing Gorge’ area just north and a bit to the east of Blackrock Spire. All of the 128x128 bitmaps are stored in Blizzard’s blp format {2} and upon closer inspection of the *.blp files in the minimap folder, we see that the file names are all hexadecimal based and for the image above, the file name is,

a15492159a0bde91ccd01474f47ad246.blp

As you can see, this file name is not very useful, especially if you want to know where this image sits in the minimap. To make sense of this file name and the others like it, we need a way to translate them into an understandable form. This translation is given by the ‘md5translate.trs‘ file that is also found in the minimap folder. A short excerpt of the md5translate.trs file, is given below,

.
.
.
Azeroth\map34_44.blp c3e57912b9fb68e4e1ec20f5e95bcf33.blp
Azeroth\map34_45.blp a15492159a0bde91ccd01474f47ad246.blp
Azeroth\map34_46.blp 783b4ee8979b7823ec15792a22b45e2d.blp
.
.
.

Upon closer inspection, you can see that this excerpt contains the Searing Gorge ‘a15492159a0bde91ccd01474f47ad246.blp’ file shown above, and maps it to the Eastern Kingdom’s grid position (34,45). The position, (34,45) corresponds to an ordered pair of Cartesian coordinates ( i, j ) and can be used to locate any of the *.blp files on a Cartesian grid. The first index, i = 34, labels the column and the second index , j = 45, labels the row. For the Eastern Kingdom minimap, there are roughly 20 columns and 37 rows. The actual number can be a bit larger depending on how much ocean you want to include around the perimeter of the continental shelf.

Translating these hexadecimal names by hand is slow going but not unreasonable if you only want a small bit of the minimap. On the other hand, there are approximately 800 files that are used to make up the entire Eastern Kingdom minimap and renaming them all by hand is just not feasible. Fortunately, there are many tools well suited for automating this activity. I used PERL which stands for Practical Extraction and Report Language to write two scripts that first converted the files from blp format to bmp format, and then translated the hexadecimal file name format into the human readable Cartesian coordinate file name format. PERL is included as part of the unix based Mac OS and works seamlessly with the terminal and any unix shell you want to use.

The first step in converting the hexadecimal named blp files to Cartesian named bmp files is to open the md5translate.trs file in a text editor. This file contains file name translations for the two Azeroth minimaps and the Outland minimap {3},

.
.
.
Azeroth\map33_59.blp 61c338bd7fe65d191f3b13eed12b9cc9.blp
Azeroth\map33_60.blp 7dd56cabfb38dc2b7d298bd1fff73a41.blp
Azeroth\map33_61.blp 67ba43d493e62a8fad5de319e6d4cb05.blp
.
.
.
Kalimdor\map42_41.blp 67ba43d493e62a8fad5de319e6d4cb05.blp
Kalimdor\map42_42.blp c096cc9038cb89f66fea858e5594acb3.blp
Kalimdor\map42_43.blp 9b7d01edeaaf8c1e80bcfe2818206a3b.blp
.
.
.
Expansion01\map16_29.blp edf89015d280052b8358ddc323a145e2.blp
Expansion01\map16_30.blp 8897b6ad6f73ac1b08d64f8a65cdd43f.blp
Expansion01\map16_31.blp 931d6df1c1709944dff9047535392afe.blp
.
.
.

Rather than converting and translating all the *.blp files that comprise the Eastern Kingdoms, Kalimdor, and the Outland minimaps in one fell swoop, I split the problem up into smaller more manageable pieces. To do this, I first copied the Azeroth file names, the Kalimdor file names, and the Expansion file names from the md5translate.trs file and pasted them into three separate files named Azeroth, Kalimdor and Outland respectively. I then further divided each of these files into smaller files containing only file names for a single column of each map as determined by the left index of the translated filename. For example, the Azeroth file was subdivided into files named azm1 through azm15 . Similarly for kalimdor, I broke it up into kal1 through kal20, and for Outland I broke it up into out12 through out35. For blp files on the periphery of each area, the number of files in each column was small and I therefore combined a few columns in to a single file. So, for example, even though there are 20 columns corresponding to the Easter Kingdoms minimap, I only made 15 file name translation files. Each of these files correspond to the <input filename> passed to the PERL scripts ‘openblps’ and ‘changename’ discussed below. By the way, breaking these files up into columns was an arbitrary choice on my part to divide and conquer and other approaches are equally viable.

The next step is to examine the two PERL scripts written to first convert the 128x128 bitmaps from blp format to bmp format, and then to rename the bmp files using human readable Cartesian file names. For the first step, the openblps script opens the *.blp files listed in <input filename> using the Mac based ‘BLP viewer’ application. The script is written to be executed from the same directory that includes the Minimap folder and the file name translation files, <input filename>. The <input filename> passed to this script upon execution are just our azm1 through azm15, kal1 through kal20, and out12 through out35 files discussed above.

openblps.pl

When run in ‘bulk convert mode’ the ‘BLP viewer’ application that I’m using converts each of the blp files listed in <input filename>, to bmp files and places the converted files into a default folder that I rename as ‘azm1 Maps’ through ‘asm15 Maps’, ‘kal1 Maps’ through ‘kal20 Maps’ and ‘out12 maps’ through ‘out35 maps’ for the Eastern Kingdoms minimap, the Kalimdor minimap, and the Outland minimap respectively.

After converting the relevant blp files to bmp format, we need to replace the hexadecimal file names with the human readable Cartesian file names. A second PERL script, changename, performs this action where the two required inputs upon execution are <input filename> given by azm1 through azm15, kal1 through kal20, and out12 through out35, and given by ‘azm1 Maps’ through ‘asm15 Maps’, ‘kal1 Maps’ through ‘kal20 Maps’ and ‘out12 maps’ through ‘out35 maps’,

changename.pl

Once the files are converted from blp to bmp format and renamed using the human readable Cartesian file names given by the md5translat.trs file, it is a somewhat tedious but straight forward process to assemble the files into on single minimap file. I used Photoshop for this final assembly process where I first construct each column and then merge the columns to yield the final minimaps for the Eastern Kingdoms, Kalimdor, and the Outland. I padded my maps with extra ocean textures for Kalimdor and the Eastern Kingdoms, and Vacuum textures for the Outlands to obtain a smooth rectangular form for these maps. In the figure below, I left a small space between each 128x128 bitmap a to explicitly show how they fit together to make the Kalimdor minimap,

Here is a summary of the steps:

  1. Extract the minimap folder from common.MPQ.
  2. Convert the minimaps from blp format to a format Photoshop can read.
  3. Use the md5translate.trs file, also located in the minimap folder, to convert the minimap names from hexadecimal format to a readable format.
  4. Assemble the files into a single image.

Footnotes:

{1} As an interesting aside from Wikipedia, “MPQ is short for Mo'PaQ, which is short in turn for Mike O'Brien Pack, named after its creator. It’s an archiving file format used in several of Blizzard Entertainment's games.”

{2} Also from Wikipedia, “BLP files are texture files used by games made by Blizzard Entertainment.”

{3} Using the methods described in this appendix you can also make your own instance maps. I think that this is how the Atlas UI addon works. Also, in their various patches, Blizzard sometimes includes maps that are ‘under development’ in the ‘common.MPQ’ file. If you get tired of raiding or farming, its fun to explore these extra files and occasionally get an early glimpse of areas to be released in future patches.