Assault: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Temporarely removed excess entity information.)
(Structured up the article. Does this look alright?)
Line 1: Line 1:
An assault consists of two or three component types:
The purpose of an assault is to make one or more NPC(s) tactically advance along a predesigned route, securing tactical points along the way. It is much more flexible than a [[path_corner]] entity.
 
An assault consists of two or three component entities:


* [[ai_goal_assault]] (1 per assault, optional)
* [[ai_goal_assault]] (1 per assault, optional)
Line 5: Line 7:
* [[assault_assaultpoint]] (any number)
* [[assault_assaultpoint]] (any number)


Its purpose is to make a NPC follow a predesigned route. In this regard it is quite similar to '''[[path_corner]]''': the differences revolve around assaults being designed for combat situations and increased flexibility. This article will detail how to use them.
This article will show you the overall picture on how to set up an assault. (For entity specific information, see the related entity.)
 


==Structure==
==Structure==
<center>[[Image:Assault_diagram.png]]</center>


An assault consists of a rally point followed by a string of consecutive assault points. An assault point must be 'cleared' before continuing: clearing a point by default consists of standing on it and ensuring there are no hostiles in sight for the timeout period, but is completely configurable.
An assault consists of a an AI goal (the [[ai_goal_assault]] entity) gathering a set of one or more NPCs (called ''actor(s)'') to one or more "rally point" locations ([[assault_rallypoint]] entities) where they will normally await a cue to commence the assault. On this cue, they will proceed to the first "assault point" location ([[assault_assaultpoint]] entity) to secure, or 'clear', clear it, and then proceed on to the next assault point (if any), clear it, and then proceed to the next, and so on.
Clearing an assault point, by default, consists of standing on its location and ensuring that there are no hostiles in sight for the timeout period, but this is completely configurable.


Assaults can be triggered in one of three ways:
<center>[[Image:Assault_diagram.png]]</center>
 
# An '''ai_goal_assault''' entity is activated by an '''Activate''' input, sending the '''Actor(s)''' to the associated '''assault_rallypoint(s)''', where they wait for the '''Assault Cue'''. This is the most common usage.
# An '''ai_goal_assault''' entity is configured to Start Active, which causes the Assault to begin (as in method 1 above) as soon as the map is loaded.
# Combine Soldiers may be instantly associated with an '''assault_rallypoint''' without the use of an '''ai_goal_assault''' entity. Using the entity [[Inputs and Outputs|I/O system]], you can fire the '''Assault''' input on the the Soldier. You must provide the name of an '''assault_rallypoint''' as an input parameter. Combine Soldiers told to Assault in this manner will run to the specified '''assault_rallypoint''' and then proceed immediately to the associated '''assault_assaultpoint'''. '''NOTE:''' This feature is only supported for Combine Soldiers.
 
 
==Entities==
 
We're temporarily moving all these entities to separate pages today, before shortening the page to only be about the big picture and entity interaction.
 
[[ai_goal_assault]] - See link for information. (Already moved.)
 
----
 
===NPC===
NPCs can handle their own assaults.
 
====Inputs====
'''Assault''' (Combine Soldier only) When a Combine Soldier receives this input, it will search for the specified [[assault_rallypoint]] entity and move to it. You must supply the name of an ''assault_rallypoint'' entity as a parameter with this input. You may use wildcards. You may also use the ''priority'' keyvalue of an ''assault_rallypoint'' entity to influence this decision if providing a wildcard which specifies more than one ''assault_rallypoint'' entity.


----
Assaults can be triggered in one of two ways:


* [[assault_rallypoint]] - All assaults begin at a rallypoint. (Moved too.)
# When activated, an '''ai_goal_assault''' entity can send its ''actor(s)'' to the associated ''assault_rallypoint(s)'', where they wait for the assault cue. This is the most common usage. The ''ai_goal_assault'' entity can either be activated by an ''Activate'' input, or set to start active through its ''Start Active'' keyvalue, which causes the assault to begin as soon as the map is loaded.
* [[assault_assaultpoint]] - The body of an assault chain. (Moved.)
# [[npc_combine_s|Combine soldiers]] may be instantly associated with a rally point without the use of an ''ai_goal_assault'' entity. Using the entity [[Inputs and Outputs|I/O system]], you can fire the '''Assault''' input on the soldier, providing the name of the ''assault_rallypoint'' as an input parameter. When a Combine soldier receives this input, it will search for the specified [[assault_rallypoint]] entity, move to it, and then proceed immediately to the associated ''assault_assaultpoint''. Please note that although the ''Assault'' input can be sent to any NPC ''it is only ''supported'' for Combine soldiers''. You may use wildcards when specifying the rally point in the parameter. You may also use the ''priority'' keyvalue of an ''assault_rallypoint'' entity as a parameter to influence this decision, if providing a wildcard which specifies more than one ''assault_rallypoint'' entity.




