• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Compressing imported files

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

Does anyone have links to the compressors for all types of imported files:

.BLP, .MDX, .MDL, etc.?

I am guessing it is prudent to compress icons as well as model files too to lower map size?
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
Sorry what optimizer? I thought I had to use a separate program that compressed each file before I imported it into the map?
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
Well, for mdl/mdx you can use the MDXSquisher. Its won't show a visible difference in filesize but squishing models will help it compress better. BLPlab for blp files. And for the whole map, you can use Vex's map optimizer or maybe some other map optimizer and it will do a lot to your map that will reduce filesize. Though when using a map optimizer, you might want to create a backup of your latest map because once you optimize the map, you won't be able to open it in the WE.

EDIT: What solu said too.
 
A quick note before I give some info: maps themselves are MPQ files (just like the ones that store game files). Blizzard uses this format to store data, but it also features compression (zlib). This makes the files easily distributable, especially for patching and digital downloads.

Since maps are MPQ's, they also compress the files within them. As such, your map can hold over 15 MB of data, but still end up less than 8 MB. They use zlib compression (which is why when you put a map in a zip file, you hardly get any difference in file size). Keep this in mind for later.

Models:

There are several ways to compress models. Manually, you can delete animations you don't need, or you can merge faces. But that usually won't make a big difference. If you are using WoW models, look into the compression features in MDLVis.

As for models in general, you should look into either of these two tools:
MDX Squisher
MDX/M3 Optimizer

Both work just fine, but the latter is more recent (made by GhostWolf), and has additional options, such as animation (if you enable that option). It does not have a GUI (MDX Squisher does), but you simply need to drag a model onto the .exe to receive a compressed one. For control of the features, use command prompt.

Note: The model might not appear compressed at first. It will be the same file size (if you are using Guesst's), but it optimizes it for zlib compression (by the map). It zeroes out the least useful bytes. As such, you won't notice it until you import the model. For example, if you import the squished model into a blank map, and the non-squished model into a different blank map, then the map with the squished model will have a lower total file size.

(As for MDL's, convert them to MDX. MDL's are just the human-readable counterpart to the compressed, encrypted MDX format)

Textures:

Textures are best compressed through BLP Lab. Simply open the texture up, go to File -> Save As, and choose your optimization settings.

  • JPEG Compression - This compression is the most common compression. It blurs as more data is lost. Generally, you can use 60-70% compression and not notice a difference in game. You can even go lower if necessary.
  • Paletted Compression - This compression is similar to the effect from GIF's (Posterization). This option is ideal if you are using only a few colors (look at the bottom right corner in BLP lab to see the color count). If the file is generally monotone, you can use this option. I'd keep it to 256 colors though, and diffuse/dither w/e to reduce the posterization. Again, paletted compression isn't one you'll notice right away. If you compare a paletted blp to a JPEG blp, the JPEG will likely be lower in file size. But you don't see the effect until the file is imported. As a quick test to see which is lower, you can try adding them to a zip archive and choose from there.
  • Mip Maps - Info. This option can cut quite a bit out of the file size. Generally, you should keep the mip map count above 2 (going lower may affect people with low quality texture settings). However, if you reduce them with a JPEG compressed BLP, then it will crash the game on a mac. As such, I usually leave this set to 16 (BLP lab will automatically lower it as necessary depending on the dimensions to get the correct amount of mip maps). If you are using paletted compression, you can reduce this to 2 without any issues on a Mac.
  • Dimensions - This isn't an option in BLP Lab, but I figured I'd mention it. You can save quite a bit of size by reducing the "HD" textures (textures that are 512x512 or 1024x1024) down a step (e.g., to 256x256). You would just convert to JPEG, use an image editor to resize, and then convert back to BLP.

BLP Lab will also do some side compression that just removes useless bytes (it usually only saves a couple of hundred bytes [not kb], but everything counts!)

Sound:

Use Audacity, along with the LAME mp3 codec. If you don't need your imported sounds to be 3D, convert them from wav to mp3. You can reduce the bit rate as necessary and save a ton of bytes.

Finishing Touches:

Use Vexorian's optimizer (linked above). It will remove editor only files (so you won't be able to open it in the editor), which will save a good chunk of bytes. It has script optimization as well (remove unused junk, shorten names, obfuscate, etc.). As noted above, make sure you have a backup (JNGP keeps backups anyway, and afaik optimizer will make a copy file).

With all this, you should be able to save not just KB's, but MB's of data. Sorry for being long-winded. I know all of this isn't necessary, but I think it is useful to know what the tools actually do.
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
This is exactly the response I was looking for, many thanks PurgeandFire. Your post in itself is the perfect resource for when I'll be moving the imported files to the map.

Just one question: how does one convert a .MDL to .MDX?
 
This is exactly the response I was looking for, many thanks PurgeandFire. Your post in itself is the perfect resource for when I'll be moving the imported files to the map.

Just one question: how does one convert a .MDL to .MDX?

You can use Guesst's MDLX Converter:
http://www.hiveworkshop.com/forums/tools-560/mdlx-converter-62991/

Or, if you have Magos' Model Editor, you can use that too. Just open the .MDL, then go to File -> Save As, and add ".mdx" to the end.
http://www.hiveworkshop.com/forums/tools-560/war3-model-editor-62876/

And no problem. This question comes up every now and then, so I don't mind making a long post that I can link back to. :p
 
Status
Not open for further replies.
Top