Table of contents

  1. Advanced Sight System
    1. Functions
      1. Update Teams Relationship (v1.3)
  2. Advanced Sight Component
    1. Functions
      1. Enable
      2. Disable
      3. Is Enabled
      4. Get Sight Data
      5. Override Sight Data
      6. Get Eye Point Of View Transform
      7. Get Body Actor
      8. Is Target Perceived
      9. Is Target Spotted
      10. Is Target Remembered
      11. Get State For Target
      12. Get Gain Value For Target
      13. Get Highest Gain Value
      14. Get Perceived Targets
      15. Get Spotted Targets
      16. Get Remembered Targets
      17. Is Any Target Perceived
      18. Is Any Target Spotted
      19. Is Any Target Remembered
      20. Force Forget Target
      21. Force Forget All Targets
      22. Force Perceive Target (v1.3)
      23. Add Gain To Target (v1.3)
      24. Set Gain Rate Multiplier (v1.7)
      25. Set Gain Decay Multiplier (v1.7)
      26. Set Wait Time Multiplier (v1.7)
      27. Set Forget Time Multiplier (v1.7)
      28. Get Gain Rate Multiplier (v1.7)
      29. Get Gain Decay Multiplier (v1.7)
      30. Get Wait Time Multiplier (v1.7)
      31. Get Forget Time Multiplier (v1.7)
    2. Events
      1. On Target Spotted
      2. On Target Perceived
      3. On Target Lost
      4. On Target Forgotten
      5. On Target Lost Wait Time Started (v1.7)
    3. Properties
      1. Sight Data
      2. Eye Socket Name
      3. Use Only Yaw From Eye Socket
      4. Should Start Enabled
      5. Gain Rate Multiplier (v1.7)
      6. Gain Decay Rate Multiplier (v1.7)
      7. Wait Time Multiplier (v1.7)
      8. Forget Time Multiplier (v1.7)
  3. Advanced Sight Target Component
    1. Functions
      1. Set Perceivable(v1.3)
      2. Set Gain Rate Multiplier (v1.7)
      3. Set Gain Decay Multiplier (v1.7)
      4. Set Wait Time Multiplier (v1.7)
      5. Set Forget Time Multiplier (v1.7)
    2. Properties
      1. Gain Rate Multiplier (v1.7)
      2. Gain Decay Rate Multiplier (v1.7)
      3. Wait Time Multiplier (v1.7)
      4. Forget Time Multiplier (v1.7)
  4. Advanced Sight Team Component (v1.2)
    1. Properties
      1. TeamID (v1.2)
  5. Advanced Sight Data
    1. Properties
      1. SightInfos
      2. GainSightDuration
      3. Gain Decay Rate (v1.7)
      4. Wait Time Duration (v1.7)
      5. AutoSuccessDistance
      6. LoseSightRadius
      7. Lose Sight FOV (v1.6)
      8. Lose Sight Cooldown
      9. DetectionByAffilation

This API reference page is documenting only blueprint callable functions and blueprint exposed properties. To learn about other systems that are not exposed to the blueprint user please refer to header files of the system.

Advanced Sight System

Functions

Update Teams Relationship (v1.3)

Params:

  • Team A – id of a first team
  • Team B – id of a second team
  • New Attitude – new attitude to be set between Team A and Team B

Advanced Sight Component

Functions

Enable

Registers this agent to the sight system.

Disable

Unregisters this agent from the sight system.

Is Enabled

Returns boolean value defining whether this agent is currently registered or not to the sight system.

Get Sight Data

Returns currently assigned Sight Data asset.

Override Sight Data

Overrides current value of Sight Data property. Using this function ensures that previous config is unregistered in the sight system and the new one is registered properly.

Get Eye Point Of View Transform

Returns transform struct that is used by the system to define agent’s eye point of view. This is either default possessed pawn’s transform or transform of the socket when Eye Socket Name property is defined.

Get Body Actor

Returns pawn possessed by the owning controller.

Is Target Perceived

Params:

  • Target Actor – any actor based class

Returns true if actor passed as parameter to this function is currently perceived by the agent.

Is Target Spotted

Params:

  • Target Actor – any actor based class

Returns true if actor passed as parameter to this function is currently spotted by the agent.

Is Target Remembered

