0
\$\begingroup\$

I used an MPQ editor to change some things in one of my maps. Among those changes was the map name defined as a text string in the war3map.wts inside the map.
Now, however, I see that the name of the map, as shown in the list of maps, was unchanged and — of course — differs from the name of the map shown everywhere else: above the preview, e.g.

How do I change the list name?
Do I actually need to resave it in a map editor, e.g. Blizzard's “World Editor”?

\$\endgroup\$
0
\$\begingroup\$

No, you do not need to open the map in “World Editor” or any other Warcraft 3 map editor.
Changing the listname of your map can be done if you are willing or able to grab a hexeditor, or the like, and follow some very simple constraints.

The name of the map is stored in a header prepended to the actual MoPaQ stuff. Here I show you an excerpt from the hexadecimal representation of an example map:

? xxd  -autoskip_00_lines  -columns 8  -g 1  -length_read 520  -uppercase  ./'(2)Amazonia.w3x'
0000000: 48 4D 33 57 00 00 00 00  HM3W....
0000008: 41 6D 61 7A 6F 6E 69 61  Amazonia
0000010: 00 14 DC 01 00 02 00 00  ........
0000018: 00 00 00 00 00 00 00 00  ........
*
0000200: 4D 50 51 1A 20 00 00 00  MPQ. ...

The asterisk there represents several lines that are nothing more than null octets.
Anyways: You can see the name of the map there: that is the ‘listname’ which Warcraft 3 shows in the list of multiplayer or custom game maps. The name is succeeded by a 00, and then a sequence of some other octets.

I mentioned some constraints that you would need to abide if you wished to change the listname of any map. Here they are:

  • Do not change the offset of the ‘MPQ’ sequence or anything succeeding it. I.e. it needs to begin at 0x200.
  • Do not edit anything later than the offset mentioned above. None of that matters for what you need to do.
  • Do not change the offset where the name of the map begins. I.e. it needs to begin at 0x8.
  • Do not edit anything prior to the offset where the name begins. Doing so could invalidate your map and prevent it from being recognized as one.
  • The name is simply terminated by a 00 octet. This is actually rather convenient because it allows us to change the length of the name and not be concerned with updating any pointers designating where the name terminates.
  • The sequence succeeding the name — in this example, ‘14 DC 01 00 02’, — needs to be unaltered. It also needs to immediately succeed the single 00 octet which terminates the name.
    These are various other parameters and information which Warcraft 3 reads when it displays the map. Tooling with them is beyond the scope of this answer.

Therefore, it follows that you can change the length of the name, so long as you compensate by deleting or adding, in the margin, however many 00 octets are necessary. It is also possible for you to give the map two different names: one which is shown in the list of available maps, and one which is shown anywhere the ‘true’ name is referenced.

Here, I show you a map for which I already changed the listname:

? xxd  -autoskip_00_lines  -columns 8  -g 1  -length_read 520  -uppercase  ./test/changing-length-of-listname.w3x
0000000: 48 4D 33 57 00 00 00 00  HM3W....
0000008: 69 66 20 69 20 73 65 65  if i see
0000010: 20 74 68 69 73 20 61 6E   this an
0000018: 64 20 63 61 6E 20 70 6C  d can pl
0000020: 61 79 20 69 74 2C 20 74  ay it, t
0000028: 68 65 6E 20 74 68 65 20  hen the 
0000030: 6E 61 6D 65 20 63 68 61  name cha
0000038: 6E 67 65 20 77 6F 72 6B  nge work
0000040: 65 64 21 00 14 DC 01 00  ed!.....
0000048: 02 00 00 00 00 00 00 00  ........
0000050: 00 00 00 00 00 00 00 00  ........
*
0000200: 4D 50 51 1A 20 00 00 00  MPQ. ...

I.e.

if i see this and can play it, then the name change worked!

Of course, that new name is far too long to show all of it in the list of maps, but my changes resulted in a map which Warcraft 3 could use and which exhibited evidence of the changes made.

The examples I gave were done using xxd in a Linux commandline environment. However, you could do something similar with any decent hexeditor or binary stream editor on any platform. Your choice of tool depends on what you have available and on your level of skill or proficiency with such a tool.

I'll repeat the example above, but this time sans the -autoskip switch so that you have a fuller representation of what I did.
I shall also omit the -columns switch so that each line width defaults to 16 octets.

? xxd  -g 1  -length_read 528  -uppercase  ./'(2)Amazonia.w3x'
0000000: 48 4D 33 57 00 00 00 00 41 6D 61 7A 6F 6E 69 61  HM3W....Amazonia
0000010: 00 14 DC 01 00 02 00 00 00 00 00 00 00 00 00 00  ................
0000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000200: 4D 50 51 1A 20 00 00 00 A0 C9 01 00 00 00 03 00  MPQ. ...........

? xxd  -g 1  -length_read 528  -uppercase  ./test/changing-length-of-listname.w3x
0000000: 48 4D 33 57 00 00 00 00 69 66 20 69 20 73 65 65  HM3W....if i see
0000010: 20 74 68 69 73 20 61 6E 64 20 63 61 6E 20 70 6C   this and can pl
0000020: 61 79 20 69 74 2C 20 74 68 65 6E 20 74 68 65 20  ay it, then the 
0000030: 6E 61 6D 65 20 63 68 61 6E 67 65 20 77 6F 72 6B  name change work
0000040: 65 64 21 00 14 DC 01 00 02 00 00 00 00 00 00 00  ed!.............
0000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0000200: 4D 50 51 1A 20 00 00 00 A0 C9 01 00 00 00 03 00  MPQ. ...........
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.