AIPerception - Visibility

Hi all,

Been having a reasonable amount of success using AIPerception and most of the high level stuff is being done in Blueprints. Currently, I’m working on changing a value on the player to indicate whether they’re in a light or dark area. Simple float (0.0f-1.0f to indicate light level)

What is the best/recommended way to go about using this with the AI Perception? Right now, I have the problem that while I can certainly do a check to see if the player/enemy is detected by the sense - I can then check if the player is lit enough to be seen. However, once the player becomes detected - that has already triggered the OnPerceptionUpdated for that sense. Unless the agent moves out of sight range, I will not lose that detection - so cannot issue another Player Detected message.

I feel like I could iterate over this and then do another layer of checks using this:-

But I am wondering if there is a cleaner way to simply put a condition on the initial detection of the sight sense.

Thanks,

  • Steve

HI,

I am facing the same issue and I don~t know if zou ever resolved this but I came up with the following:

  • when the character is unlit they would not be a sight stimulus
  • when they move into range of a light source (collision box) then the event would trigger adding the sight stimulus to the character. I don’t know if the stimulus can be added dynamically in which case the character could have a visibility level which increases as they get closer to the light.
  • The AI perception would trigger but depending upon the visibility level of the character and th strenght of vision sight range of the ai it would or would not see the character.

Dunno if this helps or if you came up with another solution… please let me know !

Sorry but I’m a newb, here’s my thoughts : but while the player is detected, could you be looping a distance check to the nearest light source, distance based off of the light sources intensity/something? If it’s more than 40% then That could return a bool? Just for example. Good luck!