Give Page Feedback

Worlds - World Regions

World Regions define a World Grid Origin Cell and collection of LOD specific Streamable Grid Cells from one or more Zone Groupings. They are useful for Non-Endless Worlds and can be used as an alternative or in conjunction with Active Grids.

Besides possibly changing the Origin Cell, loading a World Region adds a single World Cell user for each Cell in its collection. These cells are associated with a specific LOD and Zone Grouping.

Unloading a World Region removes a single World Cell user for each Cell in its collection.

Creating World Regions

World Regions are created exclusively using the World Designer Tool. You can find more information on how to create them within the World Regions Section of the World Designer Tool Chapter.

Creating World Regions

Viewing/Removing/Auto Loading World Regions

World Regions can be viewed in the General Settings Window of the World, under the Saved World Regions dropdown.

You can remove World Regions by pressing the X button to the left of each Region Name and Number, though this should only be done if you need to reduce the memory used by the scene the World is in (as there are no other drawbacks to having the Region present).

You can enable auto loading of World Regions by enabling the Auto Load option to the right of the Region name. WhenAuto Load is enabled, the World Region is automatically loaded when the World is initialized, which can be useful for defining a starting set of World Cells that should be loaded if not using an Active Grid. Do note, the Origin Cell from the World Region is not used when auto loading the Region!

Manually Enabling Auto Load (Pre World Initialization)

You can simulate the inspector enabling of the Auto Load setting for each World Region before the World has been initialized by using the PreInitialize_EnableWorldRegionAutoLoad method. Because this method only allows you to enable World Regions, you should disable Auto Load for all Regions in the inspector before using it.

You must specify if you want these new settings to overwrite persistent save data (via the overwriteRegionsInPersistentData argument).

If overwriteRegionsInPersistentData is false and persistent save data is loaded, all World Regions that were not loaded at the time of the save will have Auto Load disabled, which makes the PreInitialize_EnableWorldRegionAutoLoad redundant.

In most cases, however, you will want save data to overwrite the Regions passed in via this method, so passing in false for overwriteRegionsInPersistentData is the correct decision.

Manually Loading World Regions (Post World Initialization)

You can load a World Region by name or number (as shown in the inspector), after the World has been initialized, using the LoadWorldRegion method. When doing so, you can choose to either keep or unload existing loaded World Regions, depending on whether you only want the World Cells in the new World Region loaded, or if you want to load them additively.

The Loading of the World Region simply adds a single World Cell User for each Zone Grouping/LOD combo found in the World Region. As such, if a World Cell is already loaded with a higher quality LOD asset, the addition of users for a lower quality LOD will be registered, however it will not result in a change in Asset Chunks (since the higher quality LOD Assets take priority).

You can also choose whether you want to change the Origin Cell of the World to the Origin Cell found in the World Region. Typically, this should only be done if loading the World Region non-additively, though this is of course up to you. Please keep the following in mind, however, when changing the Origin Cell of the World to the value found in the World Region:

1) The Origin Cell Change will fail if a World Update containing an Origin Cell Change is currently in progress.

2) The Origin Cell Change will also fail if an Origin Cell Change has been queued as a result of the Player crossing the World's Re-Centering Boundary. This will only happen if the World's Allow Active Grid Re-Centering option is enabled and an Active Grid with Allow Grid To Re-Center World option enabled is synced to the World.

3) If you wish to avoid a failed origin cell change operation, query the World's IsExplicitOriginCellChangeBlocked property and make sure it returns false before calling the LoadWorldRegion method.

4) The Origin Cell Change will not occur until the next World Update. Before the update occurs, if the Origin Cell is changed again via another LoadWorldRegion call or some other method (such as ChangeOriginCell), the new Origin Cell value will overwrite the previous value. If you want to avoid this, you should always query the IsOriginCellUpdateQueuedOrInProgress property, which will return true if an Origin Cell change is currently in progress or has been queued.

Unloading World Regions At Runtime

You can unload a World Region that has been loaded by name or number (as shown in the inspector) using the UnloadWorldRegion method. This will remove a single World Cell User for each Zone Grouping/LOD combo found in the Region, which may or may not result in the World Cell being unloaded or transitioned to a different LOD (this depends on what other users have been added for the World Cell!).

When unloading World Regions, the Origin Cell of the World is not affected in any way.

Saving World Regions To Persistent Data

The loading and unloading of World Regions is automatically tracked and saved to persistent data when the Component Manager's Save method is invoked. This ensures that you can make changes to which World Regions are loaded at runtime, and those changes will persistent when you save and load persistent data.

If you use the PreInitialize_EnableWorldRegionAutoLoad method and pass in true for overwriteRegionsInPersistentData, the World Region data from the persistent data will be ignored. In most cases this is undesirable behavior, but the option is there if you want it.

How Cells Are Mapped To World Groupings

When a World Region is created, all cells belonging to the same Zone and World Grouping are stored together along with the ID of the Zone and World Grouping. This allows those cells to be loaded even if you change the order of the Zone or Grouping in relation to other Zones or Groupings on the World.

However, if you remove the Zone or Grouping from the World this ID will become invalid, and in most situations the cells will not be loaded when the World Region is loaded. The one caveat to this is if the same Grouping Index on Zone 1 does not have any cells present in the World Region, in which case the cells will be treated as cells from this Zone Grouping, and a warning will be printed to the console.

In some situations this behavior may be undesirable. In order to rectify the issue, you must load the equivalent Editor World Region using the World Designer Tool, unload the cells you don't want loaded, re-save the Editor World Region, then re-save that Editor World Region to the World, overwriting the existing World Region on the World.

Conversely, in certain situations you may remove a World Grouping and/or Zone, then re-add it at a different Grouping Index and/or Zone Index on the World. In these cases, you may want the cells in the World Region to be associated with this new Zone Grouping. To do this, you will need to identify the Zone ID (found after selecting the Zone in the Zones tab of the World) and Grouping ID (found in the General Settings tab of the Grouping) associated with both the old Zone Grouping the cells are currently part of, and the new one you want to associate them with .

Identify Grouping ID GIF

Then, use the Debug Inspector View while the World is selected and scroll down until you find the Runtime World Regions dropdown. Expand it and identify the World Region you want to edit. Expand its drop down and find the Per Grouping Cells dropdown, and after expanding it identify the Zone Grouping whose cells you wish to associate with the new Zone Grouping. Set the Zone ID and World Grouping ID fields of this Zone Grouping to the IDs you found in the previous step, then switch the Inspector View back to Normal (note the GIF below only shows editing the Grouping ID, but the Zone ID should be present and edited as well).

Change World Region Cells Grouping ID GIF

Reducing Streamable Grid Dimensions

If you reduce the number of rows, columns, and/or layers of a Streamable Grid associated with a Zone Grouping that a World Region contains cells for, note that one or more cells in the World Region can become invalid, which is to say the cells may fall outside of the range of the streamable grid.

Since World Regions should only be used with Non Endless Worlds, this should not be a problem, as the cells that fall outside the range of the grid will be pruned automatically. However, the cells will remain in the World Region, in case you end up expanding the Streamable Grid dimensions at a later time.