• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

World Edit Loading region problem

Status
Not open for further replies.
Level 4
Joined
Dec 11, 2019
Messages
55
Hello,

my story begins with me saving up a map i edited for like 2-3 years on a stick, got reforged recently and tried to run the map in Map editor, yet it keeps getting stuck on Loading Regions and the region number is about 1 billion to load from which is odd. Now i was researching google about this problem and could not find anything, is there any way how i can open the map via worldedit, it wasn't protected as it was a backup save so i could work with it again. I do have other maps i had saved, and they all worked so far.

Your Bolty
 

Attachments

  • oioi.PNG
    oioi.PNG
    2.2 MB · Views: 179
Level 19
Joined
Jan 1, 2018
Messages
739
The map regions file (warmap.w3r) has been protected, this is usually done by setting the amount of regions to KCUF (the ASCII values of KCUF are 75, 67, 85, and 70), which results in (75*256^3) + (67*256^2) + (85*256) + 70 == 1262703942 regions.
 
Level 4
Joined
Dec 11, 2019
Messages
55
I would upload it for you guys maybe you could try saving it for me, since the last time i worked on the map was 2020 april and i recently got back to it.
 

Attachments

  • Moba map bolty(1).w3x
    14.5 MB · Views: 18
Level 19
Joined
Jan 1, 2018
Messages
739
As expected your war3map.w3r file size is only 8 bytes, 4 for the version number and 4 for the amount of regions.
I have reconstructed the file based on the CreateRegions function in the map script. Since .w3r file extensions are not allowed I gave it a .txt extension.
You can use an MPQ editor to insert this file in your map.
 

Attachments

  • war3map.w3r.txt
    1.4 KB · Views: 52
Level 4
Joined
Dec 11, 2019
Messages
55
As expected your war3map.w3r file size is only 8 bytes, 4 for the version number and 4 for the amount of regions.
I have reconstructed the file based on the CreateRegions function in the map script. Since .w3r file extensions are not allowed I gave it a .txt extension.
You can use an MPQ editor to insert this file in your map.
I tried that and the map file itself is Read Only i cannot drag anything in there.
 
Level 4
Joined
Dec 11, 2019
Messages
55
So i followed a guide to save my map but got stuck with it not wanting to load anymore. it says "this file cannot be opened". After various tries i still cannot open the map, we tried to follow this guide [GUIDE] Rebuilding an MPQ : Tutorials & Cheatpacks it also gave me just one missing file and still does not load the map.
 

Attachments

  • Maprevive96.w3x
    15.2 MB · Views: 12
Last edited:
Level 19
Joined
Jan 1, 2018
Messages
739
The map file cannot be opened because the trigger files are missing (war3map.wct and war3map.wtg).
The map is also missing its cameras and sounds files (war3map.w3c and war3map.w3s), you can tell by the fact that the map script contains gg_cam and gg_snd variables.
It's also possible that certain files that are still there have been corrupted like the regions file was.

While it's possible to regenerate the cameras and sounds files, for the triggers you will not be able to regenerate all the GUI stuff so at best you will end up with a single JASS trigger.

I recommend you try and search if you still have an unprotected version of the map.
 
Level 4
Joined
Dec 11, 2019
Messages
55
I sadly do not, it used to be with my old Computer drive, which broke and i thought i saved the correct one without a protection and guessed it was protected after opening it once during reforged weird world edit launch. But i guess its lost as i do not have much knowledge about coding, i did all the mpq stuff with a guide.
 
Level 19
Joined
Jan 1, 2018
Messages
739
That's unfortunate, in that case the only option is to deprotect your map. I have been working on a tool to do this (which is how I recreated the regions file) that also works for the cameras and sounds files. I'm trying to do the same for GUI triggers but it's a lot of work, so for now you'd have to rely on existing deprotectors that only create a single JASS trigger. In this case it'll become a lot harder to edit the triggers, so either you'll have to manually recreate all the GUI triggers, or start learning JASS (or wait until I made some more progress on my tool, though I can't say how much time it'll take before it can handle the triggers in a map like yours).
 
Level 4
Joined
Dec 11, 2019
Messages
55
Everything helps, i can wait don't worry, i am inexsperienced with coding in any kind and that is why i seek for help, mapping hasn't been so hard as much of it was already given to you, well i did find any old map but it is my map from 2013 where i just made the terrain it doesnt have anything in it then that really, i wouldn't say i could recreate the same map again it was years work, and in a way i thank you already for doing this
 
Level 19
Joined
Jan 1, 2018
Messages
739
Just a couple more things to take care of before it should be fully functional, I'll probably finish it tomorrow.
Do you mind if I upload the deprotected map in this thread or do I need to send it to you privately?
 
Level 4
Joined
Dec 11, 2019
Messages
55
Just a couple more things to take care of before it should be fully functional, I'll probably finish it tomorrow.
Do you mind if I upload the deprotected map in this thread or do I need to send it to you privately?

