L4D Level Design/Visibility: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (1 revision)
m (Nesciuse moved page L4D Level Design/Visibility/en to L4D Level Design/Visibility without leaving a redirect: Move en subpage to basepage)
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{L4D level intro menu}}
{{L4D level intro menu}}


Line 24: Line 27:
Sticking with our level called <code>tutorial02</code>, let's create a platform that extends the upper floor where we created our ladder.
Sticking with our level called <code>tutorial02</code>, let's create a platform that extends the upper floor where we created our ladder.


Using the [[Image:Hammer select.png]] '''Selection tool''', duplicate the back wall brush that we extended out to create the upper story in the last tutorial by {{key|Shift}}-dragging it. Reshape it to be a platform that extends out from the upper story on one side.
Using the [[File:Hammer select.png]] '''Selection tool''', duplicate the back wall brush that we extended out to create the upper story in the last tutorial by {{key|Shift}}-dragging it. Reshape it to be a platform that extends out from the upper story on one side.


It should be 368 units wide, 176 units long, and 16 units deep.
It should be 368 units wide, 176 units long, and 16 units deep.


[[Image:l4d_hammer_platform_01.jpg|thumb|left|500px|caption|Duplicating a wall brush to make a platform.]]{{clr}}
[[File:l4d_hammer_platform_01.jpg|thumb|left|500px|caption|Duplicating a wall brush to make a platform.]]{{clr}}


Feel free to re-texture the bottom of the platform so that it matches the ceiling and floor.
Feel free to re-texture the bottom of the platform so that it matches the ceiling and floor.


[[Image:l4d_hammer_platform_02.jpg|thumb|left|500px|500px|caption|Texturing the bottom of the platform.]]{{clr}}
[[File:l4d_hammer_platform_02.jpg|thumb|left|500px|500px|caption|Texturing the bottom of the platform.]]{{clr}}


Now, go to the '''Tools''' menu and choose '''Tie to Entity'''. You can also use the {{key|Ctrl}}+{{key|T}} keyboard shortcut.
Now, go to the '''Tools''' menu and choose '''Tie to Entity'''. You can also use the {{key|Ctrl}}+{{key|T}} keyboard shortcut.


[[Image:l4d_hammer_tie_to_entity.jpg|thumb|left|300px|caption|Selecting Tie to Entity from the Tools menu.]]{{clr}}
[[File:l4d_hammer_tie_to_entity.jpg|thumb|left|300px|caption|Selecting Tie to Entity from the Tools menu.]]{{clr}}


The default '''Class''' for a brush entity is <code>func_detail</code>.
The default '''Class''' for a brush entity is <code>func_detail</code>.


[[Image:l4d_hammer_func_detail_01.jpg|thumb|left|500px|caption|Creating a brush entity with the default Class.]]{{clr}}
[[File:l4d_hammer_func_detail_01.jpg|thumb|left|500px|caption|Creating a brush entity with the default Class.]]{{clr}}


If you see something else under the '''Class''' drop-down menu, you will need to change a setting in '''Tools > Options > Game Configurations''' tab.
If you see something else under the '''Class''' drop-down menu, you will need to change a setting in '''Tools > Options > Game Configurations''' tab.
Line 46: Line 49:
Make sure the '''Default SolidEntity Class''' field is set to "<code>func_detail</code>".
Make sure the '''Default SolidEntity Class''' field is set to "<code>func_detail</code>".


[[Image:l4d_hammer_options_class.jpg|thumb|left|500px|caption|Setting func_detail as the Default SolidEntity Class.]]{{clr}}
[[File:l4d_hammer_options_class.jpg|thumb|left|500px|caption|Setting func_detail as the Default SolidEntity Class.]]{{clr}}


