Give Page Feedback

Worlds - Zones And World Groupings

Worlds are made up of one or more Zones and World Groupings. Zones help organize content by its physical placement within the World, while World Groupings help organize content by various other metrics, such as asset size and loading behavior.

As an example, consider a World made up of Unity Terrain. Unity Terrain generally require the same loading behavior no matter where they are located in the World, and as such, they can be part of the same World Grouping (called Terrain for instance). However, the World may be made up of many different Terrain Groups. One Group might represent an island, while another represents an entire dessert area. These different regions could be represented by a single Zone or multiple Zones, depending on the terrain settings used by the Group and your own preference.

Organizing Streamable Grids With Zones

Each Zone is effectively a collection of Streamable Grids, with 1 Streamable Grid assignable per World Grouping. It is perfectly possible to have a World with a single Zone, however this will make expanding the World much more difficult.

A Zone does not need to have a Streamable Grid assigned for every World Grouping. This allows you to configure Zones based on the type of content that Zone needs (for instance, a Dessert Zone may not need trees or plant content). When a Zone DOES have a Streamable Grid assigned for a World Grouping, a Zone Grouping is generated at runtime and the Streamable Grids cells and their Asset Chunks are dynamically loaded and unloaded.

Each Zone Grouping contains a collection of World Cells, which serve as vessels for Asset Chunks. They are very similar to Streamable Cells except that they are actual C# objects rather than just a concept. They also have position within the Scene Space and hold a ton of data, including the Asset Chunk Set, Cell bounding box within the scene, the current LOD in use, and neighboring World Cells. In reality, this is an important class, so if you'd like to know more you can take a look at the World Cell Section within the Secondary Non Components Chapter.

Tell Me More About World Cells

Zone Expansion

One glaring issue with SAM prior to v2 was the difficulty in expanding Worlds on negative Axes. With Zones, expanding the World is as easy as adding additional Zones and positioning them where you need them!

In addition to this, Zones also make it easier to work with discreet groups of content, as each group of content can utilize their own unique Streamable Grids, allowing for varying number of Cells and Cell Dimensions.

This is especially powerful when working with fixed size content such as Unity Terrain. One of your artists may author Terrain with a certain set of dimensions, while another authors Terrain with a different set of dimensions. Before v2, getting such Terrain to work well together under the umbrella of a single Streamable Grid was next to impossible. Now, each set of Terrain can be in their own Streamable Grid and Zones!

Rearranging Zones

The position of a Zone in reference to the World Grid is defined by a simple Zone Position setting (zone position relative to World Grid Cell L1, R1, C1), and thus can be adjusted throughout your game development process in order to move content around as needed.

Streamable Grid Size Restrictions Removed

With the introduction of Zones, the restriction that all Streamable Grids used together on the same World must have the same size has been removed. Streamable Grids can be whatever size is needed to represent their content!

When a Zone uses Streamable Grids of different sizes, the Zone's size is configured to match the largest Streamable Grid (separately for each axis) present.

Do keep in mind, however, that the minimum point of each Streamable Grid will always be aligned with other Streamable Grids on the same Zone.

Cross Zone Neighboring

SAM's Zone implementation takes into the real use case of having multiple Zones aligned so that adjacent cells on each Zone line up perfectly.

When SAM encounters such Zones, it will neighbor the World Cells across the different Zones so long as the World Cells belong to the same World Grouping. This means you can retrieve a neighboring World Cell from a neighboring Zone using the World Cell's Neighbor properties, and it also means that terrain neighboring will function correctly when terrain from different Zones line up correctly (assuming the terrain are part of the same World Grouping).

You do not need to configure any special settings to make this work. You need only ensure that the Zones are positioned in such a way that the World Cells' borders line up correctly. For example, if the Zones' Rows share a common edge, then the Cells that are adjacent along this edge must have the same Lengths, and the position of each Rows top and bottom edge must line up exactly.

Defining Content using World Groupings

