Decompiling Maps
Before you read on make sure you know that decompiling maps can be a very sticky business. It is widly frowned upon by the majority of professional level designers. For good reason, when you decompile a map you are taking their hard work and using it for yourself. So before you get the idea to go around decompiling every map and throwing the vmf's up on the internet, please take the time and think about something you have dedicated a small portion of your life to, and then imagine someone breaking it into a million pieces.
When you decompile a map you should be thinking one of two things:
- You are curious how a certain part of his/her map works
- You are going to greatly change the map and only use the skeleton, and of course give the author of the original map the full rights to your work.
The Hackers Toolbox
To decompile maps I suggest the following tools:
Optional
Getting Dirty
To start off, you are required to have installed the JRE, which can be downloaded from http://java.sun.com/j2se/1.5.0/download.jsp. Once that is installed you are ready to decompile your first map. Download VMEX and copy it to the Source SDK bin folder. You'll notice VMEX comes with two bat files which can be run to start up VMEX.
To decompile a map run VMEX and browse to the map, then hit decompile.
Playing in the Mud
Through your adventures into the world of open source mapping, you might come across some words that will make you scratch your head, "**** This map is protected from decompiling." This output is produced by VMEX when you try to decompile a map that someone really did not want decompiled. If you are a map maker and you want your map to produce this kind of output for those who try, just add a keyvalue called "no_decomp", with a value of 1, to any entity. But do not jump up and down yet, because as easy as that process is, its even easier to undo it and safely decompile the map again.
For those of you who do find one of these rare maps, this is where EntSpy comes into play. Open the map in EntSpy and search for the light_environment entity, when you find it, go to the window directly to the right and find a box that says "no_decomp 1" and simply remove it. Then save the map in EntSpy and go back to VMEX to decompile the map. If you cannot find the key word in light_environment, you might have to go searching. Look in the common entities first, the ones that usually are only created once and will not break the map if they fail.
For those who are more pro, what you can do is load the bsp into wordpad and search for no_decomp yourself. Then make a mental notes of which entity it's in and go back to EntSpy to finish the job.
Levels of Security for Map makers
The method mentioned above is one of the simplest ways to protect your map from decompilation. VMEX offers three levels of security. A slightly more secure method is to make one brush in your map and texture it with "tools/locked", this is not a real texture so you will have to create it. The most secure way you can stop the hackers is by downloading VMEX's custom prefab from here, add it anywhere to your map, but do not rotate, scale, or retexture it. All three of these can still be by passed of course, but only by those who absolutly know what they are doing.
Before you go
Before you take this jump to run off and decompile a map take a second or two to think, "What am I trying to learn/do?". Read the inlcluded txt files, you may just find the creators e-mail, and that could be more helpfull than you imagine. Some mappers will offer up help and advice, they may even go so far as to provide perfect examples of what you were trying to "borrow" from the map. Whats better, copying someone else's test and getting the answers then, or having someone teach you what to do so you can do it yourself next time.