Chapter One: The Architecture of Starcraft Data MPQ Archives Most of Starcraft's external data files are stored in what people commonly reference as MPQ archives, or (usually) files with the *.mpq extension. In your Starcraft directory, you should find two of these files if you own retail SC, Stardat.mpq and patch_rt.mpq, and one additional one, Broodat.mpq, if you own Broodwar. In addition to these three, the Install.exe on your Starcraft and Broodwar CDs also has an embedded MPQ Archive structure in it. SCM and SCX files (starcraft/broodwar maps) are also MPQ Archives. An MPQ archive is just that, a file archive. Similar to a ZIP file, MPQs store many smaller files in a compressed state (as to not take up too much room on your hard drive). In addition, like ZIP archives, MPQ files can have nested directory structures for the files inside, mainly for organizational purposes (e.g., all the sounds are in a sound/ subdirectory, all the portraits are in a portrait/ directory, etc.). When you run Starcraft, it extracts and uncompacts the internal files from the MPQs (into memory), though obviously not all at once (there's an awfully lot of megabytes in all those files, especially Install.exe :). To view and extract MPQ files on your own, you should use one of the many MPQ Viewers available, such as MPQ View (See /starcraft/programs/ for an up-to-date download link). Most older MPQ Viewers require that you have a copy of the storm.dll file installed with them (it can be found in your SC directory) and a data file. Basically, a data file is a list of the names of the known files in the MPQ; this is required because in order for most MPQ Viewers to find a file in the archive, it first has to know the name of the file (and the internal path in which it is stored, e.g., sound/protoss/trilobyte/tripss00.wav). If you are having difficulty finding a file that should be a certain MPQ, there is a good possibility that its name is simply not on your data file list. You can either add it manually (the data file is usually just a text file) or download a more recent copy (See /starcraft/programs/ for an up-to-date download link). Some newer MPQ Viewers do not have this constraint. As you probably already have guessed, Stardat.mpq stores all of the files from the original Starcraft game, Broodat.mpq stores all the additional and changed files in the Broodwar Expansion, and patch_rt.mpq stores the altered/additional files that Blizzard implements when you use one of their "patches" (such as to version 1.07). Install.exe stores all the files that are to be installed into your drive (which thus includes Stardat and Broodat) in addition to many files which are not installed but are required by the game in particular circumstances such as the maps, movies, and sounds for the single player campaign. It is safe to assume that almost all the files in Stardat, Broodat, and patch_rt are loaded by Starcraft when you start it up. (This is not true for all the files in Install.exe, or SCM/SCX files) However, when you look inside the MPQs, you might notice that there are many duplicate files. For example, units.dat is in both Broodat and Stardat, and iscript.bin is in all three. This makes sense because in installing Broodwar, the game had to add information for the new units (and, as you will find/have found out, the iscript.bin controls the animation data of graphic sprites, and had to be updated by a Blizzard patch to correct malfunctions in the low resolution disruption web animation, among other things). In loading files, Starcraft always opts to choose the copy from patch_rt first, then the copies in Broodat, and lastly the copies in Stardat. This means that SC will load any file in patch_rt and ignore files with the same name and path in the other two MPQs. In general, this is also true when the patch_rt contains files with identical names and paths to those in the Install.exe (though this is not always true, but for most useful applications such as patching over the game music and campaign sounds, this works). That, in a nutshell, is probably all you have to know about MPQ archives themselves. Of course, finding out about the files that are inside... well, that's another matter. Do some exploring when you have time and ask questions about files that you're not certain about; nearly all of them have mnemonic names and have been identified by others, if not fully cracked open already. :) |
Copyright (c) 1999-2000 Jeffrey Pang.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the
Free Software Foundation with no Invariant Sections, with no
Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
[an error occurred while processing this directive]