With v2 of SAM, World Groupings are now exclusively used to differentiate different content or asset types, as well as to control different settings related to the loading of that content type. There is no built in restriction on how you separate content into different Groupings; for instance, you could theoretically have just a single Grouping, although this would not generally be a good idea.

While there are no rules dictating how content should be organized into World Groupings, the following guidelines may be useful to you, which explain some common reasons for placing assets on the same World Grouping:

1) The Assets are of a similar size and thus would need to be shown at around the same distance to the player.

2) The Assets are transitioned visually in the same way (and thus can use the same Cell Visual Transition Controller, of which only 1 can be assigned for each Grouping).

3) The Assets require the same World Grouping Listeners. Listeners are assigned on a per Grouping basis, so it's important that all assets on the same grouping can be used by any assigned Listeners.

4) Other settings found on the World's Overridable Settings tab work for each Asset.

Grouping Axes Restriction

All Streamable Grids associated with the same World Grouping, no matter which Zone they are on, must utilize the same Axes. This should generally not be a problem, as it would be quite rare to need different Axes for these Grids, but it bears mentioning nonetheless!

Note that there is no such restriction between Streamable Grids across different World Groupings, even on the same Zone, although in reality the only two Axes types that can be combined are Two Dimensional On XZ Axes and Three Dimensional Axes.

Load and Unload Order

You may wish to factor in the load and unload order of Groupings when choosing the order of Groupings.

When loading World Cells, World Cells are always loaded on Grouping 1 first, followed by Grouping 2, Grouping 3, and so on. When unloading World Cells, the last Grouping is unloaded first, followed by the next one below it, and so on until finally Grouping 1 is unloaded.

This allows you to layer your World Groupings so that if a World Grouping B has a dependency on World Grouping A, you can place World Grouping A before B so that it loads first, and so that B is unloaded before A.

For example, perhaps World Grouping A contains table assets, while Grouping B contains food, plates, and other items that will be placed on the tables. If the assets from B are affected by physics, the table would need to be placed before adding them to the scene (so that they do not fall), and they would need to be removed from the scene before removing the tables. This can be achieved by simply making Grouping A come before Grouping B in the World's Grouping List.

You can change the order of the World Groupings at any time using the Move World Grouping Left and Move World Grouping Right buttons, found within the Groupings Window on the World Inspector.

You can also easily remove any World Grouping (unless removing that Grouping would result in no Groupings on the World) using the Remove World Grouping X button.

Optional Grouping Components

There are two types of optional Components that can be assigned to World Groupings:

1) The Cell Visual Transition Controller - You can assign 1 of these to each World Grouping. This component allows you to control exactly how the Asset Chunks that belong to World Cells for the Grouping are transitioned into the scene, out of the scene, and from one LOD to another.

For example, you could modify the transparency over time or adjust the position of the Asset Chunks. While there are a few default Controllers included with SAM, it is highly likely you will wish to create a custom Controller for custom effects. Use the button below to learn more.

2) World Grouping Listeners - You can assign 1 or more of these to hook into the Grouping in order to respond to different World Cell related events. Listeners are a powerful tool that allow you to implement a host of advanced functionality. You can learn more about them using the button below.

Cell Visual Transition Controller

World Grouping Listeners

Other Considerations

Active Grids are configured on a per Grouping basis, and in a general sense, the Loading Blueprint for a given Grouping is intended to be used to load cells across all Zones that make use of that Grouping. While there is some leeway here in the form of assigning Zone specific Loading Blueprint Overrides to each Grouping, that requires extra work. To avoid that extra work, it is recommended to try and kep the Streamable Grid Cell sizes used for the same World Grouping across different Zones to roughly the same size. This will allow you to use the same Loading Blueprint to load the cells of those Zone Groupings, no matter which Zone is currently in range of the player.

There are no Zone specific overrides on the World. This is important, as it means the assets associated with a particular World Grouping should be consistent across different Zones. That will ensure that the loading behavior remains consistent. For instance, if using Unity Terrain, the Terrains across different Zones, while they can be of different sizes, should not be drastically different in size. Nor should they have different resolutions, as this might make loading slow or performance heavy only when loading certain zones.