MPQ
From Source Peek Wiki
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).
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.
Format of files stored in MPQs
- Images used in games from the Blizzard are either in the PCX format (startup screens, large areas like Diablo II Inventory). These images can be viewed with any image viewer (IrfanView, ACDSee32) or editor (Painbrush, Microsoft Proto Editor, ...). Spell icons, character images and other little images are stored in internal Blizzard formats, like CEL, CL2, GRP, DC6. A guy named himself TeLAMoN deals with these file formats and also has published some descriptions. He also wrote a tool which allows to view these images.
- Music, speach sequences and sounds are in all currently released games in the WAVE or MP3 (Since Warcraft III) format. This can be played in every sound player, e.g. Winamp. It is no problem to extract the sound file(s) and use them.
- Movies (incl. StarCraft animated portraits) are stored in the format of Smacker Video or Bink Video. Standard movie player cannot play this format (yet). For playing them, you have to install the software from Rad Game Tools, which is available at their web pages. Beginning with Warcraft III, Blizzard decided to buy a licence for the DivX encoder and release their game videon in the DivX format. For playing these videos, you have to install the DivX codec.
- Textures for 3D games (Warcraft III and newer) are stored in BLP format.
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
Original source: Zezula.net
More information available here
