NPC Perception Design: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Magodra (talk | contribs)
Magodra (talk | contribs)
Line 34: Line 34:
<uml>
<uml>
-> NPC : TriggerEvent
-> NPC : TriggerEvent
activate NPC
NPC -> NPCType : FirePerception
NPC -> NPCType : FirePerception
activate NPCType
loop "For all Reactions"
loop "For all Reactions"
   NPCType -> Reaction : React
   NPCType -> Reaction : React
  activate Reaction
   Reaction -> Perception : ShouldReact
   Reaction -> Perception : ShouldReact
  activate Perception
  Reaction <-- Perception
  deactivate Perception
   Reaction -> Reaction : CheckDeath
   Reaction -> Reaction : CheckDeath
   Reaction -> Reaction : Check DoNotInterrupt
   Reaction -> Reaction : Check DoNotInterrupt
Line 46: Line 52:
     Reaction -> Reaction : Adjust Needs
     Reaction -> Reaction : Adjust Needs
     Reaction -> Perception : ExecutePerception
     Reaction -> Perception : ExecutePerception
    activate Perception
    Reaction <-- Perception
    deactivate Perception
   end
   end
   NPC <- Reaction : SetLastPerception
   NPC <- Reaction : SetLastPerception
  NPCType <-- Reaction
  deactivate Reaction
end
end
NPC <-- NPCType
deactivate NPCType
<-- NPC
deactivate NPC
</uml>
</uml>



Revision as of 19:15, 30 April 2011

See Behaviors_and_Reactions for User details about how to use Perceptions in the behavior.xml file.


This embodies any perception an NPC might have, or any game event of interest. Reaction objects below will subscribe to these events, and the networking system will publish them. Examples would be "attacked", "collided", "talked to", "hear cry".

NPC Perceptions

Class Hierarchy

Personal NPC Perceptions Sequence

Show the typical sequence for a Perception fired for a NPC, might be perceptions like Damage Perception.

Broadcast NPC Perceptions Sequence

Show the typical sequence for a broadcasted Perception. Examples of broadcasted perceptions is the SpellPerception.