Extracting Assets From a Repacked Source Engine Map
Valve has recently been encouraging map authors to repack their BSP map file. Repacking a map compresses the BSP's "lump" data using using LZMA compression and the the benefit is a large reduction in file size, up to 70% smaller. Unfortunately, repacking a map can cause many extracting tools to fail to extract the assets packed with the map due to the compression.
But we aren't out of luck yet! Contained within a repacked BSP will be a ZIP file, called the "Packfile Lump". This ZIP file holds all the custom textures and prop models used in the map and has the name of the BSP file.
We are able extract the ZIP file without any trouble, then extract that with 7-Zip. Let's get started!
First off, you will need two programs:
- GCFScape is a lightweight tool that can open and extract content from .VPK and .GCF files, it can also do the same with .BSP files.
- 7-Zip is a free and open-source file archiver.
Install these two tools and keep reading.
How to extract a compressed .BSP:
- Launch GCFScape and open the .bsp map file you want to extract the assets from.
- There will be a single ZIP file in the root directory, with the name of the BSP file. Select the ZIP, right click on it and select the first option extract.
- Trying to extract any other folder from the BSP will give you the error "Compression format 0x0e not supported".
- A window will open up where you can select the folder you want to extract the assets to. Choose your folder.
- Another window will open showing the progress of the extraction. This step could take a while depending on the amount of files to be extracted.
- Open the directory where you extracted the .zip and right click on the .zip file.
- Click 7-Zip > Extract Archive
- The assets will be extracted into the folder. The reason that we don’t use the default Windows extractor is because it fails.
- Delete all the VHV files, the RAD files, and the VBSP file. They are useless once the map is decompiled.
- Create a folder in C:\Program Files\Steam\steamapps\common\Team Fortress 2\tf\custom. For example, I will create a folder named drake_custom
- Copy the folders you extracted, materials and models, to C:\Program Files\Steam\steamapps\common\Team Fortress 2\tf\custom\yourfolder
And that's it. You can load Hammer and view all your fancy custom assets you ripped from a map!
Now that you have your assets, it is important to understand the legality of what you just did. TopHattWaffle puts it very nicely:
Content theft is a real issue. Stealing content from other community creators is a scummy thing to do. So what is considered theft?
- Ripping content from community levels without permission from the creator for release to the public.
- Using content created by other creators and you not giving credit for those assets.
Please note that there are plenty of packs of content out there on the web for you to use. All most people ask is that you credit them for use of the content in your NON-COMMERCIAL release.
- Using content for commercial use (For example, making a profit) without the original creator receiving compensation.
- For instance I have various asset packs on my website. You can use them all you want for personal use, but if your CSGO level were to be included into an operation you will now be using them commercially, and you will need my explicit approval. If you do not get my approval your content is subject to removal and legal action can be taken against you. People have stolen content before and they have been banned as a result.
Okay, so what can you do with content? What is considered “Okay”?
- Porting from VALVe game to VALVe game.
- Personal use
- This basically means that you’re not releasing it. So if you want content from my levels, de_cruise, de_cache, or some other community level for internal / personal use. You’re basically not profiting from it. You’re not putting it on the workshop, or releasing it to the public. (Remember when you upload to the workshop you’re required to type I Understand to the terms.)
- Using community assets with explicit permission from the creator.
- Most asset creators are happy to share their work, just ask.
Basically, put yourself into the asset creators shoes. That prop you’re porting could have taken hours to make, stealing it is a scummy thing to do.
TL:DR, don’t be a jerk, ask for permission or make sure you’re within the terms that the creator outlines when they upload their assets for use. Basically, put yourself into the asset creators shoes. That prop you’re porting could have taken hours to make, stealing it is a scummy thing to do