求生之路2关卡设计/长途救援结局(Gauntlet 终局)

来自Valve Developer Community
跳转至: 导航搜索
English (en)中文 (zh)
编辑

本简体中文页面由大康翻译。更新于2022年4月17日。


Icon-broom.png
本文需要更新以包含有关该主题的当前信息。
记得在本文的讨论页上查看标记者留下的任何注释。

小作品

这篇文章是一个小作品,您可以帮助我们完善它。

求生之路2 求生之路2 在《教区》战役中引入了长途救援终局。该结局要求玩家逃到关卡的尽头,而救援车辆已经在等待他们,而不是让玩家在封闭的区域中待命。在教区中,玩家必须穿过一座桥才能到达救援直升机。

你可能希望遵循本文基于 c5m5_bridge.vmf 的反编译地图

概述

本结局(长途救援结局)主要由标准结局组成,并进行了一些新的添加和修改:

  • trigger_finale 使用“Gauntlet”作为结局类型(Finale Type)设置。
  • 一个 info_target,在地图末端靠近救援车辆的地方命名为“nav_flow_target”,但不在标有 RESCUE_VEHICLE 的导航网格上。否则它将被阻止并且不会生成导航流。
  • 通常没有救援房间,但如果添加了救援房间,则应该可以使用。如果在到达终局区域之前发生了战斗,请考虑添加一个。
  • 默认情况下,结局取决于 director_gauntlet.nuc 脚本,即使没有设置“脚本文件”字段。
    Note.png注意:在“脚本文件”(Script File) 字段中定义不同的脚本将首先运行默认的 director_gauntlet,然后它将运行你定义的任何脚本。

长途救援结局结构不是很灵活,应考虑解决方法。在准备逃生车辆之前,只允许生成一只 Tank。"director_debug 1"显示,在 trigger_finale 第二次触发 GauntletStopPanic 时,它被认为是一个转义序列。

director_gauntlet.nuc

这是原始的 Gauntlet Finale 脚本,如果你想根据自己的目的对其进行调整。

Msg("Initiating Gauntlet\n");

DirectorOptions <-
{
	PanicForever = true
	PausePanicWhenRelaxing = true

	IntensityRelaxThreshold = 0.99
	RelaxMinInterval = 25
	RelaxMaxInterval = 35
	RelaxMaxFlowTravel = 400

	LockTempo = 0
	SpecialRespawnInterval = 20
	PreTankMobMax = 20
	ZombieSpawnRange = 3000
	ZombieSpawnInFog = true

	MobSpawnSize = 5
	CommonLimit = 5

	GauntletMovementThreshold = 500.0
	GauntletMovementTimerLength = 5.0
	GauntletMovementBonus = 2.0
	GauntletMovementBonusMax = 30.0

	// 测试进度的桥梁长度。
	BridgeSpan = 20000

	MobSpawnMinTime = 5
	MobSpawnMaxTime = 5

	MobSpawnSizeMin = 5
	MobSpawnSizeMax = 20

	minSpeed = 50
	maxSpeed = 200

	speedPenaltyZAdds = 15

	CommonLimitMax = 30

	function RecalculateLimits()
	{
	// 根据进度增加共同限制
	    local progressPct = ( Director.GetFurthestSurvivorFlow() / BridgeSpan )
	    
	    if ( progressPct < 0.0 ) progressPct = 0.0;
	    if ( progressPct > 1.0 ) progressPct = 1.0;
	    
	    MobSpawnSize = MobSpawnSizeMin + progressPct * ( MobSpawnSizeMax - MobSpawnSizeMin )


	// 根据速度增加共同限制   
	    local speedPct = ( Director.GetAveragedSurvivorSpeed() - minSpeed ) / ( maxSpeed - minSpeed );

	    if ( speedPct < 0.0 ) speedPct = 0.0;
	    if ( speedPct > 1.0 ) speedPct = 1.0;

	    MobSpawnSize = MobSpawnSize + speedPct * ( speedPenaltyZAdds );
	    
	    CommonLimit = MobSpawnSize * 1.5
	    
	    if ( CommonLimit > CommonLimitMax ) CommonLimit = CommonLimitMax;
	    

	}
}

function Update()
{
	DirectorOptions.RecalculateLimits();
}

提示

Bridge Span Value (大桥跨度值)

该脚本有一个“BridgeSpan”设置,用于确定 Gauntlet 区域的长度,以便计算对抗游戏的进度。
此值以 Hammer 单位为单位,只需在 trigger_finale 一侧创建一个固实体,而另一侧是救援车辆所在的位置,就可以轻松地在 Hammer 中获取该值。
如下图所示,这个画笔实体的宽度为 20096.0 个单位。所以脚本设置为 20000 单位以使数字四舍五入。

