Give Page Feedback

Worlds - Dimensions And Gap Cells

Imagine your world is built on an invisible World Grid, like a giant 3D graph paper. This grid is divided into rows, columns, and layers—just like a Rubik’s Cube. Each row, column, and layer has a size you define (for example, rows might be 100 units long) via the World Dimensions settings in the General Settings tab of the World component.

The World Grid provides a fixed reference for positioning Zones, and also serves as the backbone for the Floating Origin Based System SAM uses.

Having a fixed grid with consistent dimensions makes affixing Zones, which are in turn made up of variable size Streamable Grids, to World Space positions much easier.

Existing Users Upgrading to SAM v2

In order to ensure that your World's layout matches what it was prior to v2, we have added an automatic upgrade path for the World Grid Dimensions. This upgrade process will set the World Grid dimensions to be equal to the average dimensions of the previous Base Grouping's Streamable Grid Cells.

If it's important that everything be loaded exactly where it was prior to your upgrade to v2 of SAM, we recommend keeping the upgraded settings as is. If it's not important, you can review these settings after reading the next Sub-Section (Deciding On Dimensions), and change them as you wish.

The upgrade process runs automatically when you click on a World in the scene (you will need to save the scene after), however we recommend using the Upgrade Command instead, which will upgrade all Worlds' in the scene, as well as other components and assets referenced in the scene which may need to be upgraded with v2. To use this command, simply press Assets - > Deep Space Labs -> SAM -> Upgrade Open Scene

If this command is greyed out, it means there are no components or assets in the scene which need to be upgraded.

Deciding On Dimensions

Every row on the World Grid will use the defined Row Length, every column will use the defined Column Width, and every layer will use the defined Layer Height. The equality of rows, columns, and layers makes certain mathematical calculations much cheaper.

In general, smaller World Grid Dimensions are preferred for two reasons:

1) They give more flexibility in where your World repeats when using Endless Worlds, because you are more likely to be able to align Zones to the edges of the World Grid Cells, and because you have more precise control over the amount of gap to add between repeated World instances.

2) When using Floating Origin Worlds, the World can be shifted in smaller increments, which allows content to be more precisely balanced.

With that said, caution must be exercised not to make your World Grid Cells too small, again for two reasons:

1) The dimensions dictate the maximum size of your game World! Effectively, the maximum size of your game world on any axis is equal to dimension * 2147483647 * 2 (this is untested so the value may be smaller by some order of magnitude equal to the dimension). For example, if your Row Length is set to 128, this would give you a max World Length of 549,755,813,632. As you can see, that's pretty big, and will probably be more than enough for most games.

2) Some algorithms used by SAM require traversing the World Grid cell by cell, in order to avoid potential floating point issues. If you use very very small World Grid dimensions, you will be making SAM do more work as it needs to traverse more cell indices. This will probably not be an issue for most users but bears mentioning.

In conclusion, we would recommend using small enough World Dimensions to give you the amount of flexibility you need in deciding where your Worlds repeat (if using Endless Worlds), and small enough dimensions to ensure your World can be as balanced as possible (meaning content is equally loaded on every axis, in every direction). Going any smaller than that is just a waste!

Change Your Dimensions With Caution!

Since the Origin Cell of your World is in reference to a World Grid Cell, changing the dimensions of your World Grid can dramatically shift the location where content is loaded if the Origin Cell and Origin Position are not adjusted. Among other things, this may invalidate any Game Start Configurations you have saved, meaning you will have to recreated/update them using the World Designer Tool.

Any World Grid Cell relative positions you have saved to persistent data will also be invalidated when changing World Grid Cells, although this is likely only to be an issue with mature projects which are further along in their testing process.

There may be other unforseen consequences as well, and as such, we recommend trying to nail down the World Grid dimensions pretty early in your development cycle!

Gap Cells

The Gap Settings section in the General Settings tab of the World allow you to add World Grid Cells between repeated World Instances on any axis.

This allows you to add open space between your repeated world instances when using Endless Worlds, without having to add additional Zones, which are typically represented by oceans or other bodies of water.

The North/South Gap Cells allow you to add World Grid Cells on the Row Axis, while the East/West Gap Cells allow you to add World Grid Cells on the Column Axis.

The Top/Bottom Gap Cells allow you to add World Grid Cells on the Layer Axis, however these settings are only used if the Predominant Axes Type of your World is Three Dimensional.

--Special Note--
The absence of Gap Cells on a given axis is not enough to ensure that Zones on the edges of your World connect when Repeated World Instances are used. To ensure this (in order to have connected land masses, for instance), you must ensure that the edges of the Zones align with the borders of the World Grid Cells that sit on the edges of the World (see Gaps Between Repeated World Instances for more info).