Give Page Feedback | API

Streamable Grids - LOD Group Settings

Chunk Type

This defines the type of the Asset Chunks the Grid LOD Group represents. Defining this correctly is important as it tells the World and other components how they should treat the Assets. For instance, Unity Terrain assets will only be neighbored properly if the type is set to Unity Terrain. You can read more about each Chunk Type by choosing the type and then hovering over the dropdown.

The Chunk Type and Axes settings have some interplay between them. For instance, the Unity Terrain Chunk Type is only shown as an option if the Axes are not set to Two Dimensional Using XY Axes.

In the same manner, if at least one Grid LOD Group has its Chunk Type set to Unity Terrain, the Two Dimensional Using XY Axes will not be available to select. You will need to change all LOD Groups using the Unity Terrain Chunk Type to something else before being able to change the Axes to Two Dimensional Using XY Axes.

--Upgrade Note--
This setting was previously called Cell Object Type and had different options. Unity Terrain remains the same, but Other Has Renderer and Other No Render can be changed to Non Terrain Game Object in most cases (unless your chunks aren't game objects!).

--Special Note For Unity Terrain--
Unity has a built in system for automatically neighboring Terrain that sit next to each other, which makes the transition between one terrain and the neighbor seamless. Unfortunately, this system is terribly inefficient, as all terrain in the scene are re-neighbored every time a new terrain is added or removed from the scene.

In order to partially disable this system, it's necessary to disable the Auto Connect property on every Terrain you are using. Don't worry, we still neighbor the terrain; the difference is, our neighboring system is much more efficient! Additionally, you can ignore the Grouping ID field on the Terrain, as this is configured within the World inspector.

Use Single Chunk Set For All Cells

Normally, each Streamable Grid Cell has a single Asset Chunk or set of Asset Chunks (when using multi-chunking) associated with it for each LOD, which are loaded whenever a World Cell from this LOD using the Streamable Grid Cell Index is loaded.

With this option enabled, every World Cell of this LOD will instead use the Asset Chunk Set associated with a single Streamable Grid Cell, which you can specify in the Streamable Grid Cell With Set To Use field (which is only shown when this option is enabled).

For example, if you set the Streamable Grid Cell With Chunk Set To Use Row and Column to 1 (assuming a 2D world), whenever any World Cell using this LOD is loaded, the chunks associated with Streamable Grid Cell 1_1 will be used.

This is useful in sitiuations where you want to load a single chunk (or set of chunks) for all cells, though realistically this would mostly be useful for debugging or testing only.

Do keep in mind, if multi-chunking is enabled, you will still be able to separately set the number of chunks used by each Streamable Grid Cell, however at runtime, the SAM will ignore this data and instead treat the LOD as if it was using the same number of chunks for every cell (which is equal to the number of chunks set for Streamable Grid Cell With Chunk Set To Use.

Put another way, if you query the number of chunks for a given streamable grid cell, it will always return the number of chunks set for Streamable Grid Cell With Chunk Set To Use.

All included Chunk Streamers can make use of this functionality, however if you create a custom Chunk Streamer, you will need to add the necessary code to make this work, or else disable this option in the inspector of your Streamable Grid.

Use Positional Data

When enabled, the Streamable Assets Manager will make use of the Chunk Manager's GetCellObjectPosition and SetChunkPosition methods in order to correctly position the chunks belonging to World Cells.

If disabled, the chunks will not be positioned, however you can still manually position them yourselves in a World Grouping Listener if you wish.

Under most circumstances you'll want to leave this option enabled, or else your chunks will not show up in the scene correctly. Disabling this option is useful for data only chunks, or other chunks which won't be visible to the player.

Note that Terrain always make use of positional data, since there is an implicit understanding that Terrain are meant to be seen by the player.

When Chunk Type = None, no positioning is done since there are no chunks associated with the World Cells. However, you can still make use of the PositionOfChunks property stored on each World Cell to position chunks not associated with the World Cells, if you so choose.

Visual State Of Stored Assets When Active

Denotes the visual state of the assets associated with this LOD, upon being loaded into the scene and placed in an activated state (using SetActive(true) for game objects, for instance).

This setting is only used when this LOD Group is being used with a World Grouping that utilizes a Cell Visual Transition Controller. You can determine which state your assets are in by considering how your visual transition controller works. All visual transition controllers transition objects from an Invisible State to a Visible State, or vice versa. To determine the stored state, simply consider the following question:

Are my assets stored in the state they would be in if my transition controller put them into the Visible state? If the answer to that question is yes, then the assets are stored in the Visible State. If the answer is no, they are stored in the Invisible state.

For the Mat Prop Block Transitioner, simply add your objects to a scene. If, after being activated, they are visible to the camera, then the stored state is Visible. Otherwise it is Invisible.

It is recommended to store your assets in the Visible State, as it will make editing the assets with the World Designer tool more straight foward and less prone to issues. If the assets are stored in the Invisible State, the World Designer must transition them to the Visible State when loaded into the editor, and then back again before saving. While there is usually no issue in doing so, in some cases when editing prefabs, you may find certain properties or children of your prefab reverting to the 'invisible' state unexpectedly.

As such, I recommend testing the World Designer with your Asset Chunks that need to be stored in an Invisible State to ensure that there are no issues. If there are issues, you will need to find a way to store them in the Visible State.

One final note: when assets are stored in the Visible State and loaded into the scene, the Cell Visual Transition Controller is used to transition them to the Invisible State in a single frame before they are activated, ensuring that they cannot be seen by the player before they have been transitioned to a Visible State over multiple frames. Therefore, you should not store the Asset Chunks in the Invisible State with the intention of ensuring they are hidden from the player, as doing so is unnecessary.

If you notice assets becoming visible before they should, it's likely that the state has not been set correctly! Double check your Asset Chunks in that case, to confirm the proper State is set.

Root State

The Root State is the state that your root game objects will be in after being loaded by your Chunk Streamer and passed to the Chunk Manager.

If using prefabs with a Prefab or Addressable Prefab Chunk Streamer, set this to Deactivated if the Streamer's Load In Deactivated State setting is enabled (recommended), or Activated if that setting is disabled (note that deactivating prefab game objects in the Project Hierarchy is highly discouraged).

If using scenes with a Scene or Addressable Scene Chunk Streamer, set this to whatever game object state the root objects in your scenes are saved in, which in most instances should be Deactivated.

This setting is used in three places currently:

1) With the World Designer Tool and the Default Asset Creator when dealing with scene based asset chunks. Primary, it is checked by scene based Asset Managers when saving scenes, to ensure that the root objects in the scenes are set to the correct state before saving the scene. The Default Asset Creator also uses it when creating scene based asset chunks to set the state of the root objects in the created scenes.

2) With Scene based Chunk Streamers, as a simple safeguard to ensure the root objects state in each loaded scene matches what's expected.

