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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

AI Perception fails to detect sight when using blueprint nativize conversion when building game.

I was using AI perception to detect my player object and it was working fine in the editor however when i cooked the game to be distributed i used the nativize blueprints feature and it was causing the AI not to see the player anymore...I rebuilt the game and compiled it with the feature turned off and it seemed to work fine. Not sure if this is noted yet or not...but it caused me headaches for a long time :(

Product Version: UE 4.14
Tags:
more ▼

asked Feb 18 '17 at 06:50 PM in Packaging & Deployment

avatar image

warka
41 1 3 4

avatar image Rudy Q ♦♦ STAFF Feb 20 '17 at 04:21 PM

Hello warka,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?

  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?

  3. Could you provide screen shots of any blueprints/settings that may be involved?

avatar image HyperToxic Feb 21 '17 at 06:38 PM

I'm having the exact same problem, however I'm using Unreal 4.15. If I nativeize all the blueprints in my project, by using the Project Settings: Packaging -> Blueprints -> Blueprint Nativization Method set to "Inclusive", then AI Perception fails to sense/see player controlled pawns. When setting Packaging -> Blueprints -> Blueprint Nativization Method back to disabled, AI then senses as expected.

avatar image HyperToxic Feb 21 '17 at 09:39 PM

I've created a new project with just the assets that showcase the issue.

https://docs.google.com/uc?export=download&confirm=a9cN&id=0BwbCf0Ahec-odnZ1Q0hKaWFMcGc

If you download that project and play in editor, the ai character will chase the player pawn if it gets close. If you package the project and execute the build it will not.

However if you change the Project Settings: Packaging -> Blueprints -> Blueprint Nativization Method set to "Disabled". Then the AI will chases you in a packaged build.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey HyperToxic,

Thanks for the info and the project. I've reproduced the issue in both your project and a clean project and have written up a bug report, which you can track using the link below:

https://issues.unrealengine.com/issue/UE-42358

Have a great day

more ▼

answered Feb 24 '17 at 02:24 PM

avatar image

Sean L ♦♦ STAFF
43.8k 485 152 440

avatar image ArCorvus Mar 10 '18 at 05:47 PM

Hi Sean,

I also experience this issue. In my case the problem is that nativization makes new objects for Senses for AIPerception component that was made in C++. Also when nativization makes code for sense it does not set DetectionByAffiliation.

Here is STR (UE4.16.3): 1. Make empty project 2. add AIController parent class to C++ and add AIPerceptionComponent to it with several senses 3. make BP AIController derived from one created in C++ 4. Build the project with nativization. When build Development you will get an exception on start.

Fatal error: [File:D:\Build\++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3615] Default subobject AISenseConfig_Sight SenseSight Config already exists for AIC_EnemyBase_C /Game/Blueprints/AIC_EnemyBase.Default__AIC_EnemyBase_C.

example project: https://drive.google.com/file/d/1UZLf37dy2EY0ehcmDcxzvKkEQQemZcpd/view?usp=sharing

Have a nice day

avatar image ArCorvus Mar 10 '18 at 07:24 PM

Here is workaround in case AIPerception Component added to Blueprint.

declare function in C++ and call it in BeginPlay

header:

 UFUNCTION(BlueprintCallable, Category = "Helper")
 void UpdateDetectionByAffiliation();

cpp:

 void AAIC_BaseCPP::UpdateDetectionByAffiliation()
 {
     UAIPerceptionComponent *percComp = GetAIPerceptionComponent();
     if (!percComp)
         return;
     
     UAISenseConfig_Sight *sightConfig = Cast<UAISenseConfig_Sight>(percComp->GetSenseConfig(UAISense::GetSenseID(UAISense_Sight::StaticClass())));
     if (sightConfig)
     {
         sightConfig->DetectionByAffiliation.bDetectEnemies = true;
         sightConfig->DetectionByAffiliation.bDetectFriendlies = true;
         sightConfig->DetectionByAffiliation.bDetectNeutrals = true;
     }
 
     UAISenseConfig_Hearing *hearingConfig = Cast<UAISenseConfig_Hearing>(percComp->GetSenseConfig(UAISense::GetSenseID(UAISense_Hearing::StaticClass())));
     if (hearingConfig)
     {
         sightConfig->DetectionByAffiliation.bDetectEnemies = true;
         sightConfig->DetectionByAffiliation.bDetectFriendlies = true;
         sightConfig->DetectionByAffiliation.bDetectNeutrals = true;
     }
 
     percComp->RequestStimuliListenerUpdate();
 }







(comments are locked)
10|2000 characters needed characters left
Your answer
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