Give Page Feedback | API

Upgrading - Custom Cell Object Loaders

The CellObjectLoader base abstract class has been renamed to ChunkStreamer. Any custom Cell Object Loaders you have created will need to be recreated using ChunkStreamer as the class they derive from. You can find this class within the DeepSpaceLabs.SAM namespace.

IsSingleFrameAttachmentPreloadRequired (Retained Property)

This property has been retained, so you can simply copy over your overrided implementation to the new class deriving from ChunkStreamer.

CreateNewUser (Retained Method)

This method is still present, however its return type and parameter have been adjusted.

The new return type is ChunkStreamerUser while the parameter is now called LODGroup and has a type of ILODGroup.

PerformSingleFrameAttachmentPreload (Retained Method)

This method has been retained, however it no longer uses generics. Instead, the input cells list is of type WorldCell. In addition, the loaderID parameter has been renamed to userID.

AttachCellObjectsToCellsInSingleFrame -> LoadAndAttachChunksToCellsInSingleFrame

This method has been renamed slightly and no longer uses generics. Instead, the input cells list is of type WorldCell. In addition, the loaderID parameter has been renamed to userID.

LoadAndAttachCellObjectsToCells -> LoadAndAttachChunksToCells

This method has been renamed slightly and no longer uses generics. Instead, the input cells list is of type WorldCell. In addition, the loaderID parameter has been renamed to userID.

DetachAndUnloadChunksFromCells (New Method)

Because the responsibility of removing/unloading cell objects/chunks from the scene has been moved from the Chunk Manager to the Chunk Streamer, this is a new method that you need to provide an implementation for. With it, any Asset Chunks attached to the input cells should be detached from the cells and unloaded/removed from the scene.

Like the other methods, this method contains a cells and userID parameter.

--Special Note--
This method's return type is IEnumerator. This return type is special as it allows the method to be iterated over, possibly over multiple frames. This allows the execution's performance impact to be spread out over multiple frames, which is awesome! There are two strategies for implementing methods with this return type:

1) Simply include yield return statements within the method's body where the returned object is either null or an instance of a YieldInstruction.

The compiler will auto generate a state machine class, which will be used to iterate the method's logic. The drawback of this technique is every time the method is called, a new instance of the auto generated class is created, resulting in garbage generation throughout the lifetime of the game.

2) Implement one of the reusable enumerator classes found within the API.

This strategy is harder to implement as you will need to implement the state machine logic yourself, as well as perform some other code related task necessary to use the reusable enumerators. It is recommended for experienced coders only!

If you elect to go with option 2, you can find detailed information on how to use the Reusable Enumerator classes in the Yield Enumerator Section within the Secondary Non Components Chapter.

Yield Enumerator Classes

Additional Information

There are some additional properties/concepts regarding Custom Chunk Streamers that will not be covered here. If you wish to learn more about these properties/concepts or need assistance with your Custom Chunk Streamer class, please take a look at the Custom Streamers Section within the Chunk Streamers Chapter.

Custom Chunk Streamers