[TIP] How to compress .bsp to .bz2 with 7zip

Fruity Snacks

Creator of blackholes & memes. Destroyer of forums
aa
Sep 5, 2010
6,394
5,571
It is not necessary to do this when submitting maps for gamedays, but it makes the uploaders job easier and quicker if you compress your map to a .bz2, so here is a simple and quick guide on how to do it.

Before you compress, you need to make sure your maps custom assets are packed properly. The best programs for this is either Pakrat, or PackBSP. How to pack custom assets is not included in this guide, but should be covered in the programs documentation.

Step 1: Get 7Zip.
If you don't have it, get it here, and install it. If you do have it, skip to step 2.

Step 2:
Go to your tf/maps folder (steam/steamapps/{UserName}/team fortress 2/tf/maps. Here you will see a list of maps that end in .bsp [shown below]
bzip1.png


Step 3:
Right click on the .bsp of the map you wish to compress. Then click, 7Zip > Add to Archive.
bzip2.png


Step 4:
In the window that opens up, click the "archive format" drop-down menu and select the bzip2 file format. Do not adjust anything else. **Do not adjust the name of the file**
bzip3.png


Step 5:
Click ok. You now have, beneath the original map file, a .bz2 compressed map file, ready for you or someone else to upload to the game server(s). You can move this file to your dropbox, or use the fancy file hosting services provided by this site.
 
Last edited:
Jan 8, 2011
397
393
Isn't there BSPacker or something like that for packaging custom content? You might want to mention that.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
It's also nice if you compress at ultra rather than normal. For the sake of fractions of a second on your part you reduce server operaters bandwidth usage (when the map is downloaded from servers or directly from sites), but more importantly reduce the time people wait to download the map ingame which can be significantly slower than downloading from a web host.

I'm probably being pedantic, but it's thoughtful none-the-less.

It might be useful explaining that 7zip is used because it's a compatable compression format used by Source. Always good to teach the kids a little more about stuff.
 
Last edited:

Fruity Snacks

Creator of blackholes & memes. Destroyer of forums
aa
Sep 5, 2010
6,394
5,571
Bump, because less and less people are doing this.

It's frustrating to people who have to upload or host files to have to wait an extra 30-40's (or more) per upload because people don't compress their maps. Take the extra 5 seconds yourself, and make everyone elses lives easier. (It'll also save you time uploading it yourself)
 

Berry

resident homo
aa
Dec 27, 2012
1,056
1,898
Bump, because less and less people are doing this.

It's frustrating to people who have to upload or host files to have to wait an extra 30-40's (or more) per upload because people don't compress their maps. Take the extra 5 seconds yourself, and make everyone elses lives easier. (It'll also save you time uploading it yourself)

I preach this. Currently I think I'm the one hosting the largest portion of imps regularly and I've noticed that since around 6 (minimum) months ago, the amount of people BZ2ing maps has dropped incredibly (generally because the people regularly in imps has definitely changed) to the point where imps are me BZ2ing every single map that is not uploaded.

Anyone who does not BZ2 your map, you know who you are, and it takes 2 minutes to learn it, and 20 seconds to BZ2 it (it will also upload to dropbox/tf2m's service faster)!

Edit:
The last impromptu not hosted by me was on the 20th of March, 3 weeks ago (21 days) by Egan, and since then there have been 20 impromptus (hosted by me). This means I'm currently hosting a very large portion of impromptus. As of now, all maps in impromptus hosted by me that are not pre-uploaded or BZ2'd will receive lower priority in the test.
 
Last edited:

UKCS-Alias

Mann vs Machine... or... Mapper vs Meta?
aa
Sep 8, 2008
1,264
816
About the bzip process. The compression level should be as high as possible. Its a 1 step process but on larger maps it can affect the size quite a bit. Even on small maps its better to have 6mb instead of 7mb.
As it can make your pc slow just make sure you keep 2 cores free (when you have 4 or more cores). This makes it barely slow down your pc and even when it would take 5 minutes allow you to proceed as normal during those 5 minutes (instead of having a very laggy pc for 2 minutes).

Although its bad practice i personaly still use .zip as it can be read without the need of a program like 7zip. This is the major advantage .zip has (well.. for map packing its the only advantage), .7z and .bz2 both are more efficient than .zip. I tested it on:
intercept (fully dev textured):
unzipped: 7.294mb
7z: 2.095mb
zip: 2.802mb
bz2: 2.592mb

skullcove (fully textured, more props a few custom textures):
unzipped: 13.019mb
7z: 4.272mb
zip: 5.762mb
bz2: 5.547mb

Still, even using the least effective method its still compressed by over 50%.

Note though that in the case of mvm maps it currently is still better to use a zip file as popfiles packed within the map (other than the 'normal' difficulty mission) cannot be chosen in votes when packed within the map. But putting the bz2'd file within the zip is still fine that way as it keeps its compression.
 

Sergis

L666: ])oo]v[
aa
Jul 22, 2009
1,874
1,257
Bump, because less and less people are doing this.

It's frustrating to people who have to upload or host files to have to wait an extra 30-40's (or more) per upload because people don't compress their maps. Take the extra 5 seconds yourself, and make everyone elses lives easier. (It'll also save you time uploading it yourself)

