HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Heavy Locker

05-21-2003, 01:30 PM#1
BlacKDicK
Quote:
*************************************************
* HEAVY LOCKER by BlacKDicK ([email protected]) *
*************************************************
* WARNING: *
* I am not resposible in any ways if this program do any damage to your *
* game files. Run it at your own risk. This tool is free, just give me and *
* ShadowFlare for her wonderfull SFMPQApi some credit. *
*************************************************

What is this?
Is a special tool that I´m still developing that will optmize MPQs (reduce
the file size). And since War3 Maps are MPQs, they get optmized too.
The optmized file will open fine both on WINMPQ and MPQVIEW, but any changes
to it using WINMPQ will probably increase the file size to its initial state.
It also can lock maps with some nice features.


I ask users to "test" the optmized file/map before releasing it coz this
tool is still on development stages, so it may have some bugs.

For more help see the Readme.txt inside the package.
LAST VERSION:
Version 0.2.8 (11/25/2003)
- User can now select the buffer size whenever protecting maps. This was done to prevent
maps with WAVEs getting bigger, as lordwiggin related.
- Probably I finally fixed the bug with comments, the "/" bug related by PitzerMike.
- Small changes to the randomization stuff used within the obfuscate.
05-26-2003, 01:25 PM#2
COOLer
How much space do you expect it to save in a map with some skins and models % wise? Also will this also stop people form stealing files add into a map because they are compressed ant when taken out still are compressed and unopenable?
05-26-2003, 05:13 PM#3
Starcraftfreak
If you have read carefully, you'd have known it:
Quote:
The optmized file will open fine both on WINMPQ and MPQVIEW, but any changes to it using WINMPQ will probably increase the file size to its initial state.
05-26-2003, 10:54 PM#4
BlacKDicK
Thanks weaaddar, :D .

Quote:
How much space do you expect it to save in a map with some skins and models % wise?
About 10-20%, but it depends on the MAP, it can get higher than 20%.

Quote:
Also will this also stop people form stealing files add into a map because they are compressed ant when taken out still are compressed and unopenable?

This is impossible to do. If you add files to a map then you must make sure the War3 can read then, otherwise the map will be corrupt. And since War3 can read it, any MPQ Extractor also can do that.

The "CORE" of the program is the MPQ OPTIMIZATION, wich takes 2 steps:

1) Reduce the size of the HASH TABLE and the BLOCK TABLE to small values (whenever this is possible).
2) Add files to the MPQ using a larger block size.

Then (if the Map optimizations are "on") it will also do:

1) Remove comments and useless lines on the map script, TXTs and *.ai.
2) Do a small optimization on the BLP (remove useless comments and realloc some things).

This can have better results if the map is using a "custom minimap" generated with Image Extractor II.
Due to a small "issue" on the Image Extractor II, the BLPs get larger than they need to be (Minimaps just need 1 frame but Image Extractor II exports all frames, wich turns to be useless). Note that on other BLPs (unit textures for an example) this can´t be done coz all the frames are needed, so we cant actually say this is a Image Extractor bug.

Also, if "lock map" is on, it will remove some "useless" files on the map and since those files are removed , the map will get "locked". This is a method discoverd some time ago by weaaddar, also known as "WTG Map Protection".
05-26-2003, 11:48 PM#5
bludragn
Maybe there should be a prompt for some things. I made a map and then erased 1 file out of the listfile so when it is opened with WinMPQ you see 1 unknown file, then I did heavy lock on the map and it deleted that unknown file without even asking. It could have been an important file, though this was just a test.
05-27-2003, 01:13 AM#6
BlacKDicK
Quote:
Maybe there should be a prompt for some things. I made a map and then erased 1 file out of the listfile so when it is opened with WinMPQ you see 1 unknown file, then I did heavy lock on the map and it deleted that unknown file without even asking. It could have been an important file, though this was just a test.

Yes I know that. But the main procedure of my tool is get the embbeded list file and then go trough it, optmizing stuff. The tool is not responsible to handle files that are not listed on the listfile.

