Difference between revisions of "Dynamic assaults"

From Valve Developer Community
Jump to: navigation, search
(This should be fairly helpfull. :))
 
(Rewrote the entire article.)
Line 1: Line 1:
'Dynamic Assaults' are pretty much just improved usage of the squad AI. They're simply made by setting all npc's on the same team, to the same sqaud name. Eg. All combine soldiers, striders, scanners, metrocops, etc. should have the squad name 'cops'.
+
Setting up an [[assault]] using assault entities ([[ai_goal_assault]], etc.) can be tedious and complicated, and the result is a rigid system which cripples much of the NPC AI. If the purpose of the assault is simply to attack natural enemies (like the player), setting up assault entities is often totally unnecessary. Here is how to set up an assault that relies only on the built in AI for teamwork:
  
Now when any of the 'cops' spot an enemy, they'll all know the location, and all rush towards the enemy, as long as the path is accessable via the nodegraph.
+
The key to this system is that NPCs with the same ''squadname'' keyvalue will share information about enemies, and support eachother. (Especially [[combine]]s can share this tactical information with groups in different locations, using their radio sets.) Once a member of a squad spots an enemy, all members of that squad will be called in for backup (as long as the path to the enemy is accessable via the [[nodegraph]]), moving towards the last known position of the enemy without any need for [[assault_assaultpoint]]s or [[assault_rallypoint]]s. Just make sure that the nodegraph is good and valid.
Unlike, ai_assaults, these system allows the npc's to pick a path, without requiring huge effort from the mapper.
 
  
== Setting up a 'Dynamic' Asssault ==
 
They is easy. Simply place a bunch of npc's around the map, then set the sqaud keyvalue to eg. 'cops' for combines. This works best in larger non-linear maps, but has proven to work in linear too.
 
And don't forget to place a good valid nodegraph.
 
Once they spot the player, they'll all assault him, by moving to the last known posistion of his. Then, if someone else sees him another place, they'll all move there.
 
  
== Bugs ==
 
If this system should work perfect, it requires at least one npc, in the squad, to be alive all the time. This can be done by placing a metrocop, or a simple npc, in an offworld location.
 
  
== Moving forward ==
+
== Additional Waves ==
You can improve the dynamic of this system in many ways, here's a few suggestions.
 
  
* Place a few combine cameras around the map, and include them in the sqaud.
+
You can control these backup waves in two ways:
* Place a fair ammount of scanners / manhacks, and include them in the sqaud.
+
 
* Use npc_enemyfindes, by simply setting their fov to -1 and include put them into the squad.
+
The natural way is through simply placing additional groups of squad members further away on the map. These additional groups will result in wave after wave of attacks. The drawback of this system is that it will involve moving and coordinating a large amount of NPCs at once, which will cost computer resources, and that the attackers can amass a force that over time will threaten the game balance.
* Make a few ways around your map, and surprise the player at every replay.
+
 
* Use npc_makers, to spawn new npcs as the player moves around, and/or kills other npc's.
+
The other way is through spawning new NPCs using [[npc_maker]]s, giving its ''NPCSquadname'' keyvalue the same name as the squad. To prevent the assault from stopping if all the spawned members are killed before the new members are spawned (in which case the squad will lose memory of the enemy {{todo|This will need confirmation.}}), you will need to create an [[npc_enemyfinder]] in the squad, to keep it alive even if all its other members die.
 +
 
 +
 
 +
== Improving this system ==
 +
 
 +
You can improve the dynamic of this system in many ways, here are some suggestions:
 +
 
 +
* The combine can use [[npc_combine_camera|cameras]], [[npc_cscanner|scanners]] and/or [[npc_manhack|manhacks]] in order to find the player. (Just include them into the squad.) If they are not at your disposal, you can also cheat by including [[npc_enemyfinder]]s into the squad. By setting their ''FieldOfView'' keyvalue to ''-1'', they will look in all directions.
 +
 
 +
* Make a few ways around your map, to surprise the player at every replay.
 +
 
 +
 
 +
[[Category: Tutorials]]

Revision as of 15:26, 11 September 2007

Setting up an assault using assault entities (ai_goal_assault, etc.) can be tedious and complicated, and the result is a rigid system which cripples much of the NPC AI. If the purpose of the assault is simply to attack natural enemies (like the player), setting up assault entities is often totally unnecessary. Here is how to set up an assault that relies only on the built in AI for teamwork:

The key to this system is that NPCs with the same squadname keyvalue will share information about enemies, and support eachother. (Especially combines can share this tactical information with groups in different locations, using their radio sets.) Once a member of a squad spots an enemy, all members of that squad will be called in for backup (as long as the path to the enemy is accessable via the nodegraph), moving towards the last known position of the enemy without any need for assault_assaultpoints or assault_rallypoints. Just make sure that the nodegraph is good and valid.


Additional Waves

You can control these backup waves in two ways:

The natural way is through simply placing additional groups of squad members further away on the map. These additional groups will result in wave after wave of attacks. The drawback of this system is that it will involve moving and coordinating a large amount of NPCs at once, which will cost computer resources, and that the attackers can amass a force that over time will threaten the game balance.

The other way is through spawning new NPCs using npc_makers, giving its NPCSquadname keyvalue the same name as the squad. To prevent the assault from stopping if all the spawned members are killed before the new members are spawned (in which case the squad will lose memory of the enemy To do: This will need confirmation.), you will need to create an npc_enemyfinder in the squad, to keep it alive even if all its other members die.


Improving this system

You can improve the dynamic of this system in many ways, here are some suggestions:

  • The combine can use cameras, scanners and/or manhacks in order to find the player. (Just include them into the squad.) If they are not at your disposal, you can also cheat by including npc_enemyfinders into the squad. By setting their FieldOfView keyvalue to -1, they will look in all directions.
  • Make a few ways around your map, to surprise the player at every replay.