| 02-13-2006, 03:31 AM | #1 |
When I use SFMPQ.dll to compact my map, it always corrupt some of the files, sometimes war3map.j, sometimes war3map.wpm or something else. But Map optimizer 3.9b can successfully compact it. What's the problem? If there is a trick on it, let me know. Thank you. |
| 02-14-2006, 07:04 AM | #2 |
Do you have problems using the MpqCompactArchive function or do you have problems with using the MAFA_COMPRESS flags? |
| 02-14-2006, 07:20 AM | #3 |
problems using the MpqCompactArchive function. The function can compact my map (decrease file size) but always failed to load in war3. |
| 02-14-2006, 08:14 AM | #4 |
MpqCompactArchive is not designed to "compact" archives. It´s name leads to confusion. This function actually has another use: to purge unused/deleted entries on the Mpq that are not used anymore. Here is the deal: Whenever you delete a file inside a Mpq Archive, the file is not actually deleted. Instead, it is tagged as unused/deleted and it´s slot may be used by another one. But the file´s content still remains there, hence we came up with a problem: how to remove this old file´s content? The answer is MpqCompactArchive. It actually "purges" the Mpq removing any unused content inside it. Actually, it will create a new Mpq and only add to this new Mpq the files that are tagged with the (MAFA_EXIST 0x00000001) flag on the existing Mpq and then delete the old Mpq. To reduce map size there are some advanced tricks, the first one being the sector size ("block level") hack/mod. Then, by cleaning up ther files like maps scripts we can also achieve map size reduction. |
| 02-14-2006, 08:32 AM | #5 | |
Quote:
But my problem is that after I "compact" my archive, I can extract/read files such as war3map.j correctly by winmpq or any other mpq tools. however, if I run this map in game, it crashs, says "file data corrupt war3map.j"... actually the file is completely the same as it is before compact. |
| 02-14-2006, 02:27 PM | #6 |
It seems that War3 says "file data corrupt.." because the (attributes) file was not updated, holding the hold CRC32 values of the "purged" files. Try to remove the "(attributes)" from the map and see what happens. (Always keep a backup, just in case) |
| 02-14-2006, 07:42 PM | #7 |
Yes, the (attributes) file might be the problem. The options are A) removing the (attributes) file or B) recompiling the attributes file. Also I think that MpqCompactArchive requires a complete listfile in order to not miss unknown files in the newly built archive. So another possible problem could me missing files in the new archive. A solution to this problem is firstly assuming all the standard files (starting with war3map) and then parsing the war3map* files in the map for paths of the other files in the map. |
| 02-15-2006, 01:43 AM | #8 | |
Quote:
|
| 02-15-2006, 02:15 AM | #9 |
btw did I remember to tell you guys that wc3 only checks (attributes) if there are at least 5 lines in (listfile) ? |
| 08-06-2006, 03:42 AM | #10 |
how could we rewrite attributes file? |