I don't mind really, all i care about is that i have it back, thanks again for the work you put in^^.
 
Level 19
Joined
Jan 1, 2018
Messages
739
While it's not finished I'm uploading what I got so far so you can take a look and see if everything's working correctly.
For some reason if you try to play you'll get an error, but if you save it in the world editor and then try playing it again it'll work.

After saving it in the world editor the file size will be halved because the listfile has been deleted as part of the protection, and so far I only managed to detect the filenames of about half of the 509 files. I know there are tools that can do this, but I'm trying to implement it for the library as well. There's still some tricks that I have not implemented yet, like checking DISBTN and .mdl textures.
 

Attachments

  • Moba map bolty.w3x
    14.6 MB · Views: 25
Level 4
Joined
Dec 11, 2019
Messages
55
While it's not finished I'm uploading what I got so far so you can take a look and see if everything's working correctly.
For some reason if you try to play you'll get an error, but if you save it in the world editor and then try playing it again it'll work.

After saving it in the world editor the file size will be halved because the listfile has been deleted as part of the protection, and so far I only managed to detect the filenames of about half of the 509 files. I know there are tools that can do this, but I'm trying to implement it for the library as well. There's still some tricks that I have not implemented yet, like checking DISBTN and .mdl textures.

That is so damn cool! most of it has returned just as it was, most of the models were custom models which were imported. The folders were removed from the protection i assume which is fine, its just alot haha.

For my test, i saved the map and tested it in world edit test and even in warcraft itself and both worked.
 
Level 4
Joined
Dec 11, 2019
Messages
55
I was lucky, as i stumbled on another one of my lost maps that are protected, i got it from a person who said they got it from this website, and well it seems like i have forgotten that i made an old map post on this forum about my monolith edit.

This map doesnt have as much as the moba map which is fully restored now thanks to you, i worked on it for almost a month to fix every little detail and had much fun with my partner ^^. I do think i will try out a few steps to get this map unprotected aswell so things can be used again.
 

Attachments

  • Monolith 1.9 Versus Mode-prot1.w3x
    16.6 MB · Views: 34
Level 4
Joined
Dec 11, 2019
Messages
55
While it's not finished I'm uploading what I got so far so you can take a look and see if everything's working correctly.
For some reason if you try to play you'll get an error, but if you save it in the world editor and then try playing it again it'll work.

After saving it in the world editor the file size will be halved because the listfile has been deleted as part of the protection, and so far I only managed to detect the filenames of about half of the 509 files. I know there are tools that can do this, but I'm trying to implement it for the library as well. There's still some tricks that I have not implemented yet, like checking DISBTN and .mdl textures.
If you had more free time, would you deprotect this map aswell? This would be my last request, the other option is, that you send me the tool you use and i try to figure it out somehow
 
Level 19
Joined
Jan 1, 2018
Messages
739
If you had more free time, would you deprotect this map aswell? This would be my last request, the other option is, that you send me the tool you use and i try to figure it out somehow
The library is already available since it is open source, but it's not easy to use since there's tool (.exe) yet. I plan on making a windows forms application for this, since one of my friends has also requested this. Hopefully I will have time for this next weekend.
 
Level 4
Joined
Dec 11, 2019
Messages
55
The library is already available since it is open source, but it's not easy to use since there's tool (.exe) yet. I plan on making a windows forms application for this, since one of my friends has also requested this. Hopefully I will have time for this next weekend.
That is fine by me, i have patience, and thank you for that
 
Level 19
Joined
Jan 1, 2018
Messages
739
That is fine by me, i have patience, and thank you for that
I was kind of late to realize this version of the decompiler library does not yet include the ability to decompile the units (war3mapUnits.doo), that's what you get when you work on multiple PCs.
It's not really functional without this but I'll upload what I have now anyways so you can see if the tool itself works for you. I'll make sure to include unit decompilation in the next version.

For the tool I basically copypasted my existing MapTranspiler tool and made some changes.
I also added the option to individually select files to decompile and a button to automatically detect which files should be decompiled.

I'm not sure yet what name to give this tool, I initially just went with MapDecompiler like the library, but I also came up with MapUnlocker, and my friend suggested MapReconstructor, what do you think?
 

Attachments

  • Map Unlocker v0.1.0 .zip
    6.8 MB · Views: 97
Level 4
Joined
Dec 11, 2019
Messages
55
I was kind of late to realize this version of the decompiler library does not yet include the ability to decompile the units (war3mapUnits.doo), that's what you get when you work on multiple PCs.
It's not really functional without this but I'll upload what I have now anyways so you can see if the tool itself works for you. I'll make sure to include unit decompilation in the next version.

For the tool I basically copypasted my existing MapTranspiler tool and made some changes.
I also added the option to individually select files to decompile and a button to automatically detect which files should be decompiled.

