FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


TUTORIAL => Compress your BSP Files with BZIP2





mafus
The last update of Valve came brought small problems,
but also of the very useful things, such as format BZIP2.

Here I explain you how to use BZIP2 to optimize your game server

Tutorial made by Cedrsan, may 15 2005



French Version/Version Francaise:
http://forum.verygames.net/viewtopic.php?t=3544


What is BZIP2 ?

bzip2 is a freely available, patent free , high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression.

Command line flags are similar to those of GNU Gzip, so if you know how to use gzip, you know how to use bzip2.

The code is organised as a library with a programming interface. The bzip2 program itself is a client of the library. You can use the library in your own programs, to directly read and write .bz2 files, or even just to compress data in memory using the bzip2 algorithms.

Its only a one to one zipping of files, you should just bzip2 each file (to the name <filename>.bz2) and put it up on the web server (it works like the .ztmp files).


Which is the relationship between BZIP2 with Valve Source Engine ?

Source Engine integrates BZIP2 algorithm and thus allows the use of this one.

Who can use it ?

Only the admins which have a Web Server where the files of the game are stored which will be downloaded by the players (with the sv_downloadurl cvar)

I recommend to use this function only for the maps which are the largest files of the play (not necessary for other files as materials or sounds).

Which utility can one have some ?

With BZIP2, it is from now on possible to compress large files which the players must download before being able to play (e.g. Maps...)

For example :

For the moment your de_dust3.bsp file have his origin size. A player who does not have this map will have automatically to download it on your Web server.
The size of this .BSP is of 14,2Mo. For small connections, it takes very a long time to download.

You can optimize that with BZIP2 !!

Indeed, with BZIP2 you can reduce the size of this file to....3,63Mo !!
That allows an enormous saving of time at the time of the remote loading.

Another examples :

cs_bikini before => 32Mo
cs_bikini after => 10Mo

de_alivemetal before => 9,48Mo
de_alivemetal after => 4,09Mo

de_dust_pcg before => 7,25Mo
de_dust_pcg after => 2,89Mo

cs_assault_2005 before => 3,53 Mo
cs_assault_2005 after => 1,57Mo

It's not a dream You can reduce by 50 percent the size of your files


How can use it ?

BZIP2 Files are used only with the Web server. It is in this place that they will be stored. (NOT ON THE GAME SERVER )

It is enough for you simply to remove your BSP files which are on your Web server, and to replace them by the new compressed files which you will create :

First, download BZIP2 executable for your plateform => http://www.bzip.org/downloads.html

When you downloaded the file, save it at the root of your hard disk 'C:\' for a more practical use, and rename it as bzip2.exe.

Now, create a directory named BZIP2, Always at the root of the hard disk 'C:\'.

Copy all the BSP file which were on your Web Server in the 'c:\BZIP2 ' directory that you have just created.

http://cedrsan.free.fr/teamnaz/images/mani/bzip2/cmd1.jpg

Now we will compress these maps :

We need to make the operation in a DOS command line.

Click on START => RUN => type cmd => click OK

http://cedrsan.free.fr/teamnaz/images/mani/bzip2/cmd.jpg


Go to the root

http://cedrsan.free.fr/teamnaz/images/mani/bzip2/cmd2.jpg



Compress BSP files
Type bzip2 \bzip2\*.* (or for just 1 map, replace *.* by his complete name. e.g c:\bzip2 \bzip2\de_dust3.bsp )

http://cedrsan.free.fr/teamnaz/images/mani/bzip2/cmd3.jpg


Now if you look at your BZIP2 directory, it contains all your maps compressed

http://cedrsan.free.fr/teamnaz/images/mani/bzip2/cmd4.jpg

That's it !

Now you can upload these files to your Web Server. (don't remember to delete all .BSP files !!! )

All the players who do not have a map which is on your Game Server will automatically download the map from your Web Server. The compressed map that they will download will be automatically decompressed in less than 3 seconds by their Game

If you wish to test before creating your own maps compressed, I put a map here that I already compressed de_dust_pcg.bsp.bz2

Download it and simply upload to your Web Server

Have fun
davidb
cool tutarial
Related topics
751 Useful Windows XP Files
Carl's Start-to-Finish Professional Website Tutorial
The Perfect Audio Rips
Szybki i sprawny backup
about server 1 crash..questions???
Speeding Up Your PC
Switching Hosts, help me!
How do I download my directories and files
Apache
How to speed up slow PC's?
compress multiple files
LG 8600 phone. custom ringtones pls?
What is the best way to backup my files in frihost?
How to Make a Folder or File Super Hidden in Vista and XP
Reply to topic    Frihost Forum Index -> Miscellaneous -> Tutorials

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.