- Joined
- Feb 25, 2013
- Messages
- 322
How to extract game files
Introduction
Extracting game files is not something everyone will need, but those who would can need them for many things: you may need to get some data from the game SLKs, get a function's definition from the blizzard's code files, get a file to modify and use in your map or with local files.
This tutorial will have instructions for both MPQ (Warcraft 3 patches before 1.30 and from maps) and CASC (Warcraft 3 patches 1.30+), and will outline which MPQs and CASC roots contain which files.
This tutorial will have instructions for both MPQ (Warcraft 3 patches before 1.30 and from maps) and CASC (Warcraft 3 patches 1.30+), and will outline which MPQs and CASC roots contain which files.
What are MPQs?
MPQ is an archive format made by Blizzard, similar in some aspects to a ZIP file. They are used both to store map files (w3m and w3x files are MPQs, sometimes with an extra header), custom campaign files (w3n files are also MPQs), and game files until 1.29.2. More technical information can be found here.
MPQ files' contents
There were 4 main game MPQs: War3.mpq, War3Local.mpq, War3x.mpq, War3xLocal.mpq; note that these are not the only files the game would look in when loading a file.
War3.mpq contained all the game files that were not TFT-only and did not change based on the game's locallization (translation, for example sounds and text).
War3Local.mpq contained the localized files that were not TFT-only.
War3x.mpq contained all the game files that were TFT-only but did not change based on the game's locallization.
War3xLocal.mpq contained the localized files that were TFT-only.
There was also War3Patch.mpq that used to stored all files that were updated with patches, but it has been removed after 1.28.
Inside of the main MPQs, there were also MPQs for every tileset (called like A.mpq, with A being the tileset character specified in the w3i) and for low and medium graphics modes (war3_med.mpq and war3_low.mpq).
When loading a file from a system with MPQs, the data sources were considered as such (only specifying the main ones in this tutorial):
War3.mpq contained all the game files that were not TFT-only and did not change based on the game's locallization (translation, for example sounds and text).
War3Local.mpq contained the localized files that were not TFT-only.
War3x.mpq contained all the game files that were TFT-only but did not change based on the game's locallization.
War3xLocal.mpq contained the localized files that were TFT-only.
There was also War3Patch.mpq that used to stored all files that were updated with patches, but it has been removed after 1.28.
Inside of the main MPQs, there were also MPQs for every tileset (called like A.mpq, with A being the tileset character specified in the w3i) and for low and medium graphics modes (war3_med.mpq and war3_low.mpq).
When loading a file from a system with MPQs, the data sources were considered as such (only specifying the main ones in this tutorial):
Local files | if local files are enabled |
Map archive | |
Tileset MPQ | |
War3xLocal | if the map was loaded in TFT mode |
War3x | if the map was loaded in TFT mode |
War3Local | |
War3 |
How to extract from MPQs
There are many MPQ editors, but I personally recommend the one by Ladislav Zezula. It has the option to open one or multiple MPQs at once, automatically recognizes extensions of files not covered with a listfile (most files in Warcraft 3 patch MPQs), and can even make an MPQ from scratch or from a folder.
It will also give you the option to set it as the default handler for MPQs, so opening the game files becomes as simple as a double-click on the MPQ.
It will also give you the option to set it as the default handler for MPQs, so opening the game files becomes as simple as a double-click on the MPQ.
What is CASC?
CASC is a system of storing game files, serving as a replacement for game MPQs. More in-depth information can be found here.
CASC contents
CASC is a simpler system, being unified as opposed to the many MPQs of the old one.
war3.w3mod: the main root
_balance/*.w3mod: balance-related files, for any particular map the usage of these is dictated by "Game Data Set" and "Game Data Version"
_deprecated.w3mod: files that should no longer be used by anything but kept for backwards compatibility
_hd.w3mod: the root for HD files
_teen.w3mod: teen asset mode files
_tilesets/*.w3mod: tileset-dependent files
Maps can also have most of the subroots that war3.w3mod can have.
The hierarchy that will be outlined below is adjusted for latest version, but will be similar to the hierarchies of the older patches (not including locale and balance roots nor the teen [low violence mode] root, and the * in tileset names only means the active tileset, not every one of them):
How to extract from CASC_deprecated.w3mod: files that should no longer be used by anything but kept for backwards compatibility
_hd.w3mod: the root for HD files
_locales/*.w3mod: language-dependent file overrides for HD
_teen.w3mod: teen asset mode files for HD
_tilesets/*.w3mod: tileset-dependent files for HD
_locales/*.w3mod: language-dependent files_teen.w3mod: teen asset mode files for HD
_tilesets/*.w3mod: tileset-dependent files for HD
_teen.w3mod: teen asset mode files
_tilesets/*.w3mod: tileset-dependent files
Maps can also have most of the subroots that war3.w3mod can have.
The hierarchy that will be outlined below is adjusted for latest version, but will be similar to the hierarchies of the older patches (not including locale and balance roots nor the teen [low violence mode] root, and the * in tileset names only means the active tileset, not every one of them):
Local files | if local files are enabled |
Map archive:_hd.w3mod:_tilesets/*.w3mod | if HD mode is enabled |
Map archive:_hd.w3mod | if HD mode is enabled |
Map archive:_tilesets/*.w3mod | |
Map archive | |
war3.w3mod:_hd.w3mod:_tilesets/*.w3mod | if HD mode is enabled |
war3.w3mod:_hd.w3mod | if HD mode is enabled |
war3.w3mod:_tilesets/*.w3mod | |
war3.w3mod |
The only tool that can extract files from CASC is Ladislav Zezula's CascView. You will have to select either a game folder or game from a list. Getting the files from CASC is very similar to getting the files from MPQs from this point on.
In both MPQ can CASC, files have similar paths accounting for roots:
abilities | ability and weapon models |
buildings | building models |
campaign | campaign maps |
doodads | doodads models and data |
environment | miscellaneous models and foliage data |
fonts | fonts |
maps | all melee and custom maps included with the game, they were in the main Warcraft III folder(not in an mpq) in the MPQ system |
movies | all pre-rendered cutscenes |
objects | more miscellaneous models |
pathtextures | object pathing maps |
replaceabletextures | too many things to list in a table |
scripts | code files: ai, jass and preload |
shaders | 3d graphics' shaders |
sharedmodels | more miscellaneous models |
sound | audio files |
splats | splat data |
terrainart | terrain models and data |
textures | most of the game textures |
ui | ui data, models, and textrues |
units | unit models, and data for most objects |
webui | webui (pre-game UI for 1.32+) files |
Last edited: