So I use the “Request Controller Prediction Event” and then check the stimulus class to see if it’s equal to AISense_Prediction. So far so good. They do seem to get proper location calculated when the even OnTragetPerceptionUpdated fired. Now my question would be what’s the proper way to keep track of multiple enemies properly??
As of now, I fire projectile every time OnTargetPerceptionUpdated fired and all the condition fits(are from enemy, not dying/ragdoll, valid pawn with successful sense), there are no cool down. But somehow the event seems to only fire when you enter/leave the sight range. And then randomly either doing nothing/spam every frame while AI controller is running behavior tree.(doing nothing while BT is doing the wait task, spam every frame happens when AI is on moving to task).
So, essentially, the question becomes, how to I make sure OnTargetPerceptionUpdated fires periodically when an actor in range? How do I do this on multiple enemies? Cause I do see when there are a lot enemies AI come into range, only a few prediction request is fired. Which means even though sight is registered when see in visual debug mode, this event is not fired for every enemy, thus no Request Controller Prediction Event is issued.
here is my simplified version of how I wire up prediction now.
After a few more test, it seems that AI Perception for Sight isn’t really reliable. I kept 1 AI that can see enemies, and there are times where spotter AI sits there doing nothing and all the enemies go pass through while visual debugger shows no green sight sphere tracking enemies. And on some rare occasion, it’s able to track when enemies enters range and then decides to not track them after a while even though enemies are still in range and cone.
On those where enemies pass through without trigger sight sense, if I then issue command to force spotter AI to move to a new location, it will then starts to pickup sight senses for some of the AIs that enter or leave sight range. Is this feature consider mature? Or just still being worked on and you are suppose to code in C++ for more reliable results?
This screenshot pretty much is the norm when the AI spotter ignore most of other agents that enter range earlier.
So I did a clone and then do in place conversion to run in 4.13 preview 3. It seems to fix no update more consistently, but AI still not spot the agents right when they enter the sight circle range, there is about .5~1 second delay before it register and green sphere show up. Since I did no changes to the project at all, it might be some new settings I need to look at in the future.
Unfortunately, some of the plugin I use still only supports 4.12 at this moment, I need to maybe look around source code and see what they changed to the perception system.