Params:

  • Target Actor – any actor based class

Returns true if actor passed as parameter to this function is currently remembered by the agent.

Get State For Target

Params:

  • Target Actor – any actor based class

Returns one of the following possible states for actor passed as parameter:

  • Not Perceived – when agent doesn’t know anything about the Target Actor
  • Spotted – when agent sees Target Actor but doesn’t perceive it yet
  • Perceived – when agent currently perceives Target Actor
  • Lost – when agent doesn’t sees Target Actor but still remembers it

Get Gain Value For Target

Params:

  • Target Actor – any actor based class

Returns float value equal to current gain value for Target Actor passed as parameter. The returned gain value will be in range of <0, GainSightDuration>. If GainSightDuration is greater than 0, the returned value will NOT be normalized.

Get Highest Gain Value

This function is useful in case more than one target is spotted by the agent or none at all. The function searches through all queries and returns the highest value. Note that this function considers all targets, including these that are not perceived.. Reason for searching through all targets instead just spotted or perceived ones is because target that was spotted for some time reaches certain gain value but can be lost at any point and will be considered as not perceived. However the gain value will be approaching 0 every tick. Until it does reach 0 user might want to use the gain value to show to agent’s awarness or alert state lowering.

Get Perceived Targets

Returns array of all perceived targets by owning controller.

Get Spotted Targets

Returns array of all spotted targets by owning controller.

Get Remembered Targets

Returns array of all remembered targets by owning controller.

Is Any Target Perceived

Returns true if any target is perceived; false otherwise.

Is Any Target Spotted

Returns true if any target is spotted; false otherwise.

Is Any Target Remembered

Returns true if any target is remembered; false otherwise.

Force Forget Target

Params:

  • Target Actor – any actor based class that we want this agent to forget

Immediately forgets actor that has been passed as a parameter. All appropriate events like On Target Lost or On Target Forgotten will be called.

Force Forget All Targets

Same as Force Forget Target except calling this is going to cause all targets to be forgotten.

Force Perceive Target (v1.3)

Params:

  • Target Actor – any actor based class that we want this agent to perceive Forces a specified actor to be perceived. Please note that if a target actor is not spotted when this function is called it will first be spotted and then immediately perceived so ensure that appropriate delegates are broadcasted. If a target actor is already spotted, spot function and delegate will not be called.

Add Gain To Target (v1.3)

Params:

  • Target Actor – any actor based class that we want to add a gain value to
  • Value – how much gain value we want to add; not normalized Use this function to manually add a gain value towards a specified target actor.

Set Gain Rate Multiplier (v1.7)

Params:

  • New Gain Rate Multiplier – value for new gain rate multiplier

Set Gain Decay Multiplier (v1.7)

Params:

  • New Gain Decay Multiplier – value for new gain decay multiplier

Set Wait Time Multiplier (v1.7)

Params:

  • New Wait Time Multiplier – value for new wait time multiplier

Set Forget Time Multiplier (v1.7)

Params:

  • New Forget Time Multiplier – value for new forget time multiplier

Get Gain Rate Multiplier (v1.7)

Get Gain Decay Multiplier (v1.7)

Get Wait Time Multiplier (v1.7)

Get Forget Time Multiplier (v1.7)

Events

On Target Spotted

Params:

  • Target Actor – actor that has been spotted Broadcasted whenever not previously visible target becomes visible.

On Target Perceived

Params:

  • Target Actor – actor that has been perceived
  • bWasRemembered – this flag determines whether previous state of the perceived actor was spotted or remembered. User can build their own logic based on that. Broadcasted when a target was spotted and was visible for long enough to become perceived. It is also called whenever a target has been lost but not yet forgotten, and while lost becomes visible. It then instantly becomes perceived again.

On Target Lost

Params:

  • Target Actor – actor that has been lost
  • bWasPerceived – this flag determines whether previous state of the lost actor was perceived or spotted. Broadcasted whenever a target was visible during previous sight check and is not visible in the current. Can be broadcasted when target is either spotted or already perceived.

On Target Forgotten

Params:

  • Target Actor – actor that has been forgotten Broadcasted when a target was perceived, became lost and was not visible for long enough.

On Target Lost Wait Time Started (v1.7)

