Editor crashes when running AI Perception component

Hi, I just started using AI Perception system for my AI characters. The editor has been crashing quite a few times since then. I have remove the the perception component and added again, but I’m still getting the crashes. If I completely remove the perception component, the game is running fine. I’ve added the crash report data below:

MachineId:013718AB4E6DEC0F6374D59520A1AB13
EpicAccountId:7b8e2bb8b466411588cadfe08ecd7de9

Unknown exception - code 00000001 (first/second chance not available)

Ensure condition failed: IsSenseInstantiated(SenseID) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.7\Engine\Source\Runtime\AIModule\Private\Perception\AIPerceptionSystem.cpp] [Line: 103]

KERNELBASE + 42141 bytes
UE4Editor_Core!NewReportEnsure() + 19 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\windows\windowsplatformcrashcontext.cpp:390]
UE4Editor_Core!FDebug::EnsureFailed() + 754 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\misc\outputdevice.cpp:345]
UE4Editor_AIModule!UAIPerceptionSystem::RegisterSource() + 209 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\aimodule\private\perception\aiperceptionsystem.cpp:104]
UE4Editor_AIModule!UAIPerceptionSystem::RegisterPerceptionStimuliSource() + 440 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\aimodule\private\perception\aiperceptionsystem.cpp:405]
UE4Editor_AIModule!UAIPerceptionSystem::execRegisterPerceptionStimuliSource() + 234 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\aimodule\classes\perception\aiperceptionsystem.h:17]
UE4Editor_CoreUObject!UFunction::Invoke() + 180 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\class.cpp:3713]
UE4Editor_CoreUObject!UObject::CallFunction() + 1112 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:395]
UE4Editor_CoreUObject!UObject::ProcessContextOpcode() + 141 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1451]
UE4Editor_CoreUObject!UObject::execLetBool() + 334 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1370]
UE4Editor_CoreUObject!UObject::ProcessInternal() + 1644 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:602]
UE4Editor_CoreUObject!UObject::CallFunction() + 2707 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:516]
UE4Editor_CoreUObject!UObject::ProcessInternal() + 1644 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:602]
UE4Editor_CoreUObject!UObject::CallFunction() + 2707 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:516]
UE4Editor_CoreUObject!UObject::ProcessInternal() + 1644 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:602]
UE4Editor_CoreUObject!UObject::CallFunction() + 2707 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:516]
UE4Editor_CoreUObject!UObject::ProcessInternal() + 1644 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:602]
UE4Editor_CoreUObject!UFunction::Invoke() + 180 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\class.cpp:3713]
UE4Editor_CoreUObject!UObject::ProcessEvent() + 3036 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:924]
UE4Editor_Engine!AActor::ProcessEvent() + 259 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actor.cpp:529]
UE4Editor_Engine!AWorldSettings::NotifyBeginPlay() + 342 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\worldsettings.cpp:119]
UE4Editor_Engine!AGameMode::HandleMatchHasStarted() + 426 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\gamemode.cpp:602]
UE4Editor_Engine!AGameMode::SetMatchState() + 141 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\gamemode.cpp:711]
UE4Editor_Engine!AGameMode::StartMatch() + 83 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\gamemode.cpp:579]
UE4Editor_Engine!UGameInstance::StartPIEGameInstance() + 1545 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\gameinstance.cpp:218]
UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() + 8708 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:2861]
UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() + 7184 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:2212]
UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() + 643 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:974]
UE4Editor_UnrealEd!UEditorEngine::Tick() + 3604 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:1226]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() + 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]
UE4Editor!FEngineLoop::Tick() + 4179 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
UE4Editor!GuardedMain() + 1404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

This is almost certainly the bug Mieszko mentions here. Unfortunately unless you are building from source and can make the change, the only way to get around it for now is to either call UAIPerceptionSystem::RegisterSenseClass directly first, or to use the templated UAIPerceptionSystem::RegisterSource method instead of RegisterPerceptionStimuliSource. Both of these workarounds require C++ I think.

Alright, cool. Thanks for the info kamrann. Unfortunately I don’t have any experience working on the C++ side of Unreal Engine. So I’ll stick with pawn sensing for now. Maybe try out AI perception when 4.8 hits the marketplace.