Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AI how to predict multiple enemies periodically?

Edit: 4.13 fixed this problem, use 4.13 instead

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. bp graph

Product Version: UE 4.12
more ▼

asked Aug 26 '16 at 05:19 PM in Blueprint Scripting

avatar image

137 15 18 227

avatar image PenguinTD Aug 27 '16 at 08:27 AM

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. alt text

avatar image PenguinTD Aug 28 '16 at 04:58 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question