Give Page Feedback | API

Chunk Managers - Pooling Manager

The Pooling Chunk Manager serves two purposes:

1) It provides a default, rudimentary pooling version of the Chunk Manager that you can use directly.

2) It provides a framework for implementing more advanced custom Pooling Chunk Managers.

This chapter covers option 1; using the Pooling Chunk Manager directly as a rudimentary pooling based chunk manager; if you want to understand how to create a custom manager deriving from this Pooling Chunk Manager, take a look at the Custom Pooling Managers Section instead.

Creating A Pooling Chunk Manager Component

You can add this component by selecting a game object and then selecting from the Top Menu Bar:

Component -> Deep Space Labs -> -> SAM -> Chunk Managers -> Pooling Chunk Manager

Adding A Pooling Chunk Manager Component From The Top Menu Bar GIF

or by selecting a game object and using the Add Component menu via its inspector:

Component -> Deep Space Labs -> -> SAM -> Chunk Managers -> Pooling Chunk Manager

Adding A Pooling Chunk Manager Component From Add Component Menu GIF

How It Works

The Pooling Chunk Manager pools Asset Chunk Sets based on the Streamable Grid Cell those Chunks are associated with. That is to say, for each LOD Group user, there is a separate pool for each Streamable Grid Cell associated with the users Streamable Grid.

The result is that even World Cells with different Endless Grid Cell indexes can pool and share Asset Chunk Sets, so long as they have the same Streamable Grid Cell indexes.

The maximum number of unique Chunk Sets allowed in each of these pools is set in the inspector (via the Max Chunk Sets To Pool Per Cell setting), which you can use to limit the amount of memory the Manager uses. Once this limit is reached for a Streamable Grid Cell, any World Cells using that Streamable Grid Cell that no longer need Asset Chunks will have their Chunks passed to the Chunk Streamer for removal/unloading (rather than being pooled).

When a request is made to retrieve Asset Chunks for a World Cell, the Pooling Chunk Manager searches the LOD Group users pool using the Streamable Grid Cell as a key, and if it finds Asset Chunks in that pool, it attaches them to the World Cell.

Any World Cells that it cannot find Asset Chunks for are passed to the Chunk Streamer so that it can stream in new Asset Chunks.

Unfortunately, at this time the pooling logic does not take into account the assigned Chunk Reuse Judge; if you wish to use the Chunk Reuse Judge in the pooling logic, you will need to create a completely custom Chunk Manager by deriving from the ChunkManager class.