Give Page Feedback

Worlds - World Regions

World Regions define an Origin Cell (from the Base Grouping) and collection of LOD specific Streamable Grid Cells from one or more World Groupings. They are useful for fixed (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 World 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 Streamable Grid Cell/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 Streamable Grid Cell/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.