Talk:NPC Sensing: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
{{stub}} | |||
I sincerely hope this is an appropriate place to ask a torrent of questions about NPC AI Sensing. | I sincerely hope this is an appropriate place to ask a torrent of questions about NPC AI Sensing. | ||
So far I've figured out that two of the key concepts for spatialised NPC senses are PVS and LOS: | So far I've figured out that two of the key concepts for spatialised NPC senses are PVS and LOS: | ||
*[[PVS]] ''' | *[[PVS]] '''Potentially Visible Set''' - the group of visleafs which are visible from the NPC's [[visleaf]]. PVS is the spatial area (measured in visleafs) that is potentially visible to the NPC from his current location (ie the visleaf he is in). If another entity (usually a Player or NPC) enters this area the NPC will do a Viewcone test and/or an LOS test?. NPCs may also "Think outside PVS" by using the NPC [[Giving an NPC Memory|memory]] feature(?). In contrast to the NPC's [[LOS]] (Line of Sight), PVS is not restricted by props and func_detail brushes, or the direction in which the NPC happens to be looking. | ||
*[[LOS]] '''Line of Sight''' - the NPC' | *[[Viewcone]] is used for ''directional'' FOV tests - the angle of the cone is the NPC's [[FOV]] angle and the cone's long axis is the [[LOS]]. | ||
*[[FOV]] '''Field of View''' - In Source, an NPC's FOV value is the '''Angular Field of View''' used to calculate its Viewcone. The edge of the FOV, or projected sides of the viewcone represent the periphery of vision. (By contrast, the ''Player's'' FOV value represents the ''Horizontal Angular Field of View'' of a ''Viewwedge'' rather than a viewcone. The wedge's rectangular cross-section corresponds to the Player's rectangular screen.) | |||
*[[LOS]] '''Line of Sight''' - the ''direction'' in which the NPC happens to be looking. LOS is used for 'ray trace' tests within the Viewcone (?). Unlike [[PVS]], LOS is blocked by props and func_detail brushes, etc. | |||
*[[PAS]] '''Potentially Audible Set''' is the spatial area (measured in visleafs) in which sound sources are potentially audible to the NPC. Unlike Vision, Hearing is not limited to a directional Viewcone. ([[PAS]] - newly discovered in BSP compile log) | |||
--[[User:Beeswax|Beeswax]] 08:35, 5 Apr 2008 (PDT) | |||
However I'm still struggling to understand what almost all of these BaseNPC entity 'object property' settings actually mean / do. So far my attempts at empirical testing of AI behaviours have been entirely inconclusive! | However I'm still struggling to understand what almost all of these BaseNPC entity 'object property' settings actually mean / do. So far my attempts at empirical testing of AI behaviours have been entirely inconclusive! |
Revision as of 08:35, 5 April 2008
I sincerely hope this is an appropriate place to ask a torrent of questions about NPC AI Sensing.
So far I've figured out that two of the key concepts for spatialised NPC senses are PVS and LOS:
- PVS Potentially Visible Set - the group of visleafs which are visible from the NPC's visleaf. PVS is the spatial area (measured in visleafs) that is potentially visible to the NPC from his current location (ie the visleaf he is in). If another entity (usually a Player or NPC) enters this area the NPC will do a Viewcone test and/or an LOS test?. NPCs may also "Think outside PVS" by using the NPC memory feature(?). In contrast to the NPC's LOS (Line of Sight), PVS is not restricted by props and func_detail brushes, or the direction in which the NPC happens to be looking.
- Viewcone is used for directional FOV tests - the angle of the cone is the NPC's FOV angle and the cone's long axis is the LOS.
- FOV Field of View - In Source, an NPC's FOV value is the Angular Field of View used to calculate its Viewcone. The edge of the FOV, or projected sides of the viewcone represent the periphery of vision. (By contrast, the Player's FOV value represents the Horizontal Angular Field of View of a Viewwedge rather than a viewcone. The wedge's rectangular cross-section corresponds to the Player's rectangular screen.)
- LOS Line of Sight - the direction in which the NPC happens to be looking. LOS is used for 'ray trace' tests within the Viewcone (?). Unlike PVS, LOS is blocked by props and func_detail brushes, etc.
- PAS Potentially Audible Set is the spatial area (measured in visleafs) in which sound sources are potentially audible to the NPC. Unlike Vision, Hearing is not limited to a directional Viewcone. (PAS - newly discovered in BSP compile log)
--Beeswax 08:35, 5 Apr 2008 (PDT)
However I'm still struggling to understand what almost all of these BaseNPC entity 'object property' settings actually mean / do. So far my attempts at empirical testing of AI behaviours have been entirely inconclusive!
BaseNPC properties stimulated by PVS?
- BaseNPC Flag : 256 : "Long Visibility/Shoot" : 0
- Usually, the range at which an NPC is activated by an enemy within its ViewCone is about 1920 units (this might vary between NPC classes?). With the "Long Visibility/Shoot" flag set, the NPC's ViewCone range seems to be unlimited. Beeswax
- BaseNPC Flag : 1024 : "Think outside PVS" : 0
- "Thinking outside the PVS" means that it tests all entities in the map (or possibly a given radius) --TomEdwards
- BaseNPC Output : "OnHearWorld" "" : Fired when this NPC hears a sound (other than combat or the player).
- BaseNPC Output : "OnHearPlayer" "" : Fired when this NPC hears the player.
- BaseNPC Output : "OnHearCombat" "" : Fired when this NPC hears combat sounds.
- if when this NPC hears means within earshot = within PVS ? or calculated from (loudness/distance)/NPC_deafness ?
- what exactly are player sounds, combat sounds and especially a sound (other than combat or the player) ?
- ai_sound : This entity makes abstract sounds or smells that can be sensed by NPCs, but not by the player. This can be used to cause reactions in nearby NPCs.
- does this come in here or is it part of the Response System?
SleepState
Sleep State Holds the NPC in stasis until specified condition. See also 'Wake Radius' and 'Wake Squad'.
- this would seem to be a list of triggers for an undocumented NPC_State ?
- It prevents the NPC from being rendered or thinking. Instead it waits for the correct conditions to become active. It's not really an AI state at all. --TomEdwards 02:52, 7 Mar 2008 (PST)
- BaseNPC Keyvalue : "sleepstate" "0" : None (default).
- what is normal behaviour if not "Waiting for PVS" stimulus?
- BaseNPC Keyvalue : "sleepstate" "1" : Waiting for threat.
- what exactly is a threat ? enemy or grenade within PVS ?
- BaseNPC Keyvalue : "sleepstate" "2" : Waiting for PVS.
- BaseNPC Keyvalue : "sleepstate" "3" : Waiting for input, ignore PVS.
- similar to "Wait For Script" flag I guess ?
- BaseNPC Keyvalue : "sleepstate" "4" : Auto PVS.
- what on earth is Auto PVS ?
- BaseNPC Keyvalue : "sleepstate" "5" : Auto PVS after PVS.
- what ... ?
- BaseNPC Keyvalue :"wakeradius" "<float>" : Auto-wake if player within this distance.
- I assume this would override the sleepstate/PVS then, ignoring PVS stimuli?
- BaseNPC Flag : 1 : "Wait Till Seen" : 0
- I assume this overrides sleepstate/PVS, using LOS instead of PVS? (LOS is reciprocal?)
- BaseNPC pseudo Input via : "wakesquad" from another NPC if this NPC is assigned to the same "squadname".
SleepState generic I/Os
- BaseNPC Input : "Wake" "" : Wakes up the NPC if it is sleeping.
- BaseNPC Output : "OnSleep" "" : Fired when this NPC enters a sleep state.
- BaseNPC Output : "OnWake" "" : Fired when this NPC comes out of a sleep state.
BaseNPC properties stimulated by LOS ?
- BaseNPC Output : "OnFoundEnemy" & "OnFoundPlayer" : Fired when this NPC establishes line of sight to its Enemy/Player. Sends "<enemyname>" as a parameter.
- BaseNPC Output : "OnLostEnemyLOS" & "OnLostPlayerLOS" : Fired when this NPC loses line of sight to its Enemy/Player.
- BaseNPC Output : "OnLostEnemy" & "OnLostPlayer" : Fired when this NPC loses its Enemy/Player. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
- killed I understand, removed I guess refers to targetname inputs (Kill & KillHierarchy), but how does an NPC decide to select a new, more dangerous enemy?
- what happens if the enemy simply moves out of the NPC's PVS ?