魔兽世界 MPQ(MoPaQ) 文件相关资料
維基百科:http://en.wikipedia.org/wiki/MPQ?
維基百科下面的外部鏈接也是個好東西
?
?
MPQ Archives
Overview
原文出處:http://www.zezula.net/en/mpq/main.html
?
MPQ Archives
MPQ (MoPaQ) is an archive format developed by the?Blizzard Entertainment?company, intended for storing data files, images, sounds, music and videos for their games:
- Diablo
- StarCraft
- Warcraft II (Battle.net Edition)
- Diablo II
- Warcraft III
- World of Warcraft
They are also used in games Lords of Magic and Hellfire from?Sierra. Name MoPaQ comes from the author of the format, Mike O'Brien (Mike O'brien PaCK).
?
Previous versions of archives
Before the game of Diablo was released, Blizzard used WAR format (Warcraft ARchive) for their stuff. This format was used with the game of Warcraft II (maybe also Warcraft I). This format was very simple, and average hacker was able to hack it in quite short time. Although it was not so great problem in Warcraft II, the newly coming game of Diablo needed to use a better archive format.
Requirements
A few main requirements were given onto newly developed format:
- Security.?Blizzard didn't want people to access their files and thus hack their games. Archive format has to support data encryption.
- Fast access.?It was necessary to access archived data as fast as possible, in realtime.
- Compression.?Blizzard decided to store sound files, including music, in the WAV format. Uncompressed size of these files is very large and archive must support their compression. For compdession and decompression, they decided to use PKWARE Data Compression Library, zlib and BZip2, together with special compression method used for storing WAV files, probably developed by Blizzard itself.
- Expandability.?Archive format must support later changes of the way how the files are stored in the archive. With new games released, the MPQ format is being extended. All the later changes are backward-compatible with older versions.
- Multilanguage.?Blizzard planned to release its games worldwide, in various language versions. The archive format must support storing multiple files with different languages.
MPQ archives can be stored also as part of EXE or other files. For example game patches are self-extracting MPQ archives.
MPQ patches
For the possibility of patching existing games, Blizzard does not change existing MPQ archives (which are on CD in some games). Instead of this, patching app creates a file Patch_rt.mpq (War3patch.mpq). When opening archive, the game first tries to open a file from the patch archive (Patch_rt.mpq). When it fails, the game looks for data in the original archive. With the Warcraft III game is also possible to make the game use, locally stored (unarchived) files when you change this setting in the registry:
REGEDIT4[HKEY_CURRENT_USER/Software/Blizzard Entertainment/Warcraft III] "Allow Local Files"=dword:00000001 注意一下以上這段加粗的話,wow的mpq就是這么運作的。上文的出處http://www.zezula.net/,該站點值得一看http://shadowflare.samods.org/inside_mopaq/ 這是一個相對比較全面講解mpq文件的站點,但部分不全,主體部分中對幾個重要函數的注釋已經過時了,例如SFileOpenArchive函數 優先值和flag字段沒有講,看最后索引部分的內容比較新。
資料就寫那么多,能找到的基本上都在這了,剩下的可以去玻璃渣內部偷- -!
總結
以上是生活随笔為你收集整理的魔兽世界 MPQ(MoPaQ) 文件相关资料的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: GPU与GPGPU
- 下一篇: mysql连接与嵌套查询_数据库之嵌套查