Need some help with OnPerceptionUpdated's sensed actors.
Hey, i'm working a bit with an AI for my game but i have gotten a bit stuck when it comes to the perception of actors for my AI.
I currently have three actors that are attached to the player character which are registered for sight stimuli and i want the AI to know how many of these three actors are in sight at all time. It looks something like this when the player is standing in view of the AI.
But the issue i'm currently having is that i can't figure out how to get so that the AI knows how many of these are in view. The reason i cannot figure this out is because my OnPerceptionUpdated function's sensed actors sometimes does not register the three actors it seems. When i'm walking around in the view of the AI and walk behind certain things the sensed actors array show weird values, for example when i'm standing in full view the sensed actors array is showing that it has 1 value.
Anyone have any idea how i can go about doing so that the AI knows how many of the three actors that are attached to the player is in view. How i want to do is that the AI should go through the sensed actors array and maybe check if it finds any of the three actors and that it was WasSuccessfullySensed().
asked Jul 28 '15 at 11:12 AM in C++ Programming
It's a while since I played around with the perception component, but from what I remember, the array passed into the update event is not a list of actors currently sensed. I think it's a list of actors whose perception state has just changed. So I believe you need to maintain your own list of currently perceived actors by checking the last stimulus information for each actor passed into the update delegate, and marking them as perceived/not perceived based on whether the last stimulus was a successful sensing.
I know Mieszko intended to change how this worked however and I haven't kept up to date with it, so I'm not certain what the current situation is.
answered Jul 28 '15 at 05:34 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here