==Limitations and bugs==
==Limitations and bugs==
* When moving to an assaultpoint part way through a chain, the NPC will go to the standing posture for a moment before continuing. This looks unnatural.
* When moving to an assault point partway through a chain, the NPC will go to the standing posture for a moment before continuing. This looks unnatural.


* NPCs will always arrive at a rally or assault point and turn to face in the direction the entity is set to. This is again unnatural in some cases.
* NPCs will always arrive at a rally or assault point and turn to face in the direction the entity is set to. This is again unnatural in some cases.

Revision as of 09:06, 9 April 2006

The purpose of an assault is to make one or more NPC(s) tactically advance along a predesigned route, securing tactical points along the way. It is much more flexible than a path_corner entity.

An assault consists of two or three component entities:

This article will show you the overall picture on how to set up an assault. (For entity specific information, see the related entity.)


Structure

An assault consists of a an AI goal (the ai_goal_assault entity) gathering a set of one or more NPCs (called actor(s)) to one or more "rally point" locations (assault_rallypoint entities) where they will normally await a cue to commence the assault. On this cue, they will proceed to the first "assault point" location (assault_assaultpoint entity) to secure, or 'clear', clear it, and then proceed on to the next assault point (if any), clear it, and then proceed to the next, and so on. Clearing an assault point, by default, consists of standing on its location and ensuring that there are no hostiles in sight for the timeout period, but this is completely configurable.

Assault diagram.png

Assaults can be triggered in one of two ways:

  1. When activated, an ai_goal_assault entity can send its actor(s) to the associated assault_rallypoint(s), where they wait for the assault cue. This is the most common usage. The ai_goal_assault entity can either be activated by an Activate input, or set to start active through its Start Active keyvalue, which causes the assault to begin as soon as the map is loaded.
  2. Combine soldiers may be instantly associated with a rally point without the use of an ai_goal_assault entity. Using the entity I/O system, you can fire the Assault input on the soldier, providing the name of the assault_rallypoint as an input parameter. When a Combine soldier receives this input, it will search for the specified assault_rallypoint entity, move to it, and then proceed immediately to the associated assault_assaultpoint. Please note that although the Assault input can be sent to any NPC it is only supported for Combine soldiers. You may use wildcards when specifying the rally point in the parameter. You may also use the priority keyvalue of an assault_rallypoint entity as a parameter to influence this decision, if providing a wildcard which specifies more than one assault_rallypoint entity.


Limitations and bugs

  • When moving to an assault point partway through a chain, the NPC will go to the standing posture for a moment before continuing. This looks unnatural.
  • NPCs will always arrive at a rally or assault point and turn to face in the direction the entity is set to. This is again unnatural in some cases.
  • NPCs must stand directly on an assaultpoint to clear it without timeout if Clear on contact with enemies is not set and triggered. This can result in illogical backtracking and means that groups of NPCs moving together each need their own assaultpoint to maintain the illusion.
  • A rallypoint can only serve one NPC per assault. If multiple NPCs are required to assault at the same time, each needs their own rallypoint. There may be a solution to this but it is not yet documented. Use of wildcards can make the assignment of individual NPCs to individual rallypoints easier.
  • Linking an assaultpoint to a rallypoint crashes the game.

Example

This example map contains a single NPC on a linear chain using all the major options available to designers when moving NPCs from assaultpoint to assaultpoint. There are four points, and each is configured differently:

  1. Clear on contact with enemies is enabled. When the NPC sees the hostiles, it clears out the assaultpoint and continues to 2.
  2. Clear this point on arrival, UNCONDITIONALLY is flagged. When the NPC reaches this point it clears it regardless of the fact that there are still hostiles in sight and begins to move towards 3.
  3. Allow diversion is set to No. The NPC will charge towards the assaultpoint without stopping or giving chase. It will however attack enemies in view.
  4. Allow diversion is set to Yes. The NPC will divert from moving to this point until there are no hostiles visible.

Note that the Metropolice cannot harm the NPC and will not attack the player in this example.

Download Example (VMF)