Give Page Feedback

Loading Blueprints - Uniform Custom Shape Type

The Uniform Custom Shape Type is another simple Type that is easy to understand and use. It is very similar to the Uniform Ring Blueprint Type, but rather than using rings of cells, you can manually choose the LOD Cells which are part of the pattern. This allows you to create unique patterns not achievable using the Uniform Ring Type.

Uniformity

Uniformity means the Blueprint utilizes a single Loading Pattern no matter where the Player is in the game world. While the pattern is the same, however, the Cells that are loaded do change depending on where the Player is.

Think of a stamp. The stamp creates the same pattern no matter where you place it on a piece of paper, but the area that's stamped is different every time. It works the same for Uniform Blueprints.

Shifting The Pattern

With Uniform Custom Shape Blueprints, when the Player crosses the Inner Area Boundary, the Pattern that is loaded is shifted in the direction of the crossed boundary by 1 Cell. For example, if the Player crosses from the Inner Area to a Cell in the next Column, all Active Grid Cells have their Column value incremented by 1.

A test is then performed to ensure that the Player is actually within the new Inner Area; if they are not, the entire Active Grid Grouping is rebuilt, with the Cell the Player is in becoming the Key Cell.

This strategy is intended to shift the Inner Area in a way that reduces the chance that the Player can immediately travel in the opposite direction and re-cross the boundary, which would cause another change to the loaded Active Grid Cells. Of course, this advantage is only realized if using more than 1 Inner Area Cell on each Axis.

This advantage is unique to Uniform Ring and Uniform Custom Shape Blueprints and is the primary reason for using them over their Non Uniform counterparts.

The Inner Area

Uniform Custom Shape Blueprints are able to utilize a variable size Inner Area (a single Cell or multiple cells).

When the Inner Area is a single Cell and the Player crosses its boundary, they remain very close to the new boundary that forms when the Pattern is shifted. This means it is very easy for the Player to re-cross the boundary in the opposite direction. This can result in a lot of World rebuilds when the player is in an area right on the edge of two cells, because if the Player repeatedly crosses the boundary in a short period of time, the Loading Pattern will constantly change (we call this Pattern Churn).

To solve this issue you can use multiple Inner Area Cells on each Axis. This way, when the Player crosses the Inner Area boundary, the Inner Area (along with the rest of the Cells) are shifted and the Player ends up not near the edge of the opposite boundary.

To better visualize this, set your Inner Area to 2 Columns. Now, imagine the Player crosses from the right most Blue Cell into the Green Cell to the right of it. In this scenario, the Green Cell would become part of the new Inner Area, while the right most Cell in the previous Inner Area would become the left most Cell in the new Inner Area (the new Key Cell). The Player would then be sitting right in the middle of the Inner Area and would need to travel some distance before crossing the boundary in both the left and right direction.

Physical Surfaces And Crossing The Inner Area Boundary

When the Blueprint is being used with Assets that interact with the Physics system, especially walkable Assets like Terrain or other ground meshes, it's important to ensure that the Player can cross the boundary of the Inner Area properly.

The best way to do this is to make sure that the Inner Area is surrounded by at least one ring of Cells that use the same LOD. This ensures that those Cells do not change LOD as the Player crosses into them.

If you do not do this, it's possible that the Player will walk into a Cell while it is transitioning between LODs, which may cause the Player to fall through the world or enter geometry that it shouldn't.

This is not a concern with Assets that do not interact with the Physics system.

Adding LODs

By default Blueprints start with a single LOD. You can add more by navigating to the Cell Pattern Data tab and pressing the Add LOD Group button.

Removing LODs

An LOD can only be removed if it is the last LOD in the Blueprint and not LOD 1. This is because removing LODs that aren't the last one would result in LODs that come after being promoted, since it's not possible to have a missing LOD.

You can however disable all Cells in an LOD by pressing the D button next to the LOD, which will cause no Cells to be loaded for that LOD when using this Blueprint.

When removing an LOD, all Cell's that are currently set to that LOD will be disabled. If you wish to keep those Cells enabled, you will need to manually select them and change them to a different LOD before removing the LOD.

If an LOD can be removed, you will see an X button next to the LOD in the Cell Pattern Color Key (found in the Cell Pattern Data Window). Press the X button to remove the LOD.

Cell Indexes