I could also make it use an "external" listfile, but this would just make things more complicated to the user and to me, since "unknown" files would need a special handling. The main idea is to get a "good" MPQ source and then deal with it. It is the user task to provide my tool with a "good" MPQ (it must have a internal "(listfile)" and this "(listfile)" must list all the files that exists inside that MPQ.

New files created with WINMPQ and Maps created with the WE are the best, coz they have a "(listfile)" and this "(listfile)" lists all the other files. Of course some advanced users like you bludragn, know how to deal with MPQs, how to remove entries on the listfile and etc. But the "average" user is not that smart, so I'm trying to keep things as simple as possible, that´s why some options are "locked" when you select "Map Optimizations" for an example; to keep things simple to the user.

To advanced users like you a give this advice: try not to mess up with the internal "(listfile)" coz my tool will need that to work nice.

There is no need to edit the (listfile), since you can always uncheck the "include listfile" option, so your "custom" BLPs and MDXs will show as unknown on the new MPQ since it will now have the (listfile).

Some users edit the (listfile) to keep some internal files "hidden", but as I stated above, this is not needed if the user "unchecks" the "include listfile" option. The new MPQ is not going to have a listfile if that is "OFF", so you keep your work hidden. That's why when protect map is turned ON, all the other options get locked.
05-27-2003, 02:18 AM#7
MicrosoftXP
this tool doubles my map filesize...

previously 425 kb, after 'locking' it is 813 kb...
05-27-2003, 03:16 AM#8
BlacKDicK
MicrosoftXP can you ZIP your map and send me? Dont worry, will not "claim ownership" of it or neither "release" it, i just need it to check what is happening to my tool. Thanks.
[email protected]
05-27-2003, 04:55 PM#9
MicrosoftXP
sent.

edit: something I forgot to include in the zip file, the ~800 kb file was still openable by the WE.
05-27-2003, 10:03 PM#10
BlacKDicK
I uploaded version 0.1.2 wich fixes lot of bugs and adds some new things. Please make sure that the "SFMPQ" version is 1.0.7.3.

Thanks for your help MicrosoftXP. BTW, I got a 105% file reduction with your map when using "LOCK MAP - FULL LOCK".
Cool huh, 105% ownz.... :ggani:
05-27-2003, 11:12 PM#11
bludragn
I think the delete command should come after a check process. Like when you try to save over an existing archive it should check to see if it can build it first. If the mpq doesn't have a listfile or if it is the same file that is open in heavylock then it gets deleted.
05-27-2003, 11:27 PM#12
BlacKDicK
You can't save the new file with the same as the source file coz I need both files open at the same time. I'll add a small check to avoid "saving" the new file over the source file.

I´m sorry but to save the new file over the source file it would need to pre-extract all the stuff from the source then erase it and then pack all the stuff back to it. It is much easier, faster and safer to avoid writing to TEMP files. "Streaming" is better than using temp files.

And saving to another file is a good idea, since it also keep the original file "as it is". This way the user always keep the backup (to avoid complains later on, coz the protection can´t be undone).
05-27-2003, 11:36 PM#13
MicrosoftXP
holy crap 105% ?!

Did you try the new file if it works? If it DOES that is some damn impressive compression. NFJ man =)

Edited because:
i think your '% compression' calculation is wrong. If it were 105% smaller it would be less than 0 bytes. Right now you have (Old file size / New file size) ? Should be (1 - New Size / Old Size )*100% I think.

making it approxiamted 50% smaller, which does own =)
.
05-28-2003, 04:22 AM#14
BlacKDicK
Quote:
think your '% compression' calculation is wrong. If it were 105% smaller it would be less than 0 bytes. Right now you have (Old file size / New file size) ? Should be (1 - New Size / Old Size )*100% I think.

Yeah I noticed that also but it´s fixed now on the 0.1.3 version, wich also adds a small SLK optmization and fixes another things.
Getting a 53,29% (the correct value now) on your map with the "FULL-LOCK" mode.
05-28-2003, 05:24 PM#15
COOLer
Good tool i just tryed it saved 23% of a 1.13 map mod im doing wich is smaller thanks to your tool 300k. now its little over 800k. I would like to know how to make my skins & modles hidden like you said they could.