CASC
CASC is the name of the new file system that Blizzard has created to replace the outdated format of MPQ.
CASC v1
The CASC file system made its first debut in the Heroes of the Storm Technical Alpha, which was hosted on Blizzard's servers in late January. The form of CASC that Heroes of the Storm uses is designated by Blizzard as "CASC". In contrast, World of Warcraft's "build-playbuild-installer" config line clearly states it is generated by "ngdptool_casc2" (NGDP stands for Next Generation Download Procotol). These are the two most substantial changes between CASC v1 and CASC v2:
- Sections of CASC v1 data files are grouped together in collections of files we call "packages". These packages all have the same root folder, and if all of the files are not properly added with the package's base directory, the extraction process will produce an incredibly mangled directory output.
- CASC v1's root file relates content hashes to file names. CASC v2's root file relates content hashes to name hashes. Translating name hashes to file names requires use of the Jenkins Hash function [1], which in turn requires a listfile to generate the hashes. Essentially CASC v1 has its own listfile (in root). CASC v2 does not, and requires the user to provide names.
The remainder of this article will refer exclusively to the system called CASC v2. While many parts of the file system are identical between v1 and v2, there are enough changes to make explaining both formats at once inadvisable.
NGDP
CASC was introduced simultaneously with a new system for managing configuration, blob, and installation files called NGDP, or Next Generation Download Protocol. When the acronym 'NGDP' is used in conjunction with the term CASC, it is typically referring to the hosted components of the CASC file system, and its ability to stream data on the fly.
NGDP URLs
As of October 14th, 2014, the following generic NGDP URLs are known:
- http://us.patch.battle.net:1119/ProgramCode/cdns - a list domains available with game data per region
- http://us.patch.battle.net:1119/ProgramCode/versions - a list of the current game version, build config, and cdn config per region
- http://us.patch.battle.net:1119/ProgramCode/bgdl - similar to versions, but tailored for use by the Battle.net App background downloader process
- http://us.patch.battle.net:1119/ProgramCode/blob/game - a blob file that regulates game functionality for the Battle.net App
- http://us.patch.battle.net:1119/ProgramCode/blob/install - a blob file that regulates installer functionality for the game in the Battle.net App
NGDP Program Codes
As of October 14th, 2014, the following program codes are known to support NGDP:
- heroes
- storm - Note: Deprecated
- wow
- wowt
- wow_beta
CASC Online
Standard URL Hash Format
URL Format: http://cdnsHost/cdnsPath/config/FirstTwoHexOfHash/SecondTwoHexOfHash/FullHash Example URL: http://dist.blizzard.com.edgesuite.net/tpr/wow/config/5b/27/5b277d732299a79a935bc5a3f6ed3240
Config Files
Build Config
Example file: http://dist.blizzard.com.edgesuite.net/tpr/wow/config/4d/8b/4d8bb3b6fd0416aa9371a80aaefd2e93
CDN Config
Example file: http://dist.blizzard.com.edgesuite.net/tpr/wow/config/5b/27/5b277d732299a79a935bc5a3f6ed3240
Patch Config
This configuration file was added after all of the others. It first appeared in CASC v1 for Heroes of the Storm in August 2014. It then appeared in WoW for CASC v2 around build 19000 (approximately October 1st, 2014). The purpose of this file is to reduce redundant downloads. It achieves this by directing the system to download patch files to apply and update previously downloaded material. The structure and purpose of all of the fields of this file are unknown at this time.
Data Files
Patch Files
File signature = "PA" The structure and purpose of all of the fields of this file are unknown at this time.
States of CASC Data
Blizzard-Created Archives
In its natural state, the vast majority of the data for any CASC-based game exists in the archives. These are compressed files roughly 256 MB in size, hosted on Blizzard's CDNs. They follow the standard URL hash format. The archives are defined in the
.INDEX Files
Archive-Group
Archive-group is actually a very special '.index' file. While virtually all '.index' files are under 2 MB, the archive-group '.index' file is always over 15 MB. It is essentially a merger of all .index files
Archives
Journal-based Data Files
During the installation process for a Blizzard game, the program will download the required files as requested by root, encoding, download, and install. It stores the downloaded data fragments in data files in "INSTALL_DIR\Data\data\". The program will record the content hash (BLTE-compressed hash), size, and position of the file as well as the number of the data file that it is in. It places those four parameters into journal files with the extension '.idx'.
.IDX Journals
Example file path: INSTALL_DIR\Data\data\0e00000054.idx
.XXX Data Files
Example file path: INSTALL_DIR\Data\data\data.015