The Cell Indexes (R2 | C4, R1 | C1 for example) do not actually correspond to World Cells from a World Grouping, since the Uniform Custom Shape Blueprint is intended to be used universally across all Cells. However, you can think of the Indexes as representing the Cells that would be loaded if the Key Cell (bottom left cell in Inner Area) were Streamable Grid Cell Row 1, Column 1 (and Layer 1 for 3D Blueprints).

By default these indices represent Endless Grid Indices, however you can change them to show Streamable Grid Indices via the View Controls window. You can also hide the Cell Indexes, change their placement, or make them bigger/smaller using the View Controls window.

We do recommend using the Draw Endless Grid Indices option, as it better represents the Pattern and shows you the Cells that would be loaded regardless of the Streamable Grid size the Blueprint is used with.

Manipulating Cells

In order to manipulate Cells you must first select those Cells.

You can select a single Cell (by left clicking it) or select multiple Cells (by left clicking, holding down the left click, and dragging the mouse - release to lock in the selection). This operation will clear any previously selected Cells.

If you already have one or more Cells selected, you can add more Cells to the selection by holding the Shift button while performing those two actions. In the same vein, holding down the Control button allows you to remove Cells from a selection. Use the following colors to identify which type of operation you are performing:

New Selection: Selects new Cells so that Cells already selected are cleared.

Additive Selection: Adds the selected Cells to the Cells already selected.

Subtractive Selection: Removes the selected Cells from the Cells already selected.

Once you have released the left mouse button, the operation will be confirmed and the new Cells, added Cells, or remaining Cells will have a white outline. You can clear the Selected Cells by clicking anywhere in the Pattern Editor (not over the Controls Windows).

You can change the default White color of Cells that have been selected, or any of the operation colors described above (plus many more colors) via the GlobalEditorSettings asset, which is found in the Assets/Editor Default Resources/Deep Space Labs/SAM/ScriptableAssets folder.

Enabling Cells

Once you have selected some Cells, you can Enable them by setting them to a specific LOD. While you can do this using the Set button found in the Cell Pattern Data window and within the Cell Pattern Color Key area, it is usually much easier to use the number keys on your keyboard to do so instead.

By default, the 1-9 keys directly correspond to LODs 1-9, while the 0 key corresponds to LOD 10. You can change this default behavior by modifying the LOD Paint Offset value, which sits just below the Add LOD Group button.

The Offset value you specify is added to the number key you press (with 0 representing 10) in order to form the final LOD values that the number keys correspond to. For example, if you set the LOD Paint Offset to 10, 10 is added to each number key, so that pressing Key 1 sets the selected Cells to LOD 11, while pressing key 0 sets the Cells to LOD 20. This is very useful when working with larger LODs.

Of course, pressing a number key only works if the LOD corresponding to that key exists in the Blueprint, so make sure to add the LOD first!

Disabling Cells

You can Disable selected Cells either by using the Disable Selected Cells button or by pressing the D Key on your keyboard. By default, Disabled Cells appear red in the Pattern Editor, although you can change this via the GlobalEditorSettings asset.

You can also disable all Cells that are currently part of a specific LOD by pressing the D Button next to the LOD in the Cell Pattern Color Key. Be careful when using this option, however, as it will disable all Cells on that LOD even if currently they are not viewable.

The Viewable Area

Drawing Cells in the Pattern Editor is not a free operation. For very large patterns with 100's or even 1000's of Cells, editor performance would drop to a snail's pace if we drew every Cell. At the same time, when using a Blueprint where you can manually select Cells, we want to give you a large canvas of Cells to choose from. The Viewable Area is an imperfect solution to this problem and can be found in the View Controls Window via the Viewable Area tab.

It defines the region of Cells that are shown in the Pattern Editor and that are selectable by you and which can be manipulated. You can change its size to as large of a value as will work for your computer and you can change the region of Cells that are shown by modifying the Cell Start and End Values. The <, <<, >, and >> buttons allow you to shift the Viewable Area by a single Cell or by the entire size of the Viewable Area.

Do not worry about navigating away from already Enabled Cells. Once a Cell is Enabled, it remains Enabled even if it is not currently being shown in the Viewable Area!

To help you in identifying what region of Cells the Viewable Area corresponds to, you will notice that the first, middle, and last row/column/layer of Cells is marked. These values represent the indices of the those Cells on a theoretical Endless Grid, where the Inner Area Cell is Cell Row 1, Column 1, Layer 1.