Documentation: StreamingKeepAliveComponent
Name | Type | Initial Value | Example Range | Description |
---|---|---|---|---|
Members | ||||
TEMP_TEMPY | float | 0 | [0, 3.5] | |
TEMP_TEMP_TEMP | float | 0 | [0, 3.5] |
Behaviour
StreamingKeepAliveComponent can load in new chunks and keep loaded in chunks loaded.
It loads all chunks that are in the entity's first HitboxComponent. If it doesn't have one then it just loads the chunk that the entity is currently in (as-if it has a 0x0 HitboxComponent).
To keep loaded chunks loaded, it uses the previous region with 256 pixels added to the left, right, top, and bottom.
Both of these region checks are inclusive, which means they are effectively extended by 1 pixel to the bottom and right.
The table below demonstrates a couple different setups that are possible. The blue cross is the entity with a StreamingKeepAliveComponent and possibly a Hitbox, and the red squares are chunks.
Issues
The game tries to keep at most STREAMING_CHUNK_TARGET
chunks loaded at any time, by default this is set to 12.
It's very easy to go over this limit if you use this component a couple times in a mod.
When you are over this limit, the game constantly logs "Warning - streaming didn't find any chunks it could stream away..." and "Too many chunks!".
This hurts performance and can lead to huge log files.