Give Page Feedback

Getting Started Tutorial - Active Grid Setup

The Active Grid tracks your Player and makes decisions about which World Cells are needed based on where the Player is in the World. Those decisions are made with the aid of Loading Blueprints, which define the patterns of World Cells to load depending on where the Player is located.

The Active Grid is an optional Component, meaning you can forego its use if you wish (in which case, you will need to use World Regions or a custom solution to add/remove World Cell Users to the World).

For most developers, however, the Active Grid is the perfect tool to implement dynamic worlds, so it's more than likely you will wish to use it. For now, even if you think you might not want to use it, it's best to use it until you gain a better understanding of the Streamable Assets Manager.

Section Instructions

30) Identify the Player that the Active Grid will track. This will most likely be the game object that represents your player character. The world position of this object must represent the actual world position of your player in order for the Active Grid's tracking to work correctly (Assigning The Player Sub-Section).

31) If you have identified your Player as a normal game object, assign it to the Player Transform field on the Active Grid, found in the General Settings tab (Assigning The Player Sub-Section).

32) If you have identified your Player as a non-game object or procedurally created Player, take a look at the Guide Sections indicated in the Assigning The Player Sub-Section.

33) Take note of the Defaults settings. These settings are only used when persistent save data does not exist for the Active Grid. This is an important concept, so it's worth reading the Defaults Sub-Section in detail at some point.

34) If using a Floating Origin based World, determine whether the Allow Grid To Re-Center World and Move Player After Origin Cell Change settings should be enabled (Defaults Sub-Section).

35) Create a Loading Blueprint Repository asset in your Project Hierarchy (Loading Blueprints Sub-Section).

36) Assign the asset you just created to the Loading Blueprint Repository field (found under General Settings/Basic Settings) on the Active Grid (Loading Blueprints Sub-Section).

37) Edit the Repository by pressing the Launch Blueprint Editor button on the Active Grid, then add its first Loading Blueprint using the Create Loading Blueprint button within the Loading Blueprint Editor (Loading Blueprints Sub-Section).

38) The default Uniform Ring Blueprint should be suitable for now, however you are free to change this blueprint if you wish (including its name). We link to a Section of the Guide that details the different Blueprint types in the Loading Blueprints Sub-Section).

39) Click on the Groupings tab on the Active Grid and confirm that Grouping 1 has the Loading Blueprint you just created selected in the Loading Blueprint dropdown (Loading Blueprints Sub-Section).

40) Though not required, we suggest reading the Groupings Sub-Section to understand the relationship between Active Grid Groupings and World Groupings.

41) Enter Play Mode! Everything should be configured correctly and your game world should load in, however if something is not, you should see errors or messages in the console window. Please use these (click on each message to see the full text!) to diagnose what is wrong, then use the FAQ chapter to see if you are running into one of the common issues. If not, and you cannot figure out what's going, please don't hesitate to reach out to us via one of the methods listed on our Contact page (though we recommend our Discord Server above all else).

Assigning The Player

Return To Section Instructions

The Active Grid cannot function without a Player assigned, as it uses the Player's position to determine which cells should be loaded. If you are using a normal Unity Game Object with a Transform Component as your Player, assigning the Player is very simple. Just drag and drop the game object to the Player Transform field.

If you are not using a traditional Transform as your Player or are using a runtime created Player that needs to be assigned via Scripting, please take a look at The Player Sub-Section within the General Settings Section of the Active Grids Chapter, or the Procedural Players Section in the Players Chapter.

--Sample Scene Directions--
This scene uses a simple Transform on a Game Object called Player. Assign this Player object to the Player Transform field.

--MicroVerse Directions--
In the 2x2 Demo scene, the Player object does not actually move. Instead, it is the Challenger game object (which is a child of the Player) that moves. Assign this object to the Player Transform field now. If you are using a custom scene, assign the Transform that actually moves around your scene, or see the Sections listed above if using a procedurally/runtime generated player

Defaults

Return To Section Instructions

Default Settings can be found both in the General Settings Window and on a per Grouping basis. They are starting values that the Active Grid uses when no persistent data exists for the Active Grid. If persistent data does exist, in most instances the values for these settings that is found in the persistent data will be used.

Active Grid Default Settings GIF

The most important of these is the World, as it defines the World that the Active Grid starts the game synced to, which controls which Asset Chunks will be loaded. Do note, however, that you can change the World that the Active Grid is synced to at runtime, and if you do, the change is saved with persistent data, meaning that when the persistent data is loaded, the Active Grid will be synced to that World rather than the Default World.

The settings found below the World are also modifiable at runtime, which allows you to change them depending on the World you are syncing the Active Grid to.

If you are using a large floating origin based World and have enabled the World's Allow Active Grid Re-Centering setting, you should also enable the Allow Grid To Re-Center World setting on the Active Grid

Loading Blueprints

Return To Section Instructions

Each Active Grid stores a reference to a Loading Blueprint Repository, which is simply a container Scriptable Asset that stores one or more Loading Blueprints.

There is a whole Chapter dedicated to Loading Blueprints and Repositories, however for now you can follow these simple setup steps