Params:

  • Target Actor – actor that has been spotted but then became not visible to the agent.

Properties

Sight Data

Data asset defining all necessary properties for the system. This can be either set in the default class properties or overriden using Override Sight Data function in runtime.

Eye Socket Name

Name of the bone or socket defined on a possessed pawn mesh. This works both on skeletal and static meshes. If None this functionality will be disabled.

Use Only Yaw From Eye Socket

If Eye Socket Name is defined this settings becomes relevant. Defines whether system should use socket’s transform directly or should it only fetch yaw.

Should Start Enabled

Determines whether the agent should automatically register to the system at begin play or whether user wants to enable the agent manually.

Gain Rate Multiplier (v1.7)

Defines a multiplier used for this agent sight gain value. When greater than 1 it will increase the speed the gain is growing. When lower than 1 it will decrease the speed the gain is growing.

Gain Decay Rate Multiplier (v1.7)

Defines a multiplier used when decreasing gain value. This happens only for targets that have not been yet fully perceived but have been spotted and then lost.

Wait Time Multiplier (v1.7)

Defines a multiplier used for manipulating a wait time before the gain value starts decaying after a target has been lost after being spotted but not yet perceived.

Forget Time Multiplier (v1.7)

Defines a multiplier used for manipulating a forget time duration. The forget time is the time between a lost and forgotten state for a perceived target.

Advanced Sight Target Component

Functions

Set Perceivable(v1.3)

Params:

  • Is Perceivable – boolean value determining whether this target should be perceivable or not Call this function to update current state of this target. Useful when you don’t want this actor to be perceived for any reason i.e. the character is dead and should not be treated as a valid target.

Set Gain Rate Multiplier (v1.7)

Params:

  • New Gain Rate Multiplier – new value of gain rate multiplier.

Set Gain Decay Multiplier (v1.7)

Params:

  • New Gain Decay Multiplier – new value of gain decay multiplier.

Set Wait Time Multiplier (v1.7)

Params:

  • New Wait Time Multiplier – new value of the wait time multiplier.

Set Forget Time Multiplier (v1.7)

Params:

  • New Forget Time Multiplier – new value of the forget time multiplier.

Properties

Gain Rate Multiplier (v1.7)

Defines the multiplier value used to calculate new gain value when this target is being spotted by any other agent.

Gain Decay Rate Multiplier (v1.7)

Defines the multiplier value used to calculate new gain value when this target is not visible and the gain value is decaying.

Wait Time Multiplier (v1.7)

Defines the multiplier value used to calculate time before this target is going to be considered lost after it has been spotted, but not yet perceived.

Forget Time Multiplier (v1.7)

Defines the multiplier value used to calculate time before this target is going to be forgotten after it has been lost.

Advanced Sight Team Component (v1.2)

This component is optional and should only be used on actors that aren’t inheriting from the Advanced Sight Character class.

Properties

TeamID (v1.2)

Defines the team affiliation for the owner actor. This is then used to determine whether two actors are friendly, neutral, or hostile to each other.

Advanced Sight Data

Properties

SightInfos

An array of each sight range definition. Must contain at least one definition. There is no upper limit.

GainSightDuration

Defines how long a target must be visible in order to become perceived. Please note that gain value can be modified by GainMultiplier from sight info definition.

Gain Decay Rate (v1.7)

Defines how quickly the gain value is will be decreasing when target is no longer visible but the gain value is greater than 0. Final value for the decay rate considers this value as well as gain decay multiplier of a listener and a target.

Wait Time Duration (v1.7)

Defines time required to pass for the gain value to start decaying. This is only considered for targets that have not been perceived yet, and the gain value is greater than 0. When a target is lost, this amount of time needs to pass before a target will be considered lost.

AutoSuccessDistance

Defines how far from last know location a target must move away in order to be considered no longer visible. This is very useful to ensure that agents are not losing sight immediately after a target hides behind the corner.

LoseSightRadius

Defines how far away a target must be from agent’s current position to be considered no longer visible.

Lose Sight FOV (v1.6)

Defines FOV used for lose sight range.

Lose Sight Cooldown

Defines the time that need to pass for a target to be considered forgotten, after it has become lost before.

DetectionByAffilation

Defines whether this agent should only be looking for enemies, allies, neutral or any combination of them.