求生之路2关卡设计/清道夫地图

来自Valve Developer Community
跳转至: 导航搜索
English (en)Русский (ru)中文 (zh)
编辑

本页面由大康翻译,翻译最后更新于2021年9月11日。此页面的原文最后是2017年更新的。


无论你是在现有地图中添加"清道夫模式"支持还是在制作仅限清道夫模式的地图,你都需要包括以下每个元素:

  1. 一个安全的开始区域
  2. 具有计分点和状态指示的浇注点的发电机(或其他耗油设备)
  3. 将清道夫的油桶、武器和物品放置在地图中
  4. 具有清道夫输出的 info_director 实体

让我们更详细地介绍:

开始区域

生还者开始位置

幸存者开始在 info_survivor_position 实体指示的位置进行清道夫匹配,因此你需要放置 4 个 info_survivor_position 实体,并在游戏模式(Game Mode)键值中指定scavenge

func_nav_attribute_region 的区域

开始区域需要在地图导航网格中表示,它保存在 .NAV 文件。最简单的方法是在 .VMF 放置一个 func_nav_attribute_region 笔刷实体。这将在分析时将适当的 CHECKPOINT 属性应用于导航网格。你需要确保你的导航网格被细分得足够好,以便它能准确地反映这个区域的边界。

边界标记

接下来,你需要在每一轮开始时设置生还者能够看到的可见边界标记。首先创建一个覆盖开始区域的实体,指定它为无绘制材质(nodraw),并让它空置:Tools > Make Hollow。这让固体的数量变成了六个。之后删去顶部和底部的固体,留下四堵矮墙。

在四个内表面上,应用"effects/scavenge_boundary"材质。边界现在应该是可见的,但我们也需要使它非固体。选择 4 个边边界画笔并使它们成为 func_brush 实体。

在属性下,将 Solidity 设置为“Never Solid”。这指定它们不会影响游戏中的碰撞。因为我们需要在回合开始时删除边界,所以我们需要给它一个目标名称。 Valve 的地图的标准(目标名称)是“brush_scavenge_boundary

现在唯一剩下的就是添加一个 info_game_event_proxy 设置来生成一个名为“explain_scavenge_leave_area”的提示。

发电机

发电机的例子

接下来,让我们放置发电机及其相关逻辑。

新的实例功能使得这变得非常简单。只需创建一个新的 func_instance 实体并将其指向

Steam\steamapps\common\left 4 dead 2\sdk_content\mapsrc\instance\scavenge_generator.vmf

你可以在求生之路2的创作工具中找到,包含一个功能齐全的发电机,包括发光的浇注目标,以及根据剩余时间闪烁绿色、黄色和红色的灯。


当然,它不一定是在一个实例中,你可以根据需要复制和粘贴或制作预制件。


油桶、武器和物品

L4D2 scavenge 4.png

标准的清道夫地图有 16 个油桶散布在地图周围。你可以通过放置 weapon_scavenge_item_spawn 实体来指定这些位置。

清道夫地图的标准是每个回合的武器和物品都一致,所以最好用特定的武器实体生成武器。如果你的地图支持其他游戏模式,你将需要使用 point_template 生成你的清道夫武器和物品,当 info_gamemode 实体检测到地图已在清道夫模式下启动时,通过输出,就会激活该 point_template

同时,用于其他游戏模式的任何 weapon_spawnweapon_item_spawn 可能无法正常工作。最好在使用info_gamemode在清道夫模式中加载地图时杀死它们。

info_director

最后一点是从 info_director 添加一些输出。

info_director的输出

由于地图中只有一个导演实体,而其他游戏模式依赖于它,因此你可能需要放入主 .VMF 中,而不是清道夫实例中。

回合开始的相机

L4D2 scavenge 5.png

一个不错的方法是在回合开始时添加一个移动的相机。这可以通过创建几个 point_viewcontrol_multiplayer 实体并将它们与 env_fade 协调来完成。查看示例地图:

Steam\steamapps\common\left 4 dead 2\sdk_content\DeadLine2\mapsrc\l4d_deadline02_scavenge.vmf


测试清道夫模式地图

要在清道夫模式下加载地图,请使用以下控制台命令:

mp_gamemode scavenge (在 L4D2 中没有效果)
map <你的 .BSP 地图文件名称> scavenge (这是正确的用法)

这是一个有用的快捷方式,可以避免每次都必须浏览主菜单,或者如果你尚未设置加载项。你可以类似地将游戏模式更改为“coop”、“versus”和“survival”,如果你正在测试具有多游戏模式支持的地图。

在正常游戏过程中,如果没有足够的人类玩家,清道夫服务器将在短时间内关闭。当你开发和测试你的清道夫地图时,你需要使用控制台禁用它:

sv_cheats 1
sb_all_bot_game 1(原文为 sb_all_bot_team 1)
jointeam infected
z_spawn charger

如果团队只有机器人,sb_all_bot_team可防止超时发生。

