Bundle (original): Difference between revisions

Added overview section and moved enumerations to subpage, along with other miscellaneous changes and fixes.
m (Link to the resource types page.)
(Added overview section and moved enumerations to subpage, along with other miscellaneous changes and fixes.)
Line 1:
{{subpage|Enumerations|text=Enumerations used in the Bundle container.}}
 
The Bundle container is the core file format of Criterion's 7th-gen titles with the exception of Burnout Revenge (X360). Each Bundle holds one or more resources (assets) and contains information about each resource, such as its size, [[Resource Types (Burnout Paradise)|type]], compression, alignment, and so on.
 
The Bundle format has two major versions: the original, using the <code>bndl</code> magic, and Bundle 2, using the <code>bnd2</code> magic. The first Bundle format underwent at least five iterations during its use from early 2006 to early-mid 2007, but it was never used in a retail game and can only be found in development builds of games such as Burnout Paradise. It was succeeded by Bundle 2, which ultimately saw use in the retail versions of Burnout Paradise (version 2), Need for Speed Hot Pursuit (version 3), and Need for Speed Most Wanted (version 5).
 
At present, only files using Bundle version 3, 4, and 5 have been discovered. Those versions, plus Bundle 2 version 2, are described below. For information on later versions, see the [https://needforspeed.miraheze.org/wiki/Bundle Need for Speed Wiki].
 
= Overview =
Bundles are used for nearly every asset in Burnout Paradise, with the only exceptions being the <code>JUNKYARDLIGHTING.DAT</code> text file and <code>STARDATA.DAT</code> binary file (both in the <code>ENVIRONMENTSETTINGS</code> folder), the non-RAM portion of sound assets, and video files. This makes it one of the most important formats to understand when attempting to parse assets.
 
While the header contains some valuable data, such as the flags and chunk offsets, the majority of relevant information is in resource entries, which store the ID, uncompressed and compressed size, alignment, relative offset, and type of each resource in each chunk. These also store the import offsets, which enable importing specific data from other resources.
 
Bundle debug data is also important to understand. Sometimes called Bundle imports, this was originally only available in development builds but, with the release of Remastered, shipped with every Bundle in the game. Consisting of XML data headed by the <code>ResourceStringTable</code> element, it contains the ID, name, and type name of every resource in a respective bundle. This means that effectively every resource in the game has a decodable name. Despite this, however, the resource names given by the debug data sometimes do not match when encoded. In some cases, such as with Registry resources, this means the name is hardcoded.
 
= Layout =
Line 49 ⟶ 58:
| 0x54 || 0x4 || uint32_t || muResourceDataOffset || Resource data offset ||
|-
| 0x58 || 0x4 || uint32_t || muPlatform || Platform the bundle was built for || 1See = PC<br>2 = X360<br>3 = PS3[[Bundle/Enumerations#Platform|Platform]]
|}
 
Line 57 ⟶ 66:
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
| 0x5C || 0x4 || uint32_t || muFlags || Bundle flags || 1See = IsCompressed[[Bundle/Enumerations#Flags|Flags]]
|-
| 0x60 || 0x4 || uint32_t || || Number of compressed resources ||
Line 124 ⟶ 133:
 
==== SizeAndAlignment ====
The official name of this structure is unknown. The name shown is meant to reflect its purpose.
{| class="wikitable"
|-
Line 143 ⟶ 153:
| 0x4 || 0x4 || uint32_t || muVersion || Bundle version ||
|-
| 0x8 || 0x4 || uint32_t || muPlatform || Platform the bundle was built for || 1See = PC[[Bundle/PS4<br>2 = X360<br>3 = PS3Enumerations#Platform|Platform]]
|-
| 0xC || 0x4 || uint32_t || muDebugDataOffset || Bundle debug data offset || ResourceStringTable XML
Line 151 ⟶ 161:
| 0x14 || 0x4 || uint32_t || muResourceEntriesOffset || Resource entries offset ||
|-
| 0x18 || 0x40xC || uint32_t[3] || muResourceDataOffsetmauResourceDataOffset || Resource data offset ||
|-
| 0x24 || 0x4 || uint32_t || muFlags || Bundle flags || 1See = IsCompressed<br>2 = IsMainMenOptimised<br>4 = IsGraphicsMemOptimised<br>8 = ContainsDebugData[[Bundle/Enumerations#Flags|Flags]]
|}
 
Line 170 ⟶ 180:
| 0x1C || 0xC || uint32_t[3] || mauSizeAndAlignmentOnDisk || Resource sizes (compressed) for each chunk || See above
|-
| 0x28 || 0xC || uint32_t[3] || mauDiskOffset || Resource offsets for each chunk || Relative to the start of the respective chunk
|-
| 0x34 || 0x4 || uint32_t || muImportOffset || Bundle imports offset ||