Skip to main content

Overview

The ChunkAssetEntry class represents chunk assets in the Frostbite engine. Chunks are binary data blocks used for large resources like texture mipmaps, mesh LODs, and streaming data.

Class Definition

Location: FrostySdk/Managers/AssetManager.cs:394

Properties

Guid
Unique identifier for the chunk. Used as the chunk’s name.
uint
Size of the chunk data when stored in a bundle (may differ from actual size).
uint
Logical offset within the parent resource (for texture mips or mesh sections).
uint
Logical size of the chunk data after decompression.
uint
Start offset in the range of data covered by this chunk.
uint
End offset in the range of data covered by this chunk.
int
32-bit hash of the parent resource name (FNV-1 hash). Links chunk to its owner.
int
For texture chunks, indicates the first mipmap level. -1 if not applicable.
bool
True if this chunk is stored in a Table of Contents chunk bundle.
bool
Internal flag for special TOC chunk handling.
string
Returns the chunk GUID as a string (since chunks are identified by GUID).
string
Always returns "Chunk".
string
Returns "chunk" to identify this as a chunk asset entry.

Inherited Properties

See EbxAssetEntry for complete list of base properties including:
  • Sha1, Size, OriginalSize
  • IsModified, IsDirty, IsAdded
  • Bundles, LinkedAssets
  • Location, IsInline

Methods

AddToBundle (Override)

Adds the chunk to a bundle. Overridden to prevent adding orphaned chunks.
int
required
Bundle index to add the chunk to
bool
True if successfully added. Returns false if chunk has no bundles and is not a new chunk.
Chunks cannot be added to bundles unless they already belong to at least one bundle or were explicitly created via AddChunk().

Inherited Methods

Chunk entries inherit methods from AssetEntry:
  • AddToBundles(IEnumerable<int>) - Add to multiple bundles
  • IsInBundle(int bid) - Check bundle membership
  • EnumerateBundles(bool addedOnly) - Iterate bundles
  • LinkAsset(AssetEntry) - Link to parent assets
See EbxAssetEntry for detailed method documentation.

Usage Examples

Reading a Chunk

Loading Chunk Data

Modifying a Chunk

Creating a New Chunk

Creating a Texture Chunk

Linking Chunks to Resources

Finding Parent Resource

Enumerating Texture Mipmaps

Working with Modified Chunks

Checking Chunk Bundle Membership

Chunk Compression

Chunks are compressed based on the game profile:

Modified Chunk Entry

When a chunk is modified, additional data is stored:

Special Chunk Types

TOC Chunks

Table of Contents chunks store chunk bundles:

Texture Chunks

Texture mipmaps are stored as chunks:

Mesh Chunks

Mesh sections may be stored as chunks for streaming: