Skip to main content

Module streaming

Module streaming 

Source
Expand description

Terrain streaming — async chunk loading/unloading, LRU cache, priority queue.

Uses thread pools (std threads + channels) rather than async/await. Manages chunk lifecycle: generation → cache → serialization → eviction.

Structs§

ChunkCache
LRU cache for terrain chunks.
ChunkDiff
Records the difference between two chunk heightmaps (for terrain editing).
ChunkEventQueue
Simple event queue for chunk events.
ChunkGenerator
Generates terrain chunks from scratch for a given coord.
ChunkHitlist
A list of chunks that must be loaded before play can begin.
ChunkRepair
Repairs corrupted or invalid chunk data.
ChunkSerializer
Serializes/deserializes chunks to/from a binary format.
ChunkStitcher
Stitches chunk borders to eliminate seams between adjacent chunks.
ExtendedChunkSerializer
Extended chunk serializer with format support.
GeneratorPool
A fixed-size thread pool for chunk generation.
HeightmapQuantizer
Quantizes a heightmap for compact storage.
LoadQueue
Priority queue for chunks to be loaded.
LodBias
Adjusts LOD thresholds based on terrain importance (e.g., near a city).
LodScheduler
Decides when to upgrade/downgrade chunk LOD.
MemoryBudget
Tracks and enforces memory budget for the streaming system.
Prefetcher
Predicts movement direction and prefetches chunks ahead of the camera.
PriorityZone
Defines priority zones that affect chunk loading order. E.g., player start location, POIs, scripted events.
PriorityZoneManager
Manages multiple priority zones and computes combined priority bonuses.
StreamingManager
Top-level coordinator for terrain chunk streaming.
StreamingProfiler
Profiling data for the streaming system.
StreamingStats
Statistics for the streaming system.
StreamingTelemetry
Detailed telemetry for streaming system performance analysis.
TerrainPatch
A small editable terrain patch (sub-chunk resolution editing).
VisibilitySet
Tracks which chunk coords are currently in the view frustum.
WorldMap
Low-resolution overview map of the entire world, used for minimap and LOD hints.

Enums§

ChunkEvent
Events emitted by the streaming system.
SerializationFormat
Serialization format options.
StitchEdge
Which edge of a chunk to stitch.