Skip to main content

Chunk

A persisted chunk of an app's voxel world. Holds an optional packed voxel-type grid for 16x16x16 chunks (voxels, one byte per voxel), sparse per-voxel state overrides and recorded edits (voxelStates; voxel positions and types are app-defined signed 16-bit values, so an app may address its chunks however it likes), an optional opaque chunk-level state blob (chunkState), and level-of-detail meshes (lods). Returned by getChunk/getChunksByDistance and written by updateChunk/updateChunkState/updateChunkLods.

type Chunk {
chunkId: ID!
appId: ID!
coordinates: ChunkCoordinates!
voxels: String
voxelStates: [VoxelState!]!
voxelStatesTruncated: Boolean!
owner: ID
createdAt: DateTime!
updatedAt: DateTime!
chunkState: String
cdnUploadedAt: DateTime
lods: [LodData!]
}

Fields​

Chunk.chunkId ● ID! non-null scalar​

Server-assigned unique chunk id (decimal string).

Chunk.appId ● ID! non-null scalar​

Id of the app that owns this chunk (decimal string).

Chunk.coordinates ● ChunkCoordinates! non-null object​

This chunk's address in the app's world grid.

Chunk.voxels ● String scalar​

BASE64-encoded binary blob of the dense voxel-type grid. When present, the DECODED buffer is exactly 4096 bytes: one unsigned byte (voxel type 0-255) per voxel, indexed as x + y*16 + z*256 with x,y,z in 0-15. Null when the chunk has no voxel grid yet. Decode from base64 before reading.

Chunk.voxelStates ● [VoxelState!]! non-null object​

Sparse list of per-voxel overrides: the states stored with the chunk (e.g. rotation, atlas, flags) and every voxel edit recorded for it since (the voxel_updates log), each with its voxel type, which takes precedence over the type byte in voxels. Positions and types are app-defined signed 16-bit values; an entry outside the 16x16x16 grid or the 0-255 type range lives only here. Empty when the chunk has neither.

Chunk.voxelStatesTruncated ● Boolean! non-null scalar​

True when the chunk holds more recorded edits than one read applies (65,536 for getChunk; 262,144 across one getChunksByDistance call), so voxelStates stops short of the newest. Read the whole log with listVoxels, which pages.

Chunk.owner ● ID scalar​

User id (decimal string) of the last writer of this chunk, or null if unknown.

Chunk.createdAt ● DateTime! non-null scalar​

Timestamp when this chunk row was first created.

Chunk.updatedAt ● DateTime! non-null scalar​

Timestamp of the most recent write to this chunk.

Chunk.chunkState ● String scalar​

BASE64-encoded opaque binary blob holding chunk-LEVEL state (distinct from per-voxel state). Decode from base64; null when unset. Written only via updateChunkState and preserved by updateChunk/updateChunkLods.

Chunk.cdnUploadedAt ● DateTime scalar​

Timestamp the chunk's binary (d2.bin) was last synced to the CDN/S3, or null if it has never been uploaded.

Chunk.lods ● [LodData!] list object​

Level-of-detail (LOD) entries for this chunk (coarser sampled representations), or null if none. Each entry is keyed by integer level (0 = finest) and carries a base64-encoded binary blob.

Returned By​

getChunk query ● updateChunk mutation ● updateChunkLods mutation ● updateChunkState mutation

Member Of​

ChunksByDistanceResponse object