General - Map Size Management: Saving the Last Byte

Tutorial By Doomhammer

Map size management - How to reduce the filesize of my map?

Bigger is better? - Not when it comes to filesizes!

This tutorial is for all those with quite a large amount of imports, who wish to further reduce the filesize of their map.

Your benefit with smaller map sizes: faster up- and down-loading of your map, especially in Battlenet: maps larger than 4 megabytes are against the Battlenet convention

So this tutorial is not about the actual importing of audio and image files, such as icons, floortiles, sounds, etc., it's about how to squeeze the imported files to the optimum: maximum compression at minimal to barely noticeable quality loss

Overview:


1) Introduction
2) Textures
3) Models
4) Sound Files
5) Finishing touches



1) Introduction


What does compression mean?

Basically any filetype imported into your map file will be compressed to a certain extent when saving the map. From its principle it's like putting all imported files into a zip archive, namely your map.
Zip compression of media files is lossless, and therefore in many cases not very efficient. Fortunately, several different codecs (COmpressor-DECompressor) have been developed in the past years, to allow significantly higher compression rates, yet (with few exceptions) at the loss of information. Best example the Fraunhofer mp3 codec, which dramatically reduces the filesize of an audio file when compressed e.g. at 128kb compression, yet keeps the loss of information i.e. 'quality' in the range of barely noticeable.
Warcraft 3 supports only some of them. In quite a few cases a work-around is needed to make use of compression methods. How to do that is explained in the sections following.

Depending on quality and quantity of your imported material, the following procedures may or may not be worthwhile. Obviously, the larger your map size, the more it is recommended to slicken your map. With barely any imports and your map size significantly smaller than 1MB, compression won't be much of an issue for you.

Disclaimer:
Be adviced that the following procedures involve a loss of (redundant) information and therefore a loss in quality which may or may not be noticeable. Any of the procedures described pose potential dangers of corrupting your file. Never overwrite originals, always have savety copies ready!




2) Textures
size saving potential: ~ 20% - 60% per image file

tools needed:

BLPaletter
http://www.wc3campaigns.net/showthread.php?t=86878

download the exe file ( latest versoin 1.5b)
download the GUI
extract both into a new folder

The BLPaletter allows you to compress *.blp files, which is the main image format Wc3 uses. This concerns imported skins / textures and icons. The great thing about BLPaletter is the implementation of jpg compression which allows further significant gains in compression. Its usage with the GUI is very straightforward: Click the button Open to open your texture or icon. Specify the name of the compressed blp in the second field from top. Below, check use JPEG compression to get the full potential of jpg compression. Leave the next field as is when, since it does not apply to JPEG compression. In the field below you can specify your compression rate. I recommend a compression rate of about 75 – 85 for all those textures that are seen a lot in the game, and about 55 – 65 for those rather rarely seen, such as disabled icons.

Links:

The Helper tutorial on icon creation and import
http://world-editor-tutorials.thehelper.net/icons.php




3) Models
size saving potential: ~ 30% - 40% per model file

tools needed:

MDX Squisher
http://www.wc3campaigns.net/showthread.php?t=83416

As its name says, this tool allows you to squish model files resulting in significant compression rates. As stated in the readme, it is adviced not to use this tool several times over already squished models, which may result in a noticeable loss of quality. Recent models (e.g. from hiveworkshop.com) may already come along squished, which should be stated in the model description. In that case, do not squish the model again.
The usage of the MDX Squisher barely merits explanation. Open the model file to be compressed. Save it. Done.




4) Sound-files

size saving potential: ~ 50% - 80% per sound file

tools needed:

BeSweet
http://www.doom9.org/
go to download
go to audio tools
click BeSweet 1.5 to download the file


Lame compressor

http://www.doom9.org/
go to download
go to audio tools
click Lame 3.95.1 to download the file


BeSweet GUI
http://besweet.notrace.dk/BeSweetGUIv0.7b4.zip

Alternative path for the package BeSweet + BeSweetGUI + Ac3Machine:
http://rapidshare.com/files/50817755/BeSweet-guiv07b4-wizardv02b1.rar


