Difference between revisions of "NPC Aggression (Game Mechanics)"

From SWGANH Wiki
Jump to: navigation, search
(Approach Trigger Events)
(Approach Trigger Events)
Line 122: Line 122:
  
  
'''Fight or Flight Response'''
+
'''Fight or Comment Response'''
  
 
Upon detecting a target, the Npc will then initiate another roll to determine what it's response will be.  Pack Npcs will automatically go to the aid and defense of similar social group Npc that are under attack by the target. Aggressive Npc may then begin a check to determine if they will actively attack the spotted target. NPC's seem to become aggressive as soon as targets are detected within their range.  
 
Upon detecting a target, the Npc will then initiate another roll to determine what it's response will be.  Pack Npcs will automatically go to the aid and defense of similar social group Npc that are under attack by the target. Aggressive Npc may then begin a check to determine if they will actively attack the spotted target. NPC's seem to become aggressive as soon as targets are detected within their range.  

Revision as of 21:52, 20 July 2009




Game Mechanics - Mechanics Category

SWGANH Wiki is a repository of Star Wars Galaxies Developer information. This site is only meant to be used by SWGANH Developer team.


Navigation

Description

Template (Game Messages)

Related Tags

25% This document has been partially completed.

Mechanics This document is about game mechanics.

Game Mechanics

Npcs in SWG use a complex system to detect the presence of potential enemies. Once a target is detected, a number of processes execute to determine if the Npc should attack the target or not. The process of target detection and Npc response are explained under the following categories:

  • Awareness Checks
  • Approach Trigger Events

Awareness Checks

The ability for an Npc to detect another target depends on a number of factors:

  • The Target's distance from the Npc
  • The target's posture
  • The target's movement speed
  • The usage of camouflage
  • Being in combat with the target

Note: There are no known formulas for detection chances.


The distance of a target from the Npc is the initial trigger for Npc behaviors. Npcs begin actual target detection checks at 64 meters. Whenever a target enters the detection range of Npcs, the system begins an awareness check cycle where at every cycle, the target's current posture, movement speed and distance are calculated into an detection response chance by the Npc. Target's with mask scent or camouflage utilize their own roll check at this stage. Successful passing of the mask scent or camouflage will override any awareness checks against the target. If the Npc passes the detection chance then the target's presence is made aware to the Npc and awareness triggers begin. When a Npc becomes aware of a target within its awareness range, the Npc indicates their knowledge of the target through a flytext question mark "?"


Distance affects on awareness -

The closer a target is to the Npc, the greater the chances that the Npc will be made aware of the target. A Npc's awareness increases significantly against targets that are at 40 meters or closer to them.

Posture affects on awareness -

The three types of posture of a target will have great effects on the detection chances of the creature. Standing posture provides the least chance to the target in its check against a Npc's awareness; Kneeling provides a lesser chance to the target and Prone posture provides the best chances to the target.


Movement speed affects on awareness -


The movement speed of the target offers a penalty against its check with a Npc's awareness. The slower that the target is moving, the higher its chances of remaining undetected. Stationary targets have the best chance of remaining hidden while targets that are walking, running, mounted or using vehicles have higher chances.


Being in Combat -

If the target has initiated an attack on the Npc then this will automatically trigger awareness of the target, however aggression will not be triggered until the creature has detected the target. Npcs in combat will initiate patrolling behavior and roam around trying to detect their attacker.



Approach Trigger Events

Whenever an creature, Npc or player enters within a 64 meter range of an Npc and the Npc passes an initial awareness check, several events may be triggered depending on the Npc:

  •  ! - Detection
  • - Fight or Comment Response



Detection


Once the Npc has passed an awareness check, it will then use the same awareness mechanics to perform a detection roll at every cycle. The purpose of the detection check is to find the actual location of the target. Npcs cannot respond to aggression until they have actually detected the target first. If the Npc passes this roll then the target is detected and the Npc may then begin its fight or Comment response to the potential threat. When a Npc successfully detects a target it will react and signal with an exclamation mark "!" Npcs are also automatically given detection on a target if any one of the surrounding lair mates spots a target. When a target is detected, Npcs will issue forth a comment at the target. The outburst selected is dependant on the npc's like or dislike of the target. The outburst is npc specific but generally, Npcs that dislike the target will usually issue negative comment where npcs that like the target will issue positive statements.

A target's chance of being detected increases significantly if the target is at 40 meters or less from the Npc. Target's that initiate combat against a Npc dramatically increase their detection chances. Target's will also be automatically be detected after a given amount of time if they have initiated combat against a Npc, although they may still be detected normally through distance/posture checks. The exact timing is unknown but its possibly within a fixed time of the attack (perhaps 20 seconds). Target's will also automatically be detected if they inflict a bleed on the Npc or if they miss the Npc twice in a row while using the Concealed Shot ability. Target detection can be overwritten by using camouflage or the use of the conceal shot ability. If a target leaves the awareness range of a Npc, and then re-enters then the process resets and begins again. If a Npc has had aggressive actions taken against it and detects the target, then the target is immediately aggroed and pursued.


Fight or Comment Response

Upon detecting a target, the Npc will then initiate another roll to determine what it's response will be. Pack Npcs will automatically go to the aid and defense of similar social group Npc that are under attack by the target. Aggressive Npc may then begin a check to determine if they will actively attack the spotted target. NPC's seem to become aggressive as soon as targets are detected within their range.

Note: During Pre-cu, if a Npc target was already damage by a player and the player escaped combat and came back within 64 meters of the target, then the Npc was given enhanced awareness of the player and detection chances. This dramatically increased the re-aggro rate.

Formulas Needed

  • Awareness check cycles using target's distance, posture, movement speed and combat state as variables
  • Detection check cycles using target's distance, posture, movement speed and combat state as variables
  • Aggression check cycles using creature's ferocity and target's distance as variables
  • Non aggressive creature Flight response / bluff charge check cycles using target's distance as variables

Source References

Source Source in Context