Behaviour tree Task reference bug

I made a task for my behaviour tree for my AI to attack a target. Every time I load up my project it is renaming the reference for this task, and causing a crash when I try to run the project. It happened a few times with 4.4.3 as well, but I think only after a crash. Now in 4.5, it does it whether the editor has crashed, or saved and quit.

18221-badtask.jpg

I have to delete the task, and set it up again. The blueprint is named AttackTarget, and is a BTTask_BlueprintBase.

I have my behaviour tree blueprint in Game/Blueprints/EnemyAI/MainBlueprints
while all my task/service blueprints are in Game/Blueprints/EnemyAI
I think when I created these blueprints they were all in the EnemyAI folder, and then i moved them after. AttackTarget is the only blueprint this is happening to.

Callstack/error log thing:

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

Assertion failed: ((UObject*)ContainerPtr)->IsA((UClass*)GetOuter()) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.5\Engine\Source\Runtime\CoreUObject\Public\UObject\UnrealType.h] [Line: 351]
‘REINST_AttackTarget_C_1’ is of class 'REINS

KERNELBASE + 40541 bytes
UE4Editor_Core + 3174836 bytes
UE4Editor_Core + 1677496 bytes
UE4Editor_Core + 1566850 bytes
UE4Editor_AIModule + 532811 bytes
UE4Editor_AIModule + 537354 bytes
UE4Editor_AIModule + 1140804 bytes
UE4Editor_AIModule + 1138763 bytes
UE4Editor_AIModule + 1135862 bytes
UE4Editor_AIModule + 609634 bytes
UE4Editor_AIModule + 962005 bytes
UE4Editor_Engine + 8808057 bytes
UE4Editor_Engine + 9013865 bytes
UE4Editor_Engine + 5620079 bytes
UE4Editor_UnrealEd + 1895346 bytes
UE4Editor_UnrealEd + 6486374 bytes
UE4Editor!FEngineLoop::Tick() + 3524 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launchengineloop.cpp:2129]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launch.cpp:133]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Hi ,

Have you compiled the task blueprint and made sure all references are doing what they should be doing? Have you moved the task to another folder or filepath that could be causing this crash to occur? Additionally, can you post your crash logs and callstack here so we can have a look? Thank you!

The problem is that your BP implemented BT node instance magically turns into REINST_. We’ve seen this before but were never able to get a repro for it, so if you would be so kind and provided us with your project, cut down as much as you want as long as the repro is still there, then it would be huge help. Seriously, HUGE.

Thanks in advance!

–mieszko

I’m in the process of stripping the project down, but stripping it down to just the AI blueprints, and it doesnt reproduce. I started only deleting portions and quitting, and reloading the project to see what would stop it. If I delete all the nodes in my PlayerController, it stops breaking the reference.

edit: I cleared ONLY the nodes in my PlayerController, and it stopped renaming the attacktarget reference. I didnt fix the references before exiting the editor last time, and they are fixed upon loading.

I think I’ve nailed down what was directly causing the issue, though I have no idea why. My PlayerController references my behaviour tree through a SpawnAIFromClass node. Deleting that node fixed the issue. I will try leaving only that and see if it still happens. EDIT: nope, that didnt do it.

Also as a note, I had the Reference Viewer tab open on the main set of tabs, and when I reloaded it loaded partially as a ‘unrecognized tab’

Ok, I’ve tried only deleting different sections of code, clearing most of my building references in the level seem to clear it, deleting the SpawnAIFromClass node in my PlayerController seems to clear it… So I’m out of ideas for nailing this down. My full project is about 700mb, so I’m not able to email or upload it anywhere.

Hi ,

I apologize for my delayed reply. Have you updated to 4.5.1? If so are you still experiencing this error?

I’ve updated to 4.5.1 and I was still getting the issue. However, I moved the AI controller, blackboard and behaviour tree blueprints from /MainBlueprints into the main folder with all the tasks/services and such, saved, and exited the program. When I reloaded the project, the bad reference was fixed.

Hi ,

Were these assets originally in the main blueprints folder and then moved to a new folder when the error occurred? If so moving back fixed the error for you? This would make sense if the assets references were not fixed after moving the assets to a new folder. They were referencing the original filepaths and not the new filepath if this was the case.

I think originally they were in the same folder. Which is what I was thinking the problem was. I was attempting to organise the blueprints a little better.

Hi ,

Just to confirm: The files were originally in the main blueprints folder. They were later moved for organization (error occurs). moving them back to the main blueprints folder fixed the error. If this is the case then when you move the files, make sure to re-reference the assets who have moved in any blueprints that are referencing them. This will solve the error. We are looking into automating this system, however I do not have a timeframe of when that will be available.

Yes that sounds right. I’m not sure how to re-reference, but for the time being I am going to leave everything in the main AI folder. Thanks for the help :slight_smile: