Decompiling Maps: Difference between revisions
m (As explained in the first change, you can remove entities and load them back in via Stripper: Source or simply load an entity lump server side, since the entity lump is the only part of the bsp that does not have a CRC between client and server.) Tag: Undo |
(→Finding Valve Maps: added note about lump and commentary file data.) |
||
Line 26: | Line 26: | ||
Most maps do not need to be extracted, as they are located in the file system rather than VPK. The map files are normally located in a ''maps'' folder, for example <code>common\Team Fortress 2\tf\maps\</code> holds all the official Team Fortress 2 maps. | Most maps do not need to be extracted, as they are located in the file system rather than VPK. The map files are normally located in a ''maps'' folder, for example <code>common\Team Fortress 2\tf\maps\</code> holds all the official Team Fortress 2 maps. | ||
{{note|A few games may have extra maps sectioned into other mod folders, for example <code>Portal 2\portal2_dlc1\maps\</code>.}} | {{note|A few games may have extra maps sectioned into other mod folders, for example <code>Portal 2\portal2_dlc1\maps\</code>.}} | ||
{{note|A few games use [[Patching_levels_with_lump_files|lump file edits]] to edit existing entities, and [[Commentary_System|comment files]] to add new entities without recompiling maps. for example: {{l4d2}} adds [[info_remarkable]] entities and [[env_player_blocker]] entities this way.<br> | |||
BSPSource is capable of reading the .lmp files and incorporate its data, but it will not load entities from the commentary files. Luckily you can convert commentary files back to VMF files by following [[Commentary_System#Converting_Commentary_back_to_VMF|these steps]]. and merging those entities into the decompiled map.}} | |||
==Before you go== | ==Before you go== |
Revision as of 12:02, 21 March 2022

Decompiling is the process of taking a compiled map file and generating a file that Hammer can open. Decompiled maps are not perfect recreations, because of format differences. This makes them useful for learning, measurement, and inspection, but not direct recompilation. The original source is ideal for reproductions or modifications.
Releasing reproductions, modifications, or approximations of another's work without permission nor credit may be considered rude to the author, is largely frowned upon, and is in fact copyright infringement, which may have legal consequences depending on the source of the map. There are methods of preventing maps from being fully decompiled by obfuscating textures, entities, etc.
Tools
- EntSpy (used to view and edit the entities of a BSP without recompiling)
- BSPSource (open source map decompiler for Source engine maps, based on VMEX)
- VMEX (decompiler for Source engine maps)
- MapFool (helps porting HL1 maps to Source)
- xwad (command-line tool to convert texture formats)
Tools for the HL1-engine:
Warning:These tools for the Half-Life Engine are unstable and may not compile correctly in the end.
Finding Valve Maps
Most maps do not need to be extracted, as they are located in the file system rather than VPK. The map files are normally located in a maps folder, for example common\Team Fortress 2\tf\maps\
holds all the official Team Fortress 2 maps.

Portal 2\portal2_dlc1\maps\
.

BSPSource is capable of reading the .lmp files and incorporate its data, but it will not load entities from the commentary files. Luckily you can convert commentary files back to VMF files by following these steps. and merging those entities into the decompiled map.
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 included TXT files, you may just find the creator's e-mail, and that could be more helpful than you imagine.
Some mappers will offer help and advice, they may even go so far as to provide examples of what you wanted to borrow from the map.
Porting newer maps to older Source games
Decompiled maps from Left 4 Dead 2, Portal 2, Counter-Strike: Global Offensive, and Alien Swarm will crash when loaded in the Hammer for Half-Life 2, Team Fortress 2, Counter-Strike: Source, and Day of Defeat: Source. Opening the map in Left 4 Dead Hammer and re-saving it will automatically convert it to be compatible.