That's it. You're done! You just created a brush that will not cut up the BSP into more leafs.
That's it. You're done! You just created a brush that will not cut up the BSP into more leafs.
Line 71: Line 74:
{{note|Remember that your level has to be completely enclosed to compile correctly and to make use of the visibility work the engine does. Therefore, no brush that seals the level should be a <code>func_detail.</code> This will create a [[leak]] to the outside.}}
{{note|Remember that your level has to be completely enclosed to compile correctly and to make use of the visibility work the engine does. Therefore, no brush that seals the level should be a <code>func_detail.</code> This will create a [[leak]] to the outside.}}


{{NavBar|:L4D Level Design/Ladders|L4D Level Design Basics Tutorial|L4D Level Design/Nav Meshes}}
{{NavBar|L4D Level Design/Ladders|L4D Level Design Basics Tutorial|L4D Level Design/Nav Meshes}}
 
[[Category:Left 4 Dead]]
[[Category:Left 4 Dead]]
[[Category:Left 4 Dead 2]]
[[Category:Level Design]]
[[Category:Level Design]]

Latest revision as of 07:46, 12 July 2024

English (en)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)


Visibility basics

The file extension for the maps that are compiled is .bsp. BSP stands for Binary Space Partitioning. Basically, the game engine only needs to draw areas of the level that are visible from where the player is standing. This helps with the performance of the level (how fast the frame rate is). To do this, the engine cuts up the level into chunks called leafs. If the player is standing in a leaf that sees into another leaf, then that leaf is drawn. Regular (non-entity) brushes determine where the leaf cuts get made. Brush entities, such as the func_ladder that we created in the previous section, do not affect where cuts are made.

So why would you not want brushes to cut up the level into more leafs? If you have more brushes that cut up the level, the engine has to do more work to calculate visibility and more cuts in the map also mean a higher number of faces to draw.

Any brush that you create that will not block visibility effectively should be a brush entity called a func_detail. These func_detail brushes are still solid in the world, but are ignored for visibility calculations.

  • This is a very basic explanation of the game engine's visibility system. For information on BSP and visibility drawing in greater detail, see Visibility optimization.

Create tutorial03.vmf

In Hammer, open the map file tutorial02.vmf that you created in the previous tutorial if it's not already open. This should be located in the tutorial mapsrc folder, by default:

C:\Program Files\Steam\steamapps\common\left 4 dead\sdk_content\mapsrc\

Now we'll make a new version to work with:

  • Go to File menu and choose Save As...
  • Change the name to tutorial03.vmf.

Creating a Platform

Sticking with our level called tutorial02, let's create a platform that extends the upper floor where we created our ladder.

Using the Hammer select.png Selection tool, duplicate the back wall brush that we extended out to create the upper story in the last tutorial by Shift-dragging it. Reshape it to be a platform that extends out from the upper story on one side.

It should be 368 units wide, 176 units long, and 16 units deep.

Duplicating a wall brush to make a platform.

Feel free to re-texture the bottom of the platform so that it matches the ceiling and floor.

Texturing the bottom of the platform.

Now, go to the Tools menu and choose Tie to Entity. You can also use the Ctrl+T keyboard shortcut.

Selecting Tie to Entity from the Tools menu.

The default Class for a brush entity is func_detail.

Creating a brush entity with the default Class.

If you see something else under the Class drop-down menu, you will need to change a setting in Tools > Options > Game Configurations tab.

Make sure the Default SolidEntity Class field is set to "func_detail".

Setting func_detail as the Default SolidEntity Class.

That's it. You're done! You just created a brush that will not cut up the BSP into more leafs.

Run the map

Press F9 to open the Run Map dialog and click on the OK Button to compile the map and run it in the game.

Note.pngNote:As before, ignore the "Map is unplayable!" error box and just press Continue to see your map.

Good candidates for func_detail brushes

So how do you know to make a brush a func_detail or not?

Details such as:

  • Columns and beams
  • Trim
  • Frames
  • Small platforms
  • Posts
  • Furniture
  • Trusses
Note.pngNote:Remember that your level has to be completely enclosed to compile correctly and to make use of the visibility work the engine does. Therefore, no brush that seals the level should be a func_detail. This will create a leak to the outside.