1) Create a new Loading Blueprint Repository by right clicking the folder where you want to place the Scriptable Asset and choosing Create -> Deep Space Labs -> SAM -> Loading Blueprint Repository.

Create Loading Blueprint Repository GIF

2) Rename the Asset to something you will be able to identify. A good option might be First Repository

Rename Repository GIF

3) Left click the asset and press the Edit Repository button in the inspector.

Open Repository GIF

4) In the top left of the Loading Blueprint Editor Window you will see a sub window called Main Controls. Press the Create Loading Blueprint button in this sub window.

Create First Loading Blueprint GIF

This creates a basic 2D 3x3 Uniform Ring Pattern. Basically, whichever World Cell the Player is standing in, that Cell (Blue Cell) plus the 8 neighboring World Cells (Green Cells) will be loaded. While you could change the Blueprint Type or adjust other settings, for now this simple pattern should suffice, unless you have setup your Streamable Grids to use Three Dimensional Axes. In that case, use the Change To 3D button to change the Blueprint to a 3D blueprint..

After creating the Loading Blueprint, you can close the Blueprint Editor and return to your Active Grid. Assign the Repository asset you just created to the Loading Blueprint Repository field on the Active Grid, then navigate to the Groupings Window (accessed via a tab button at the top of the Active Grid inspector window).

You will see a single Grouping and the Loading Blueprint you just created should be assigned to the Fallback Loading Blueprint field. If you added more Blueprints and the one you want the Grouping to use is not selected, use the dropdown menu to select the correct Blueprint. This dropdown shows you all Blueprints on the Repository. It's important to give your Blueprints unique names so that you can identify them via this dropdown!

Go In Depth With Loading Blueprints

--Upgrade Note--
The basic 3x3 pattern corresponds to the previous Active Grid Type of Outer_Ring_Grid with a single Inner Area Layer, Row, and Column and an Outer Ring Width of 1.

--Sample Scene Directions--
While you could make use of the Sample Blueprints Repository, we recommend creating a new Repository so that future Sample Package upgrades do not erase or modify any changes you make to the Repository. The easiest way to do this is to simply duplicate the Sample Blueprints Repository, move it to a new folder, rename it, and then assign it to the Active Grid's Loading Blueprint Repository field.

--MicroVerse Directions--
The Default 3x3 blueprint should be all you need for now, however if you want to explore other blueprint options, you are free to do so. You can also use this blueprint with the MicroVerse Hierarchy Grouping, as SAM will just ignore extra cells that fall outside the bounds of the Streamable Grid the blueprint is used with (unless your World is endless, in which case those extra cells will result in the Hierarchy Cell/Asset Chunk being loaded multiple times).

Groupings

Return To Section Instructions

Like the World, each Active Grid starts with a single Grouping (named Grouping 1), which should be sufficient for now (unless you are following along using the Sample Scene or MicroVerse, in which case see the instructions below). Of course, you are free to add more Groupings, and if you have already added more to your World, you should add the same number of Groupings to your Active Grid. Keep the following in mind when doing so:

1) Each Grouping on the Active Grid is paired with the same named Grouping on the World the Active Grid is synced to. The order of the Groupings (either on the Active Grid or World) does not matter (this differs from how SAM worked prior to v2).

2) The Active Grid can contain Groupings that the World it is synced to does not have (in which case, those Grouping are ignored), however this is typically only done if you expect to sync the Active Grid to other Worlds at runtime that do make use of those Groupings. This allows you to add Groupings for all the Worlds you expect the Active Grid to ever be synced to.

3) Conversely, a World may contain Groupings that Active Grids synced to it do not have. That is also not problematic!

Adding & Removing Active Grid Groupings GIF

At this time, no other settings should need to be adjusted, however if you are interested in the other settings, please remember that all settings with an asterisk (*) in their name have tooltips you can read by hovering over the setting names. You can also find more detailed information about Active Grids within its dedicated Chapter.

--Sample Scene Directions--
Like with the World, you will need to add three additional Groupings to make a total of four Active Grid Groupings. The names of Groupings 2-4 should automatically be set to the names of Groupings 2-4 of your World, but please confirm this. You may also need to change the Grouping 1 Name to match the Grouping 1 Name on your World (you can use the Match Name To World Grouping # button to easily do this).

In general, Groupings with smaller cell sizes will likely need to make use of Loading Blueprints with a greater number of Cells, so you will probably wish to change the Loading Blueprints used by each Grouping at this time. If you duplicated the Samples Blueprint and are using that, you can try using the Standard2D_3x3 Blueprint for the Terrains and Large Structures Groupings, and the Plant2D_5x5 Blueprint for the Plants and Small Objects Groupings.

--MicroVerse Directions--
Like with the World, you will need to add one additional Grouping to make a total of two Active Grid Groupings. When you add the additional Grouping its name should automatically be set to the name of Grouping 2 on the World, however you should confirm this. Also, if you changed the name of Grouping 1 on the World, you will need to change the name of Grouping 1 on the Active Grid as well (you can use the Match Name To World Grouping # button to easily do this).