So, recently Valve have been pushing repacking tools for BSPs. These tools can typically reduce the size of the map by up to 70%. This means that your maps take less time to download (and it removes the need to BZ2 your maps) and take less space to store.
Unfortunately, maps can't be repacked retroactively - any client playing a repacked version of the map will get a version mismatch if the server is running an un-repacked version, so this guide applies to anyone making new versions of their maps.
How much space can I save?
Below is a chart of a selection of maps I had installed when I wrote this, and their space savings after compression (higher is better).
How does it work?
A BSP file consists of a set of “lumps” that each contain information relevant to the map, including planes, entities and visibility data. The BSP Repacking utilities compress each of these lumps individually using LZMA compression. The exception to this is pakfile lump, which is a .zip file where each individual file instead undergoes its own compression.
Make sure you've built cubemaps and whatnot before hand, otherwise they won't be compressed!
BSPZip
BSPZip is a command-line utility shipped with the TF2 SDK, it was originally designed to handle packing of custom content into a map’s Pakfile but since the Gun Mettle update also handles compressing a map’s lumps and pakfile.
Here are some steps you can follow to compress your maps with it:
In-Game
Do I need to BZ2 my map too?
No! It doesn’t provide any benefit to BZ2 a repacked map, it’ll come out almost identically sized and just makes life difficult for people downloading your map.
Unfortunately, maps can't be repacked retroactively - any client playing a repacked version of the map will get a version mismatch if the server is running an un-repacked version, so this guide applies to anyone making new versions of their maps.
How much space can I save?
Below is a chart of a selection of maps I had installed when I wrote this, and their space savings after compression (higher is better).
How does it work?
A BSP file consists of a set of “lumps” that each contain information relevant to the map, including planes, entities and visibility data. The BSP Repacking utilities compress each of these lumps individually using LZMA compression. The exception to this is pakfile lump, which is a .zip file where each individual file instead undergoes its own compression.
Make sure you've built cubemaps and whatnot before hand, otherwise they won't be compressed!
BSPZip
BSPZip is a command-line utility shipped with the TF2 SDK, it was originally designed to handle packing of custom content into a map’s Pakfile but since the Gun Mettle update also handles compressing a map’s lumps and pakfile.
Here are some steps you can follow to compress your maps with it:
- Navigate to /SteamApps/common/Team Fortress 2/bin and shift-right-click (with nothing selected) in empty space and select “Open Command Window Here”.
- Type “bspzip -repack -compress ../tf/maps/<map_name>”
- i.e. “bspzip -repack -compress ../tf/maps/cp_snowplow”
- Wait for the process to finish, and done!
To unpack a map, simply omit the -compress from the command."..\..\bin\bspzip" -repack -compress %1
@pause
In-Game
- Open the developer console in-game
- Type “bsp_repack maps/<map_name>.bsp maps/<map_name>.bsp”
- Wait for the process to finish, and done!
Do I need to BZ2 my map too?
No! It doesn’t provide any benefit to BZ2 a repacked map, it’ll come out almost identically sized and just makes life difficult for people downloading your map.
Last edited: