Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Explanation of Layer Settings

...

Overview

Sandbox uses layers for two main reasons: Organizing your level content and Streaming performance.

Any object you place on a layer (vegetation/terrain excluded) can be hidden/unhidden via the Layer Control and also via Flowgraph, which allows loading/unloading of level areas to keep performance high and memory consumption low.

Table of Contents
maxLevel3
minLevel2
excludeOverview

Layer Control

Objects like brushes and entities can be placed on layers which are basically a mechanism to group objects logically.

Each layer can be stored as a separate .lyr file on the hard disk. Having the layer files stored separately on disk allows to do collaborative editing, since the layer files can be checked in individually in a revision control system like Perforce.

You can find the Layer Tab on the RollupBar. On the Layer's Layers tab are a few useful buttons and the layer list. By default, the level's objects will be located in on the "mainMain" layer.Image Removed

Image Added

Tip

In the screenshot that several layers have an asterisk after them. This shows layers that have had changes made to them.

Creating a New Layer

To create a new layer, click the New Layer button. After clicking on it, a dialog box will be displayed:

Image RemovedImage Added

Be sure to enter a useful and recognizable name for your layer, possibly indicating its function or a description of what it contains. For example "beach area" or "sounds". In the dialog box you can also specify if the Layer is visible by default, external, will be exported to the game, or frozen by default

See the Layer Settings description for more information on the functionality of each individual setting. You can always change these settings later on by clicking the Layer Settings button or right-clicking the layer and selecting Settings.

Deleting a Layer

Click the Delete Layer button to delete the currently selected layer. A dialog box will be displayed show up and ask for confirmation.

Once a layer is deleted, it cannot be restored without reloading a previous version of the level, or re-importing the layer if it is was external.

Renaming a Layer

Click the Rename Layer button , which opens a dialog box that allows you to rename the currently selected layer.

Exporting a Layer

Click the Export Layer button to open the browser windowa Save As dialog, allowing you to export your layer to a file. Make sure your layer file has the .lyr extension to it. This layer file can be imported into other levels, if required.

Importing a Layer

Click the Import Layer button to import a layer that was exported previously. Locate your layer using the browser windowthe Open File dialog.

Layer Settings

To change layer settings, click the Layer Settings button or right click on a layer and select Settings in the popup menu. The same dialog box as for creating a new layer will be displayed. Change the settings and click OK.

Setting

Description

Color

For organization purposes only. Examples are to choose the same color for a layer and all its children or to attribute the color some meaning.

Visible

Same as the layer hide/show icon. See below for more information.

Frozen

Same thing as the layer freeze/unfreeze icon. See below for more information.

Export Layer Pak

The layer's resources will be marked for use in the layer switching system for fast streaming. See Layer Streaming.

Default Loaded

The layer will be loaded at startup even if it is not visible. See Layer Streaming.

External

When this checkbox is enabled, the layer will be stored as a separate .lyr file on disk, enabling better use of version control systems.
The layer will automatically be exported when your level is saved, and imported on loading.
Un-checking this box will make the layer part of the .cry file again and the external .lyr file will no longer be updated. External layers are indicated by an underlined layer name.

Export to Game

The layer will be exported to the game when you use File -> Export to engine.
Un-check if you do not wish to export the objects in this layer to pure game mode. This useful for objects used for development. This option is distinct from the visibility setting in the editor. See also 'Platforms' to export depending on the deployment target.

Brushes Have Physics

Brushes within a layer with this disabled will not have physics. This is good for distance background objects to save on performance.

Platforms

You can choose if you want the layer to only be exported to specific platforms. This is useful to have different assets or logic depending on your deployment target for performance reasons or for exclusivity.

Assigning Objects to Layers

When you have more than one layer in your level, you can assign your objects to a specific layer to your objects.

Select an object and look at its Entity settings on the RollupBar. Click the Layer button to open up the layer list which will allow you to select a different layer.

The image below shows a SpawnPoint Particle entity selected, and the Layer's Layers button selected on the RollupBar.

Image RemovedImage Added

By default any object is placed in the layer "Main", unless you have selected another selected from the layers menu.

If a different layer is select selected from the Layer's Layers tab, any objects added to the level will automatically be automatically asigned assigned to that layer.

Hide/Show and Freeze/Unfreeze Layers

After assigning layers to your objects and entities, there are a few additional ways to manage them. Go to the layer list in the RollupBar.

  • Toggling the eye icon will hide/show the objects

...

  • on that layer.
  • Toggling the arrow icon will allow interaction with objects when the icon

...

  • is visible (objects are unfrozen), and disallow interaction when the icon is hidden (objects are frozen).

Additionally, we have 2 extra icons on the top of the stack that controls the visibility or frozen state of all the layers. When all layers are visible or editable, the icon will show.

Once a layer is hidden, the icon will disappear. You can toggle the icon yourself to hide / show all the layers at once.

Image Added

 

Optional double clicking of layer states

Double clicking on an icon will make make all layers  layers change their state of hide/show or frozen/unfrozen, depending on which icon was selected.

Image Removed

Layer Settings

To enter layer settings, select your layer then right click on the layer name. The same dialog box as for creating a new layer will be displayed. Change the settings and click OK.

...

Setting

...

Description

...

Visible

...

Does the same thing as the layer hide/show icon.

...

Frozen

...

Does the same thing as the layer freeze/unfreeze icon.

...

External

...

When this checkbox is enabled, the layer will automatically be exported when your level is saved, and imported on load. The layer will now function externally to the .cry file, and can be edited independently. Unchecking this box will make the layer part of the .cry file again, and the external .lyr file will no longer be updated.

...

Export to Game

...

We also have the option to disable the double clicking of layers completely. Inside the preferences panel of the editor, there is a new option for this.

Once disabled you can still use the 2 icons at the top of the stack to toggle all the layers at once.

Tools\Preferences...

Image Added

Grouping Layers (Child Layers)

To group layers, simply hold CTRL and drag one layer onto another. The layer that is dragged will then become a child layer of the layer you dropped it onto.

To un-group the layers, hold CTRL and drag the layer you wish to un-group into the empty space below (or the very bottom of the layer list). It will then be released back into its own main layer.

Image AddedImage Added

Grouped Layers

Un-grouped layers

 

Related CVars

es_LayerDebugInfo

e_ObjectLayersActivation

e_ObjectLayersActivationPhysics

sv_LoadAllLayersForResList

es_LayerSaveLoadSerialization

 

Excerpt
hiddentrue
Learn how to create, manage, and use layers to manage complex levels.