This is beta software
Always make backups, it could easily eat your kitten, etc.
This tool uses a deflate implementation by Google which takes around 100 times longer but also produces something between
3% and 10% smaller files.
For most of you this probably is pretty useless but i assume that for people who scratch at the 8MB map limit every saved byte
is precious.
So this tool is no wonder tool so first use other mechanisms of lowering your maps size such as model and image compression.
But you probably want to use it in conjunction with other tools such as the w3mapoptimizer.
The w3mapoptimizer removes the listfile which is essential1 for this tool to work.
If no listfile is found or your listfile isn't sufficient it will say so.
So to use it with w3mapoptimizer you can provide an additional listfile:
Additional options and tweaks are explained below.
If you want to use this tool you should avoid map protectors.
First of all: they don't work, if WarCraft can read your files so can everybody else.
But secondly either if you use this tool after any protectors it probably wont work as i only parse valid MPQs as written by worldedit.
Or if you use this tool first and then some protector it will probably undo the compression made by this.
So you should use this tool as your last step in publishing your map.
MPQs have the ability to store files as a single block instead. If so the flag 0x01000000 is set.
An earlier version of this tool used this flag but WarCraft wouldn't open the maps. So either this flag is not used
for maps or i made a mistake. If someone knows about this please tell me.
Update 12.02.2017:
Updated zopfli and finally released version which can read any wc3 map.
All the decompression routines except for zlib taken from StormLib.
Zlib-decompression via miniz.
______________
^1: It could work without listfile but it would take quite some extra time implementing which i don't feel is neccessary as this tool is intended to be a dev-tool for mappers who have access to their maps listfile.
Always make backups, it could easily eat your kitten, etc.
What is it
WarCraft 3 stores files inside the mpq compressed. The algorithm used is deflate.This tool uses a deflate implementation by Google which takes around 100 times longer but also produces something between
3% and 10% smaller files.
For most of you this probably is pretty useless but i assume that for people who scratch at the 8MB map limit every saved byte
is precious.
So this tool is no wonder tool so first use other mechanisms of lowering your maps size such as model and image compression.
How to use it
In the best case it's very easy to use as it expects only two files: the input map-file and the output map-file.
Code:
$ compress.exe mymap.w3x mymap_min.w3x
The w3mapoptimizer removes the listfile which is essential1 for this tool to work.
If no listfile is found or your listfile isn't sufficient it will say so.
So to use it with w3mapoptimizer you can provide an additional listfile:
Code:
$ compress.exe -l /path/to/listfile.txt mymap.w3x mymap_min.w3x
If you want to use this tool you should avoid map protectors.
First of all: they don't work, if WarCraft can read your files so can everybody else.
But secondly either if you use this tool after any protectors it probably wont work as i only parse valid MPQs as written by worldedit.
Or if you use this tool first and then some protector it will probably undo the compression made by this.
So you should use this tool as your last step in publishing your map.
Options
Option | Default | Explenation |
--threads, -t | 2 | The number of threads that are started. A good value would be the number of cores your CPU has. |
--iterations, -i | 15 | How many iterations are spent on compressing every file. Increasing this slows down the tool even further. |
--listfile, -l | not set | Additional listfile if the map internal listfile is not sufficient/non existent. |
--shift-size, -s | 15 | Sets the mpqs blocksize to 512*2shiftsize. Blizzard uses 3 and w3mapoptimizer recomends 7. |
--block-splitting-max | 15 | Maximum amount of blocks to split into (0 for unlimited, but this can give extreme results that hurt compression on some files). |
Internals
MPQs have the ability to store files as a single block instead. If so the flag 0x01000000 is set.
An earlier version of this tool used this flag but WarCraft wouldn't open the maps. So either this flag is not used
for maps or i made a mistake. If someone knows about this please tell me.
Update 12.02.2017:
Updated zopfli and finally released version which can read any wc3 map.
All the decompression routines except for zlib taken from StormLib.
Zlib-decompression via miniz.
______________
^1: It could work without listfile but it would take quite some extra time implementing which i don't feel is neccessary as this tool is intended to be a dev-tool for mappers who have access to their maps listfile.
Attachments
Last edited: