HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Heavy Locker

05-28-2003, 10:52 PM#16
BlacKDicK
With *.MDX instead of using standard "paths" like "Units\Human\HeroPaladin\HeroPaladin.mdx" you add your custom-mdx to weird paths like "abc\xyz666\mycustom.mdx" and then set your units to use this path instead of the usual one. (you can change wich model a unit is using both on the SLK and on the WE-Unit Editor).

To do the same thing for *.BLP the procedure is a little harder. You need to do the same as above AND ALSO open your custom-MDXs that re using that texture (BLP) and change the pathing for the texture to the new path, otherwise the MDX will not find the texture BLP.

Keep in mind that this will not prevent users from getting your stuff, it just make things a little harder , coz WINMPQ can extract files even if the user don´t know the file name. This procedure just leav the files as "unknowns" inside WINMPQ.
05-29-2003, 07:29 AM#17
Krakou
Hi BlacKDicK,

I love your tool, I have downsized my 18Mb mod by 56% :D

But I have one pb, the question marks of the undiscovered quests are all green squares after the compression of my War3Patch.mpq.
05-29-2003, 04:43 PM#18
bludragn
Krakou that's not a good idea. I think I remember reading in an earlier version, that you shouldn't use this on the game MPQs.
05-29-2003, 05:45 PM#19
Krakou
I don't use this on the Game MPQ but on MY MPQ the MPQ of my mod.
05-29-2003, 08:21 PM#20
BlacKDicK
To use it WITH MPQs, the best idea is:

1) Include (listfile) if you want a listfile on the new MPQ.
2) If this MPQ is from WAR3, then select "Force ZLIB"
3) Use a "level 11'' buffer size.

Do not use "map optmizations" neither "lock map'" with MPQs coz this can create weird results.
05-30-2003, 05:21 AM#21
Starcraftfreak
As far as i understand it just rebuilds the MPQ with the lowest possible hash table size and Deflate compression to ensure that it is small.
But does it remove the comments too (from profile and SLK files), if you do, what you just said, BlacKDicK?
05-30-2003, 08:15 AM#22
Krakou
Thanks BlacKDicK it works now, I think I had the "map optmizations" checked.
05-30-2003, 08:53 AM#23
BlacKDicK
Quote:
As far as i understand it just rebuilds the MPQ with the lowest possible hash table size and Deflate compression to ensure that it is small.
But does it remove the comments too (from profile and SLK files), if you do, what you just said, BlacKDicK?


There are some things that my program will always do:
* Reduce the hash and block tables to the nearest power of 2 of the "current" file count.
* Increase the block level (buffer size) to the new amount in bytes
(This expains why having a complete "(listfile)" inside the MPQ is so important: Coz i need to know BEFORE creating the new MPQ how much table space I need on the new MPQ).

Then it will pack the files to the new MPQ. If "ZLIB" is on, it will use ZLIB, otherwise will use the old-PKWARE procedure.
WAV always go using wav compression and SMK+BIK do not get compressed at all.

Then ONLY IF "MAP OPTMIZATION" is on, it will also:
* Remove comments and empty lines from *.j, *.ai and *.txt.
* Remove comments from *.SLK
* Do a small optmization on the minimap Picture (I do not Re-encode the file using lower JPEG-quality, I just remove some useless stuff on the MiniMap BLP)

Then ONLY IF "LOCK MAP" is on it will lock the map using weeddar´s method.

See, that´s why when you select "LOCK MAP" I do not let the user "change" the other parameters to have the best results as possible.
05-30-2003, 10:06 AM#24
Starcraftfreak
Quote:
Originally posted by BlacKDicK
Then ONLY IF "MAP OPTMIZATION" is on, it will also:
* Remove comments and empty lines from *.j, *.ai and *.txt.
* Remove comments from *.SLK
* Do a small optmization on the minimap Picture (I do not Re-encode the file using lower JPEG-quality, I just remove some useless stuff on the MiniMap BLP)

Well, but the comments removal would also be good if someone wants to optimize a modded War3Patch.mpq.
05-30-2003, 10:18 AM#25
BlacKDicK
Yes, but I´m not 100% if removing comments on MPQs would work nice. Anyway, do do that, you just need to leave MAP Optimizations "ON".
As I said, I´m not sure if this is going to work, as it didn´t for Krakou. ( I think I need to test this stuff, coz my "comments removal" procedure may be removing more things that it is supoded to do) :nono:
05-30-2003, 06:10 PM#26
Starcraftfreak
That would not be that what I want. I want to have a MPQ optimization without the BLP optimization. Maybe you make a prompt for that in a GroupBox titled "Expert Settings". They are set to default values (later you can make that your program writes into an INI file or the Registry which have been enabled the last time). So if the professional (I think this tool will be majorly used by professionals as most others are too lazy to find it ) user wants something special, he can set it.

BTW, what do you think about making it an open source project?
05-31-2003, 12:35 AM#27
bludragn
I noticed how you do not use the latest SFmpq library, why's that?
05-31-2003, 01:18 AM#28
BlacKDicK
The last one (1.8.1) is still a beta and also causes some weird behaviors to the "trick" I´m currently using to append "HEADERS" and "FOOTERS" that may exist on the Mpq.
Maps do have a 512 byte header, so this would corrupt the new map. The 1.7.0.3 is good and I can´t see any advantages on using 1.8, just disadvantages.
05-31-2003, 06:54 AM#29
Starcraftfreak
I'd write the MPQ (if I knew how to do that:nono: ) and add the header afterwards (reopen the file, add the header, add the map header, done).
05-31-2003, 08:16 AM#30
BlacKDicK
Quote:
I'd write the MPQ (if I knew how to do that ) and add the header afterwards (reopen the file, add the header, add the map header, done).
The problem was that sometimes I needed to start the MPQ NOT on the "standard" offset 0, so I need to save some space on the MPQ BEFORE writing it. Of course I could create a "TEMP" mpq, write all stuff inside it, create a target file and then copy all the stuff from the MPQ to the target file and kill the "TEMP", but this would take too long. Better pre-alloc space on the MPQ and then after the MPQ stuff is done, we deal with the headers/footers.
As I said, for some weird reason SFAPI 1.8.0.1 do not work nice with this and almost all the time the new file get corrupted. Create temp files is always a bad idea.

Quote:
That would not be that what I want. I want to have a MPQ optimization without the BLP optimization
This is already possible, just uncheck that map-opt option. Of course I could check if the source is in fact a War3-MAP and then only enable some specific options if this check is true. But sometimes the idea is also optmize the BLPs/TXTs/SLKs that are inside MPQs, so I left this selectable instead of locking based on the source. Those are some "user sets" that should work nicely:
* If it is a War3/FT MPQ then only use Listfile+ZLIB
* If it is a War3/FT W3M then select Map Optmizations or lock-map.
* If it is not a War3/FT W3M neither MPQ just leave listfile checked.

Of course "Map Opt" will work with war3 MPQs but the results are not always good, as Krakou already observed. Bu the original idea is to make those optmizations wotk both on W3/FT W3Ms and MPQs.

Quote:
BTW, what do you think about making it an open source project?
I´ll not make it "full-open source", just some guys only. I´m cleaning up my code a bit (Its is a complete mess now). I guess about next thursday I cand send it to you SCFreak.