Bundle (original): Difference between revisions

Content added Content deleted
(Added overview section and moved enumerations to subpage, along with other miscellaneous changes and fixes.)
(Updated layout and some wording in the page to make it more accurate and understandable.)
Line 12: Line 12:
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.
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.
Bundle debug data is also important to understand. Sometimes called Bundle imports, this was originally only available in development builds but shipped with every Bundle in the game in Remastered. 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 name in the game is known. Despite this, the resource names given by the debug data sometimes do not match the hash when encoded. In some cases, such as with Registry resources, this means the name is hardcoded.


= Layout =
= Memory types =
== Memory types ==
Across all Bundle versions, a common theme is the use of separate data chunks to define what memory type resources are loaded into. These chunks are as follows:
Across all Bundle versions, a common theme is the use of separate data chunks to define what memory type resources are loaded into. These chunks are as follows:


Line 32: Line 31:
Keep these in mind when viewing the specs below.
Keep these in mind when viewing the specs below.


== Bundle ==
= Bundle Layout =
The original Bundle format's versions were treated more like additions to the previous version. Thus, rather than a full structure for each, only their additions are described here.
The original Bundle format's versions were treated more like additions to the previous version. Thus, rather than a full structure for each, only their additions are described here.


=== Version 3 ===
== Version 3 ==
=== Bundle ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 46: Line 46:
| 0x8 || 0x4 || uint32_t || muResourceEntriesCount || Number of resources in the bundle ||
| 0x8 || 0x4 || uint32_t || muResourceEntriesCount || Number of resources in the bundle ||
|-
|-
| 0xC || 0x28 || SizeAndAlignment[5] || || Size and alignment of each chunk ||
| 0xC || 0x28 || Unknown0[5] || || Size and alignment of each chunk ||
|-
|-
| 0x34 || 0x14 || uint32_t[5] || || Memory address of each chunk ||
| 0x34 || 0x14 || uint32_t[5] || || Memory address of each chunk ||
Line 61: Line 61:
|}
|}


=== Version 4 Additions ===
=== ResourceEntry ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Size !! Type !! Name !! Description !! Comments
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
|-
| 0x5C || 0x4 || uint32_t || muFlags || Bundle flags || See [[Bundle/Enumerations#Flags|Flags]]
| 0x0 || 0x4 || uint32_t || || Resource data memory address ||
|-
|-
| 0x60 || 0x4 || uint32_t || || Number of compressed resources ||
| 0x4 || 0x4 || uint32_t || muImportOffset || Bundle imports offset ||
|-
|-
| 0x64 || 0x4 || uint32_t || || Compression information offset ||
| 0x8 || 0x4 || uint32_t || muResourceTypeId || Resource type || See [[Resource Types (Burnout Paradise)|Resource Types]]
|-
| 0xC || 0x28 || Unknown0[5] || mauSizeAndAlignmentOnDisk || ||
|-
| 0x34 || 0x28 || Unknown0[5] || mauDiskOffset || Offsets in bundle || Alignment is unused (always 1)
|-
| 0x5C || 0x14 || uint32_t[5] || || Memory addresses || Swapped endian
|}
|}


=== Version 5 Additions ===
=== Imports ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Size !! Type !! Name !! Description !! Comments
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
|-
| 0x68 || 0x4 || uint32_t || || || No idea what this does
| 0x0 || 0x4 || uint32_t || muImportCount || Number of imports ||
|-
|-
| 0x6C || 0x4 || uint32_t || || || Also no idea what this does
| 0x8 || || || || Import entries || Aligned 8. See [[#ImportEntry|ImportEntry]] structure
|}
|}


=== Substructures ===
=== ImportEntry ===
==== ResourceEntry ====
{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Size !! Type !! Name !! Description !! Comments
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
|-
| 0x0 || 0x4 || uint32_t || || Resource data memory address ||
| 0x0 || 0x8 || ID || mResourceId || Resource name CRC32 ||
|-
|-
| 0x4 || 0x4 || uint32_t || muImportOffset || Bundle imports offset ||
| 0x8 || 0x4 || uint32_t || muOffset || ||
|-
|-
| 0x8 || 0x4 || uint32_t || muResourceTypeId || Resource type || See [[Resource Types (Burnout Paradise)|Resource Types]]
| 0xC || 0x4 || || || padding ||
|-
| 0xC || 0x28 || SizeAndAlignment[5] || mauSizeAndAlignmentOnDisk || ||
|-
| 0x34 || 0x28 || SizeAndAlignment[5] || mauDiskOffset || Offsets in bundle || Alignment is unused (always 1)
|-
| 0x5C || 0x14 || uint32_t[5] || || Memory addresses || Swapped endian
|}
|}


==== Imports ====
=== Unknown0 ===
This structure contains fields for size and alignment, though alignment sometimes goes unused.
{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Size !! Type !! Name !! Description !! Comments
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
|-
| 0x0 || 0x4 || uint32_t || muImportCount || Number of imports ||
| 0x0 || 0x4 || uint32_t || || Size or offset ||
|-
|-
| 0x8 || || || || Import entries || Aligned 8. See ImportEntry structure
| 0x4 || 0x4 || uint32_t || || Alignment ||
|}
|}


==== ImportEntry ====
== Version 4 Additions ==
=== Bundle ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Size !! Type !! Name !! Description !! Comments
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
|-
| 0x0 || 0x8 || ID || mResourceId || Resource name CRC32 ||
| 0x5C || 0x4 || uint32_t || muFlags || Bundle flags || See [[Bundle/Enumerations#Flags|Flags]]
|-
|-
| 0x8 || 0x4 || uint32_t || muOffset || ||
| 0x60 || 0x4 || uint32_t || || Number of compressed resources ||
|-
|-
| 0xC || 0x4 || || || padding ||
| 0x64 || 0x4 || uint32_t || || Compression information offset ||
|}
|}


==== Compression Information ====
=== Compression Information ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Size !! Type !! Name !! Description !! Comments
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
|-
| 0x0 || 0x28 || SizeAndAlignment[5] || mauUncompressedSizeAndAlignment || ||
| 0x0 || 0x28 || Unknown0[5] || mauUncompressedSizeAndAlignment || ||
|}
|}


==== SizeAndAlignment ====
== Version 5 Additions ==
=== Bundle ===
The official name of this structure is unknown. The name shown is meant to reflect its purpose.
{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Size !! Type !! Name !! Description !! Comments
! Offset !! Size !! Type !! Name !! Description !! Comments
|-
|-
| 0x0 || 0x4 || uint32_t || || Size or offset ||
| 0x68 || 0x4 || uint32_t || || || No idea what this does
|-
|-
| 0x4 || 0x4 || uint32_t || || Alignment ||
| 0x6C || 0x4 || uint32_t || || || Also no idea what this does
|}
|}


== Bundle 2 ==
= Bundle 2 Layout =
=== Version 2 ===
=== BundleV2 ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 166: Line 167:
|}
|}


=== Substructures ===
=== ResourceEntry ===
==== ResourceEntry ====
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 193: Line 193:
|}
|}


==== ImportEntry ====
=== ImportEntry ===
{| class="wikitable"
{| class="wikitable"
|-
|-