Time for action – use layer switching logic

The requirements for each level will be different, and thus, to begin with, you should have a populated level open that has entities organized onto different layers.

In this example, we will use layer activation and deactivation to show all the contents required for a particular gameplay section.

Typically when creating levels, they are split into unique sections named action bubbles.

It is a common practice to hide layers that contain action bubbles, which are not being played.

It is possible to activate and deactivate all the entities in a specific layer by using the Engine:LayerSwitch FlowNode.

Note

Even brushes and solids can be hidden/unhidden using this node.

  1. Simply create a new Flow Graph and add the Engine: LayerSwitch FlowNode to the graph.
  2. Next, double-click on the Layer property. This will present you with a pull-down window, allowing you to set what layer should be attached to this node.
    Time for action – use layer switching logic

    Layer switching needs to be globally enabled in order for the level to work.

  3. In the Rollup Bar, switch to the Terrain tab, then select Environment, and set UseLayersActivation to True.

What just happened?

Being able to hide and show the different layers expands the control a designer has on the world while the player is playing in it. It is common that multiple triggers are used to hide certain layers or unhide other layers as the player progresses through a level. This can also save a massive amount of time when it comes to reworking entire areas for a player's revisit to the area after an event.

Note

It is important to know that, though it can immediately save performance, there is no core manipulation of the streaming system when performing layer switching.

Limitations of layer switching

Though layer switching is a simple technique, there are some limitations to what it can and cannot do.

  • Entities that are set to be hidden in a game will not unhide if the Unhide input is triggered
  • Picked up objects will disappear in the player's hands when their layer gets hidden
  • Only entities, brushes, and solids are affected
  • The layer switch has nothing to do with streaming

Cinematics

It is good workflow to always create a layer dedicated to cinematics. The cinematics layer will typically have to unhide and hide different entities within the game world to function, as well as be able to maintain a high standard of quality in the cutscene while saving performance on the rest of the level. Using the layer switch combined with the cinematics layer gives a lot of control over to the designer in terms of which objects are being shown when, and whether they remain in the level or not after the cinematic has finished.

Pop quiz – performance profiling

  1. Which r_stats variable will display a per-object draw call count on screen?
    1. r_stats = 1
    2. r_stats = 2
    3. r_stats =15
    4. r_stats = 6
  2. Which is the console command to display the physical information visually in the viewport?
    1. p_draw_helper = 1
    2. e_debug_draw = 1
    3. ca_displayskeleton = 1
    4. physicsplz = 1
  3. Which editor construct is used to connect a VisArea to other VisAreas and outdoors?
    1. BasicEntity
    2. IrradianceVolume
    3. Portals
    4. LightBox
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.34.85