3) With Worlds at runtime to eliminate redundant Cell Visual Transition Controller Transitions from Invisible To Visible.

This is necessary because if the Root State is Activated and the Stored Visual State of the assets is Visible, when the asset is loaded it will be immediately visible to the player. If SAM were to treat the assets like other assets, they would be reset to the Invisible State and then transitioned back to the Visible State. To the player's eyes, the objects would appear, disappear, and then reappear according to the Transition Controller's transition technique (fading in for example).

As a result of this, when using an Activated Root State, you should ensure the Stored Visual State of your Assets is Invisible, or if that is not possible, disable the Transition Controller for those assets.

Generally speaking, a value of Deactivated should be used in 95% of cases. At the moment, the only use case we can see for using an Activated Root State is so that scene based Asset Chunks can be used with Build Time Static Batching (BTSB), however given that SAM supports Runtime Static Batching in the form of Static Batcher Listener's, using BTSB is usually not necessary.

It should also be noted that using an Activated Root State will mean when your objects are loaded in, they will be immediately visible to the player if the Stored Visual State of your Assets is Visible, and thus if those two things are true, you really cannot use a Floating Origin Based World. In addition, if using BTSB you are 100% locked into using a non-Floating Origin Based World, as the batched mesh locations are fixed at build time.

Chunk Offsets

The Streamable Asset Chunks associated with a Streamable Grid Cell are always positioned in the scene in relation to the Cell they belong to.

With Assets such as Unity Terrain whose pivot point is at the bottom left most point, the position of the Asset Chunks will exactly match the position of the Cell they belong to.

In other cases, such as when the pivot point of the Asset Chunk is located in its center, placing the Asset Chunks as the position of the Cell would result in the Chunks being out of place.

For such scenarios, the Chunk Offset fields offer a way to position the Chunks in whatever way you deem necessary. These offsets are primarily expressed as percentages of the Cell size rather than raw values.

For instance, a value of .5 for X Cell Offset % indicates that the Asset Chunks should be positioned at the halfway point between the Cell's left and right boundary (on the X Axis). This value is typically suitable for Asset Chunks with center pivot points.

When using a Two Dimensional Axes type, the unused Axis's Offset is expressed as a raw value rather than a percentage. This value is added to the Cell's position in order to calculate the final position of Chunks on that Axis (for instance, the Y Axis when using 2D XZ Axes).

Note that if Asset Chunks are simply empty container parent objects with 1 or more child objects, it's recommended to leave the Offsets at 0 and instead move the positions of the child objects, which will offer greater flexibility.

--Upgrade Note--
The previous World Grid had offset fields present for whatever axes were in use. The new system offers the additional ability to specify an offset for the unused Axis, if you so choose.