如果你正在大厅中测试你的地图,并且想开始只有一个玩家的游戏,请使用以下命令:

ui_lobby_start_enabled 1
证实:似乎没有效果,或不存在该指令。可能需要通过特殊手段执行。

即使只有一个人类玩家,这也会启用多人游戏大厅(清道夫模式和对抗模式)中的“开始游戏”按钮。

Note.png注意:测试你的导航网格!尽管机器人无法得分,但重要的是它们能够到达人类玩家可以到达的任何位置。



Whether you are adding Scavenge support to an existing map or making a scavenge-only map, you will need to include each of the following elements:


  1. A "safe" starting area
  1. A generator (or other fuel-consuming device) with a pour spot for scoring points and a status indication
  1. Scavenge gas cans, weapons, and items placed throughout your map
  1. An info_director entity with scavenge outputs

Let's cover each in greater detail:

Starting area

Survivor start positions

Survivors begin scavenge matches at positions indicated by the info_survivor_position entity, so you'll need to place 4 of them and specify scavenge in the Game Mode entry.

The func_nav_attribute_region volume

The starting area needs to be represented in your maps nav mesh, which is saved in the .NAV file. The easiest way to do this is placing a func_nav_attribute_region volume entity in your .VMF. This will apply the proper checkpoint attribute to the nav mesh when it is analyzed. You will want to make sure that your nav mesh is subdivided well enough so that it can accurately reflect the boundary of this volume.

Boundary marker

Next, you'll need to place the visible boundary marker which survivors see at the start of each round. Start by making a solid that covers the starting region, assign it the no draw material, and make it hollow Tools > Make Hollow. This turns the solid into six. Now delete the top and bottom, leaving four short walls.

On the four inside surfaces, apply the material "effects/scavenge_boundary". The boundary should now be visible, but we need to make it non-solid as well. Select the 4 side boundary brushes and make them a func_brush entity.

Under properties, set solidity to "Never Solid". This specifies that they are not to affect collision in game. Since we need to delete the boundary when the match starts, we'll need to give it a target name. The standard for Valve maps is "brush_scavenge_boundary"

The only thing left for now is to add an info_game_event_proxy set to generate an event named "explain_scavenge_leave_area".

Generator

The generator instance

Next, let's place the generator and it's associated logic.

The new instance functionality makes this very easy. Simply create a new func_instance and point it to

Steam\steamapps\common\left 4 dead 2\sdk_content\mapsrc\instance\scavenge_generator.vmf

This is included in the L4D2 authoring tools and contains a fully functional generator including a glowing pour target, as well as lights that blink green, yellow and red based on the time remaining.


Of course, it need not be in an instance, you can copy and paste or make a prefab should you desire.


Cans and weapons and items

L4D2 scavenge 4.png

The standard scavenge level has 16 cans scattered around the arena. You can specify these locations by placing weapon_scavenge_item_spawn entities.

The standard for scavenge maps is to have weapons and items be consistent each time, so it's best to use specific weapon spawning entities when placing them. If your map supports other gamemodes, you'll want to spawn your scavenge weapons and items using a point_template which is activated by the info_gamemode entity when it detects that the map has been launched in scavenge mode.

At the same time, any weapon_spawn and weapon_item_spawn that are there for other gamemodes may not work properly. It's best to have them killed whenever a map loads in Scavenge using info_gamemode.

info_director

The last bit is to add some outputs from the info_director.

info_director outputs
Since there is only one in the map, and other gamemodes rely on it, you may need to be put in the main .VMF, not the scavenge instance.


Round start camera

L4D2 scavenge 5.png

A nice touch is to add a moving camera when the round starts. This can be done by creating a couple of point_viewcontrol_multiplayer entities and coordinating them with env_fade. See the example map:

Steam\steamapps\common\left 4 dead 2\sdk_content\DeadLine2\mapsrc\l4d_deadline02_scavenge.vmf


Testing scavenge mode

To load up a map in Scavenge mode, use the following console commands:

mp_gamemode scavenge (Does not function in l4d2)
map <your .BSP map filename> scavenge (This is the right usage)

This is a useful shortcut to avoid having to go through the main menu every time or if you haven't yet set up your add-on. You can similarly change the gamemode to "coop", "versus", and "survival", if you're testing a map with multi-gamemode support.

During normal play, a Scavenge server will shut down after a short time if there are not enough human players. When you are developing and testing your Scavenge maps, you'll need to disable this using the console:

sv_cheats 1
sb_all_bot_team 1
jointeam infected
z_spawn charger

The sb_all_bot_team prevents the timeout from happening if there is a team with only bots.

If you are testing your map from the lobby, and want to start a game with only one player, use this command:

ui_lobby_start_enabled 1

This enables the 'Start Game' button in multiplayer game lobbies (Scavenge and Versus) even if there is only one human player.

Note.png注意: Test your nav-mesh! Although bots cannot score points, it's important that they be able to reach any spot that human players can.