Skip to content

CAS compression blocks

Frostbite (skate.)Archives and filesApplies toskate.

An asset’s CAS range is a sequence of eight-byte headers and exactly sized payloads. Concatenating the decoded blocks reconstructs the asset. Physical range length includes the headers; decoded length does not. Observed

CAS block header8 bytes88% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x01u8dictionary metadataUnknownZero in all 1,001,300 headers of the indexed ranges.
0x13u24bedecoded lengthObserved
0x41u8codec and reserved bitObservedLow seven bits select the codec; high bit is reserved.
0x51u8flags and payload length high bitsObservedLow nibble is length bits 16–19; the upper nibble is 7 in every stock block.
0x62u16bepayload length low bitsObserved
Codec Payload Confidence
0 Stored bytes, equal in length to the decoded block Sourced · ReSkate
2 zlib Sourced · ReSkate
0x11, 0x15, 0x19 Oodle-compressed bytes Sourced · ReSkate

Studio output uses Oodle CAS blocks. A block’s codec is independent of its asset’s resource type. Observed

Each of the 208 sampled 0x11 blocks holds one Oodle block that begins 8C 06 (Kraken, restart bit set), and walking its block and quantum headers ends exactly at the block’s last payload byte. Observed · 208 sampled blocks

The stock game Data has 23 TOCs over 72 CAS files. Following exactly the chunk and bundle-asset ranges the TOCs index, its CAS files hold 999,764 distinct physical blocks: 153,945 with codec 0 and 845,819 with codec 0x11. No indexed block uses 2, 0x15, 0x19 or any other codec. Proven · every block the TOCs index; headers read, a sample decoded No 0x11 block’s payload is the same length as its decoded block, so the stock data shows no compressed block that falls back to stored bytes at equal size. Observed That some blocks are stored with codec 0 does not show when the producer chooses to store. Inferred

The bundle manifests that live in CAS files (6,056 of them) are stored raw, without block headers; reading them as CAS frames misreads them. Observed Gaps and padding between indexed ranges are not blocks. 30,293,670 bytes of the CAS files lie outside every indexed asset and manifest range, so the codec census does not cover them. Observed

Every header of every indexed range reads with byte 0 equal to zero, the top bit of byte 4 clear and the upper nibble of byte 5 equal to 7 (1,001,300 headers over 723,698 ranges, 999,764 distinct blocks). The payload-length bits 16 to 19 are nonzero in 82,951 blocks, all of them stored (codec 0) 64 KiB blocks whose payload is 65,536 bytes; every other block has a payload below 65,536. Every block that does not end its range decodes to exactly 65,536 bytes, and every range chains from its first header to its last byte with no remainder. Proven · all indexed ranges of the stock install The upper nibble of byte 5 is 7 in the 1,535,187 blocks of the files that the 82 mod folders installed beside the game list in their bundles as well, among them maps compiled by ReSkate Studio. Observed · every listed file of those 82 folders No stock region names a Patch folder, so no delta file occurs among the ranges. Proven · the stock install

The files that the TOCs of 82 installed mod folders reach (213 TOCs, 9,562,590 distinct file ranges, the stock files they reference included) hold 10,508,160 block headers. Every one has byte 0 equal to zero, the top bit of byte 4 clear and the upper nibble of byte 5 equal to 7; the codec is 0 in 2,206,387 blocks and 0x11 in 8,301,773, and no other. No block header is eight zero bytes, and every range chains from its first header to its last byte. Observed · every file range the 213 TOCs of those 82 folders list So no codec 0x09, 0x0F (or dictionary byte) and no empty eight-byte block occurs in the stock data or in the mods read beside it.

Which dictionary and flag variants does the engine accept?

No stock block uses a nonzero dictionary byte or a flags nibble other than 7, so the stock data does not show what either would mean. The measured framing does not establish support for every Frostbite CAS codec. Unknown