x

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"

AIPerception detecting WITHOUT AIStimuliSourceComponent defined

Hi everyone,

I've been working on a school project where we'd like to make AIs detect players with sight. So we decided to work with the UAIPerceptionComponent to do so.

We've followed a couple of tutorials and tested a lot of things on our own since there's not so much documentation on the subject. We can make it work, but the problem is that our AIs detect ANYTHING that's moving even when these moving actors ARE NOT registered as stimuli sources - meaning that AIs detect each other which is something that we don't want. We only need our AIs to detect the players.

All we're doing is setting a UAIPerceptionComponent and a UAISenseConfig_Sight in the constructor of our custom AI controller derived from AAIController as shown in the screenshot below.

alt text

And that's it. Nothing more. We never register our player or AI characters as stimuli sources by creating a UAIStimuliSourceComponent or even using UAIPerceptionSystem. Despite of that, our AI still works and detects moving actors getting in the sight range. And my question is why? We even tried to force the engine not to register all pawns by writing those lines in the DefaultEngine.ini but nothing changed :

[/Script/AIModule.AISense_Sight]
 bAutoRegisterAllPawnsAsSources=false 

The thing is that we then have to cast the sensed actor received by TargetPerceptionUpdate in order to do stuff like store the player in a blackboard. But the most annoying part is that we'd like to unregister a hurt player so the AI won't chase him when they're on the ground waiting for another player to heal them.

Does anybody have an idea of what we did wrong? I can't seem to find any similar question on forums...

Thanks in advance!

Product Version: UE 4.14
Tags:
more ▼

asked Mar 23 '17 at 03:14 AM in C++ Programming

avatar image

CedSentenac
6 1 3

avatar image kbrizov Nov 15 '17 at 05:11 PM

Hello CedSentenac,

I am in the exact same situation. I wanted to cry when I saw that no one answered your question. Did you find an answer to this? I want my AIPerceptionComponent to detect only sight and damage. My player pawn is not registered as a source to sight and damage and my AI Perception still detects it. Clearly my player pawn is registered as source for some reason, but why?

avatar image CedSentenac Nov 15 '17 at 05:29 PM

It's been a while now and I'm not working on this anymore. But to answer your question, sadly no we never found a way to resolve our problem with the registering system. We actually filtered manually the unwanted source of stimuli.. A poor way to do it but it was a school project so performance didn't really matter.

avatar image kbrizov Nov 15 '17 at 05:21 PM
avatar image CedSentenac Nov 15 '17 at 05:31 PM

If I remember well, we actually tried to set our player not auto register, but I'm not sure if we did it with the .ini modification. You could give this a try :)

(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