Note: for this procedure it is important to use DSPGuru's official GUI. The other BeSweet GUI, BeLight does not include the desired options.

Sound files in Wc3 are saved as 22,050 khz, 16 bit, 1 channel pcm wave files. When you import your own sounds, they have to apply to these specifications, with the exception of music, which is saved in mp3 format.
Wouldn't it be great to import other sounds as mp3, too? Unfortunately, that's not possible. Yet there is a trick, so you can import your sounds with mp3 compression, yet "disguised" as *.wav file. We can nonetheless get hold of the benefits of audio compression using the mp3-wave format, which is mp3 compressed sound attached to a *.wav fileheader. Out of the wide range of commercial and non-commerical audio converters out there, I have found one which is free, very efficient, has an enormous functionality, and can be installed and used within a few minutes.


The great thing with besweet is that it can all be done using the command line. Yet as we're all born with a computer mouse in the craddle, I'll explain the GUI setup and procedure. The setup routine poses a few minutes of work. Fortunately you only have to set it up once.

Setting it up:

1) Extract the BeSweet package to a new directory. Let's call it "BeSweet".

2) Extract the GUI files into your BeSweet directory. Confirm overwriting the *.dll

3) Extract the Lame compressor into your BeSweet directory

4) Open the GUI

5) Set the Besweet.exe file path to the BeSweet.exe

6) Click on Lame1 and set the lame.exe file path


Audio Conversion:

That's for the file setup. As follows what it takes to convert your wave file to mp3-wave

1) select your input file

2) Check through the settings pages:

- Azid1: leave as is; if your sound is too loud, have a play with the normalizing values

- Azid2: uncheck if any is checked

- SSRC: leave as is, or set to 22050

- Lame1: Set "Mode" to mono if your input file is mono, to "Stereo" if your input file is stereo; optionally: check "Turn ATH down to a Flat Noise Factor"

- Lame2: Check "Error Protection", Now the important part: Set "CBR" to 96 (or 128 for slightly higher quality)

- Lame3: Uncheck all

- 2Lame: Leave as is

- BeSweet: Uncheck SRRC, uncheck Boost; important: under Lame set MP3-WAVE
the OTA options should all be unchecked

3) Select output file. Make sure to set a different folder or filename than the original

4) Let's go: Press WAV to WAV

The settings will be saved, btw. I'd yet recommend to save your
settinsg as custom setting profile. Now listen to your soundfile with audioplayer/winamp/other


Links:

Tutorial on custom sound import
http://www.thehelper.net/forums/showthread.php?t=39614




5) Finishing touches


size saving potential: ~ 10% - 20% overall map space

Tools needed: Wc3mapoptimizer
http://www.wc3campaigns.net/showthread.php?t=79326

A very popular tool developed to optimize map code and map strings is Vexorians map optimizer.

This should be the final step in our map compression odyssee. Keep in mind that certain options of the map optimizer prevent the map from being opened and edited. So always make sure to have a copy of your latest map version before using this tool on it!

Leaving aside the grand part of its great functions which are best explained by the readme (found under: About.. - Documentation - readme.html), the following options emphasize on smaller filesizes.

Under Script Optimization check:
ZLib Deflate

Under Map Optimization Options check:
Optimize string usage
Clean BLP's.
If you have script files such as AI scripts imported, also check: also optimize other scripts

Under extra Cleaning check:
Remove Editor Suffixes
Remove Editor Only Files
Remove as much WE-only data as possible

I suggest you have a test run with your map after the procedure.
Having gone through all of the steps above you can with good conscience claim to have optimized the filesize of your map to the utmost possible.



So that's about it! Hope that helps to save one or the other Megabyte!

Click here to comment on this tutorial.
 
 
Blizzard Entertainment, Inc.
Silkroad Online Forums
Team Griffonrawl Trains Muay Thai and MMA fighters in Ohio.
Apex Steel Pipe - Buys and sells Steel Pipe.