L4D Level Design/Visibility/ru

From Valve Developer Community
Jump to: navigation, search
Underlinked - Logo.png
This article needs more links to other articles to help integrate it into the encyclopedia. Please help improve this article by adding links that are relevant to the context within the existing text.
January 2024

Visibility basics

Файл компилируемых карт имеет расширение .bsp. BSP является аббревиатурой Binary Space Partitioning. Строго говоря, игровой движок должен отрисовать только те области игрового уровня, которые видны из точки, в которой находится игрок. Это улучшает производительность в уровне (т.е. влияет на то, насколько быстро происходит смена кадров). Чтобы этого добиться, движок делит уровень на порции, называемые leafs (листья). Если игрок находится в листе из котрого виден следующий дист, тогда тот лист также отрисовывается. Постоянные (не сущностные) браши определяют, где лист будет разрезаться. Браши сущностей, такие как func_ladder, которые мы создавали в предыдущей секции, не влияют на порядок разрезания уровня.

Так почему бы не сделать браши для разрезания уровня на большое количество листов? Если будет много брашей, режущих уровень на листы видимости, движок вынужден будет делать больше работы при вычислении видимости большего количества деталей для прорисовки.

Любой созданный Вами браш, которые не должен блокировать видимость, должен быть сущностным брашем (func_detail). Эти func_detail браши являются уже твердыми телами в мире, но игнорируются при вычислении области видимости.

  • Это довольно общее представление системы визуализации в игровом движке. Для более подробной информации об BSP и графической визуализации смотрите Visibility optimization.

Создайте tutorial03.vmf

В первую очередь нам нужно создать новую версию карты, что мы использовали в предыдущем разделе.

Откройте файл карты tutorial01.vmf который вы создали ранее в Hammer (если он еще не открыт). Он расположен в папке mapsrc, по умолчанию:

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

Итак мы сделаем новую рабочую версию и скомпилируем ее:

  • Для этого проходим в меню File и выбираем Save As...
  • Меняем имя на 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.pngПримечание: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.pngПримечание: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.