in a supermarket near me, there are two special kinds of lines. one is no cash, cards only, another is "quick" five or less things. five things one isnt being enforced and most people just ignore the rule. no cash one however, if people want to pay with cash the cashier just says "lol we dont do cash here we dont have cash here get your shit and go to another register. i dont give a fuck how long you have been wating in the line". maybe not those exact words but this exact intent. and there aint nothing people can do to ignore that so they stfu, get their chit and go wait again in another line.

moral of the story if you want bz2 you accept bz2 only and tell people with bsp to go bz2 themselves.
 

obodobear

L4: Comfortable Member
Mar 15, 2016
172
32
Thank you, this helped me out greatly.
 

hutty

aa
Mar 30, 2014
538
444
Correct me if I'm wrong, but this post is outdated. Valve has added their own method of compression when they added the map workshop, valve's system compresses better and the benefits don't stack with .bz2.

To do this type of compression manually run this command from the same folder that hammer.exe (steamapps/common/tf2/bin) is in using the windows commandline

bspzip -repack -compress ../tf/maps/<map_name>

when its done you should notice a near 50% decrease in your .bsp size
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
@obodobear BZ2 compression for maps has been superseded by BSP repacking. It's still useful to compress separate resources using BZ2, like the sounds and models that custom server operators sometimes have for donators and custom game modes like Versus Saxton Hale, but anything that a map author packs into their map is compressed when using BSP repacking.
 

obodobear

L4: Comfortable Member
Mar 15, 2016
172
32
Ok I'm glad you guys told me this lol Im gonna check out the other thread now
 

obodobear

L4: Comfortable Member
Mar 15, 2016
172
32
I think that either would be fine; a redirect might be nice because this thread was the first thing that showed up in my google search "how to compress a bsp file". Also the other compression method that was linked went off without a hitch.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
I've been testing here and there and there may actually be quite a few bugs with bsp_repack.
Not entirely sure if it has to do with the compression, but I've gotten a few reports of certain things messing up when using bsp_repack as opposed to just compressing it into a bz2 (which, it seems, upacks itself once it's downloaded anyway - as oppose to bsp_repack which always stays packed).

The other thread mentioning it, mentioned light refracting problems. For me, it seems some people may have a loss of skybox lighting or their weapons turning pure chrome when in areas only lit by the skybox.

Again, not sure if it's caused by that certainly, but it's a possibility. Will investigate further.

EDIT: It was not caused by compression. Totally unrelated problem. I did still read there was a problem with refracting surfaces though.
 
Last edited:

ArmorKeik

L1: Registered
Dec 11, 2021
4
0
The images uploaded by Fruity Snacks are down!

So I rewrite the text but with screenshots taken by me; I can delete this answer and give the images to the original creator if requested.

Step 1: Get 7Zip.
If you don't have it, get it here, and install it. If you do have it, skip to step 2.

1_Get_7Zip.png


Step 2:
Go to your tf/maps folder, by default: steam/steamapps/{UserName}/team fortress 2/tf/maps, or to: tf/download/maps. Here you will see a list of maps that end in .bsp [shown below]

2_Go_to_your_maps_folder.png


Step 3:
Right click on the .bsp of the map you wish to compress. Then click, 7Zip > Add to archive.

3_Add_to_archive.png


Step 4:
In the window that opens up, click the "archive format" drop-down menu and select the bzip2 file format. Do not adjust anything else. Do not adjust the name of the file.

4_select_the_bzip2_file_format.png


Step 5:
Click ok. You now have, beneath the original map file, a .bz2 compressed map file, ready for you or someone else to upload to the game server(s). You can move this file to your preferred cloud storage, or use the elegant file hosting services offered by this site.

5_You_now_have_a_.bz2_compressed_map_file.png