Decompiling Maps: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 24: Line 24:


When I go to decompile maps I usually copy the map I am decompiling to the VMEX directory, but this step is optional, its just a matter of avoiding a lot of typeing.  On the command prompt type in "vmex my_mapname" with your map file substitued for my_mapname.  After a few seconds and a bunch of .'s you should be all set with a genuine VMF file.
When I go to decompile maps I usually copy the map I am decompiling to the VMEX directory, but this step is optional, its just a matter of avoiding a lot of typeing.  On the command prompt type in "vmex my_mapname" with your map file substitued for my_mapname.  After a few seconds and a bunch of .'s you should be all set with a genuine VMF file.
== Playing in the Mud ==
Through your adventures into the world of open source mapping, you might come across some worlds that will make you scratch your head, "**** This map is protected from decompiling."  This output is produced by VMEX when you try to decompile 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 kay value called ''"no_decomp,"'' with a value of 1, to a '''light_environment''' 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 world 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 its in and go back to EntSpy to finish the job.

Revision as of 13:14, 4 February 2006


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 a folder that is close to a drive letter (eg, "C:\VMex") the reason will soon be clear. You'll notice VMEX comes with two bat files, these, unfortunetly, have to be run from the command prompt, so goto Start->Run and type in "cmd"

When the screen pops up, navigate to the folder you installed VMex to by use of the cd command. Example, to get to the drive I mentioned earlier, type "cd C:\VMex" (without the quotes). Good thing you installed it close to a root directory!

When I go to decompile maps I usually copy the map I am decompiling to the VMEX directory, but this step is optional, its just a matter of avoiding a lot of typeing. On the command prompt type in "vmex my_mapname" with your map file substitued for my_mapname. After a few seconds and a bunch of .'s you should be all set with a genuine VMF file.


Playing in the Mud

Through your adventures into the world of open source mapping, you might come across some worlds that will make you scratch your head, "**** This map is protected from decompiling." This output is produced by VMEX when you try to decompile 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 kay value called "no_decomp," with a value of 1, to a light_environment 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 world 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 its in and go back to EntSpy to finish the job.