HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

what kind of compression for compressed file in mpq archive

01-13-2003, 05:19 PM#1
Guest
hi,
i try to buil same thing as modification tool for war3 for linux.. I succeed extract non compressed file like .blp but i failed for compressed mdx. I use Mpqview and stormlib code. do ypu know anything about the kind of compression use it's seems to be pkzip but i'm not sure about that...
thanks for your next answers.
01-13-2003, 06:04 PM#2
StonedStoopid
These two sites should be able to answer all your questions, you can find source code for winmpq and a couple libs for woking with mpq's here: http://shadowflare.ancillaediting.net/


This site has some info about using mopaq though it is alittle outdated and incompete - http://campaigncreations.org/starcra...opaq/index.htm

You will notice they don't mention how compression works other then it being a algorithm licenced from pkware(zip?) Maybe someone else has some info, since I personally haven't writain anything that pertaining to mpq's

All I have to say is good luck... because if you would be able to do this is would be a pretty nice breakthrough for war3 websites. We could finally have a script that would extract map info when some uploads a map. Im assuming thats kinda your goal with being able to read the mpq format inside linux, because I can't see any editing uses for this.
01-13-2003, 06:47 PM#3
Quantam
There are several different compression types. The original data compression used for most files in Diablo/Diablo II/Starcraft/Warcraft II BNE was PKWare's Data Compression Library (NOT the same compression used by .zips). In Starcraft they added 2 additional algorithms that are combined to compress WAVs lossily. I don't think anybody really understands the algorithms for these. Finally, in Warcraft III they added .zip compression using ZLib. Most of the data files in War3 are compressed with Zlib. However, data files in war3patch.mpq are still compressed with old DCL.
01-13-2003, 08:34 PM#4
ShadowFlare
If you are using StormLib, download the attached pkware.txt, rename it to pkware.cpp, and use it instead of the one with stormlib. Also download zlib from http://www.gzip.org/zlib/ (this address is also in that .cpp file.)
01-13-2003, 09:06 PM#5
Starcraftfreak
Hey Quantam and Shadowflare! Can you please view my article written about a DLL inside INSTALL.EXE of SCBW. The description said it's Voxware Compression Toolkit. Got to http://scfreak.0catch.com and select the second article on the right. And PM me or send me an email if you found something out.
Maybe this is the new algorithm used in SC.
01-14-2003, 10:38 AM#6
Guest
thanks for your answers. Unfortunatly all that stuff doesn't work. I 've tried to replace the pkware stuff by the one you gave me, no change. I always get a file (a dot mdx) with the good length but empty with the stormlib code or the mpqwiev code under linux or windows. Maybe these src doesn't work with compressed file...
I begin to think that i should use the storm dll under linux. Cause the other programms using this dll work perfectly under windows. What do you think about that. And if you got stormless src code that read all file in the .mpq i will take it :). Well thank a lot for all.
-->ShadowFlare i'm sorry but your Pkware.txt is very close to the one in the stormlib and it doesn't change anything for decomprssion stuff cause the only function that differ from the first one is not call during the process (i try to get the Tichondrius.mdx for instance)
01-14-2003, 08:28 PM#7
ShadowFlare
It isn't that much different, but it does change something. Download zlib (required to compile my version of pkware.cpp) and try using my pkware.cpp file. It should work. The only difference between how war3 files are added to archives and how any other files are added is the compression.
01-15-2003, 08:29 AM#8
Guest
I still got the zlib install. The new function provide by the pkware you provide is
void Inflate(BYTE * outBuffer, DWORD * pOutLength, BYTE * inpBuffer, DWORD inpLength)
{ uncompress(outBuffer,pOutLength,inpBuffer,inpLength);
}

and i don't find anything about the function uncompress in the pkware.cpp file nor in the zlib.h . This function is not call during the extraction of a .mdx from a war3.mpq. So.... Thanks a lot for your effort. If you got any other idea let me know :) thanks.
01-16-2003, 08:12 PM#9
Starcraftfreak
Hey Shadowflare, can you please check out, what I asked? Look at my last post in this thread and tell me afterwards what you've found out.