Gauntlet bridge span helper.png

另请参阅

求生之路2关卡设计


Icon-broom.png
本文需要更新以包含有关该主题的当前信息。
记得在本文的讨论页上查看标记者留下的任何注释。

小作品

这篇文章是一个小作品,您可以帮助我们完善它。

求生之路2 Gauntlet Finales were introduced in The Parish campaign. Rather than having the player holdout in an enclosed arena, gauntlets force players to run to the end of the level, where the rescue vehicle is already waiting for them. In The Parish, the players must run across a bridge to make it to a rescue helicopter.

You may wish to follow along with the decompiled map this article is based off of, c5m5_bridge.vmf.

Overview

A gauntlet mainly consists of standard finale components with a few new additions and modifications:

  • The trigger_finale uses "Gauntlet" as Finale Type setting.
  • A info_target, named "nav_flow_target" at the end of the map close to the rescue vehicle, but not on navmesh marked with Rescue_Vehicle. Else it will be blocked and Nav Flow won't generate.
  • Rescue closets are usually absent but should work if they are added. Consider adding one if there is combat before reaching the finale area.
  • Finales depend on director_gauntlet.nuc vscript by default, even without setting the "Script File" field.
Note.png注意:Defining a different script in the "Script File" field will first run the default director_gauntlet and second it will launch whatever script you defined.

The gauntlet finale structure is not very flexible and workarounds should be taken into consideration. Only one tank is allowed before the escape vehicle is ready. director_debug 1 shows that it is considered an escape sequence by the second time GauntletStopPanic is fired at trigger_finale.

director_gauntlet.nuc

This here is the original Gauntlet Finale script, should you want to tweak it for your own purposes.

Msg("Initiating Gauntlet\n");

DirectorOptions <-
{
	PanicForever = true
	PausePanicWhenRelaxing = true

	IntensityRelaxThreshold = 0.99
	RelaxMinInterval = 25
	RelaxMaxInterval = 35
	RelaxMaxFlowTravel = 400

	LockTempo = 0
	SpecialRespawnInterval = 20
	PreTankMobMax = 20
	ZombieSpawnRange = 3000
	ZombieSpawnInFog = true

	MobSpawnSize = 5
	CommonLimit = 5

	GauntletMovementThreshold = 500.0
	GauntletMovementTimerLength = 5.0
	GauntletMovementBonus = 2.0
	GauntletMovementBonusMax = 30.0

	// length of bridge to test progress against.
	BridgeSpan = 20000

	MobSpawnMinTime = 5
	MobSpawnMaxTime = 5

	MobSpawnSizeMin = 5
	MobSpawnSizeMax = 20

	minSpeed = 50
	maxSpeed = 200

	speedPenaltyZAdds = 15

	CommonLimitMax = 30

	function RecalculateLimits()
	{
	//Increase common limit based on progress  
	    local progressPct = ( Director.GetFurthestSurvivorFlow() / BridgeSpan )
	    
	    if ( progressPct < 0.0 ) progressPct = 0.0;
	    if ( progressPct > 1.0 ) progressPct = 1.0;
	    
	    MobSpawnSize = MobSpawnSizeMin + progressPct * ( MobSpawnSizeMax - MobSpawnSizeMin )


	//Increase common limit based on speed   
	    local speedPct = ( Director.GetAveragedSurvivorSpeed() - minSpeed ) / ( maxSpeed - minSpeed );

	    if ( speedPct < 0.0 ) speedPct = 0.0;
	    if ( speedPct > 1.0 ) speedPct = 1.0;

	    MobSpawnSize = MobSpawnSize + speedPct * ( speedPenaltyZAdds );
	    
	    CommonLimit = MobSpawnSize * 1.5
	    
	    if ( CommonLimit > CommonLimitMax ) CommonLimit = CommonLimitMax;
	    

	}
}

function Update()
{
	DirectorOptions.RecalculateLimits();
}

Tips

Bridge Span Value

The script has a "BridgeSpan" Setting which determines how long the Gauntlet area will be, which is used to calculate progression in Versus.
This Value is in units, which can easily be taken in Hammer by just creating a brush entity with one side at the trigger_finale while the other is where the rescue vehicle will be.
As seen in the picture below, this brush entity will be 20096.0 units wide. So the script is set to 20000 units to make the numbers round.

Gauntlet bridge span helper.png

See also

L4D2 Level Design