I'm not sure yet what name to give this tool, I initially just went with MapDecompiler like the library, but I also came up with MapUnlocker, and my friend suggested MapReconstructor, what do you think?
Name ideas? Well how Map Saver, or Deprotector also thanks for sharing it.

Seems like, it does not work for me, atleast for the part where it would decompile parts out of the map that i try to deprotect. I am pretty unexperienced with that stuff.
 
Last edited:
Level 19
Joined
Jan 1, 2018
Messages
739
Name ideas? Well how Map Saver, or Deprotector also thanks for sharing it.

Seems like, it does not work for me, atleast for the part where it would decompile parts out of the map that i try to deprotect. I am pretty unexperienced with that stuff.
Currently the tool does not warn or give an error if it fails to decompile one of the files. I tested your map and there are still some missing features so it doesn't work yet (for decompiling the triggers).
Mostly decompiling trigger parameters still needs work, there are over 100 types and for each one I need to specify if it can be a preset, variable, function, and/or string (you also see these four options as radiobuttons in the world editor). Since it's a lot of work to do this I had only done the ones needed to get the first map working, but the second has a lot of additional types that I still have to add.

As for the name I did think of MapDeprotector as well, only issue I have with it is I feel like there might still be a kind of taboo on that word, which is why I thought of MapUnlocker as alternative. I think these two are the best options though since the others are more ambiguous so it may not be clear at first what the tool actually does.
 
Level 4
Joined
Dec 11, 2019
Messages
55
Thanks for the work you put in the tool, the second map is mainly a edit from PvE to PvP with balanced factions, and pretty much more additional stuff but other then that, its the normal blizzard map, maybe that is why, it might be harder to deprotect.

there could be also names like Map Cracker, Map Decipher, Key to Unlock Maps etc. theres really alot of variations.
 
Level 19
Joined
Jan 1, 2018
Messages
739
Thanks for the work you put in the tool, the second map is mainly a edit from PvE to PvP with balanced factions, and pretty much more additional stuff but other then that, its the normal blizzard map, maybe that is why, it might be harder to deprotect.

there could be also names like Map Cracker, Map Decipher, Key to Unlock Maps etc. theres really alot of variations.
It's not really hard, just tedious. Anyways I have updated the tool to show a messagebox when one of the files fails to decompile, then you can choose to ignore it or cancel. I still need to add all the types (and make sure it doesn't throw an exception when it doesn't recognize the type, otherwise the messagebox doesn't show up).
 
Level 19
Joined
Jan 1, 2018
Messages
739
Decided to refactor the expression->triggerfunctionparameter decompilation. That way instead of looking at the type (of which there are over a hundred) I only look at the expression type (only like 16 types here). Looking at the type is not really needed either since the data can be obtained from triggerdata.txt: if the type can be a preset then its key will exist in one of the dictionaries I use to model triggerdata.txt, if it can be a variable it will have the 'UsableAsGlobalVariable' flag, etc.
Another issue with looking at the type is sometimes you don't know what type it should be. This happens when you decompile the operands of a binary expression. For example: "if GetSpellAbilityId() == 'A000' then", at the time you look at the binary expression you don't know yet what type its operands are, only that the binary expression itself should return boolean (because the operator type is "=="). Looking at the left operand 'GetSpellAbilityId' you find this function in triggerdata.txt, so now you know its type is "abilcode". But it can get more complicated than that, what if it's a variable instead? "if udg_abilityid[0] == 'A000' then". Now the left operand is an integer (because the 'abilcode' type only exists in triggers, in the map script it becomes an integer), and the right operand is a FourCC literal so also an integer. Same thing for 'if null == null then', are you comparing two units? Or maybe these are actually null strings?
I'm still working on handling binary expressions the best I can (all the other stuff is easy). I also need to find some more unprotected test maps with lots of triggers that I can use to validate that I'm decompiling everything properly.
 
Level 19
Joined
Jan 1, 2018
Messages
739
 
Level 4
Joined
Dec 11, 2019
Messages
55
I tested this out, and it brought me back an unprotected map with all their things inside, the only things has wasn't restored is custom or more like imported things, its completly empty
 
Level 19
Joined
Jan 1, 2018
Messages
739
I tested this out, and it brought me back an unprotected map with all their things inside, the only things has wasn't restored is custom or more like imported things, its completly empty
I had made a war3map.imp decompiler before but it was mostly as a test so it's not included in the library right now.
It's hard finding all the names of the imported files when the MPQ archive has no listfile. I think in this case it's better to use an existing MPQ extractor that does at better job at finding all the filenames, then use the 'save map as folder' functionality to import all (or most of) these files back into your map.
 
Level 4
Joined
Dec 11, 2019
Messages
55
In the end i have my lovely Moba map back, and thats the main reason this was created, the other map is recoverable but it has to many custom models so i don't think thats gonna be a thing, anyway thanks for your work, until the day it was back i started working on it again.
 
Status
Not open for further replies.
Top