Custom behavior tree services & tasks not working after editor restart

I have created a behavior tree in the experimental editor and added a custom blueprint service to a node. Everything looks and works fine when it’s first added, but after restarting the Unreal Editor the service in the tree appears to have a strange new class name and will not execute. For example, the initial name of my service Blueprint shows as BTS_UpdateEnemy. After restarting the editor, the service node in the tree now shows the class REINST_BTS_UpdateEnemy_C_10. Removing and re-adding the service to the tree fixes it but must be done each time the editor restarts.

This issue also seems to affect custom tasks, as reported by someone else here. It may have only shown up after upgrading to 4.1, though I’m not certain.

I have tried recreating the node the service is attached to, and also re-parenting and recompiling my service Blueprint. I have not yet tried completely recreating the behavior tree or service Blueprint.

Thanks!

I have the same issue. I’ve tried re-creating everything from scratch multiple times, and I still have this result. As stated above, everything works fine until I re-open the editor.

Still having the issue, any devs seen this?

Hey,

I have been investigating this issue and have a few questions. Does this occur only in projects that were converted from 4.0.2? If you recreate the service or task, does it happen still? Finally, have you tried making a brand new Behavior Tree with some basic logic to see if it will become corrupt? Any additional information may help.

Thank you,

I’m doing some testing and it appears that this is only occurring in my behavior tree that was converted from 4.0.2, and not in a new tree that I created in 4.1 (so I guess I could work around this issue unless it shows up again later).

It also appears to have something to do with the contents of the custom service blueprint. Removing certain parts of the event graph in my service blueprint stops the issue from occurring. The same applies to a new service blueprint I’ve just created - copying my old service’s event graph into the new service causes the error, but removing certain parts of it resolves it.

I haven’t determined yet exactly which nodes are the problem, but it’s somewhere in this graph:

I’m having this issue as well, any time I start up the editor I have to remove and re-add the service.

The issue has reappeared in my new behavior tree created in 4.1.1. I also tried recreating the service blueprint but that didn’t work either.

I’ve narrowed this issue down further. It only occurs when, in my service blueprint, I access a variable belonging to the owning AIController (which for me is a custom extension). It only occurs when I access variables declared in my custom controller, and not when I access any variables it has inherited. Of course I need access to my controller’s variables, so I don’t see any clear workaround.

Hi, I´m also encountering this problem.
I migrated my project form 4.0.2 and can confirm that a new creation of the BT does not fix this.
I also can confirm that is only affects my decorator which accesses a variable which comes wich the actors controller by the “Event Receive Condition Check” event. If I remove the access to the variable the problem does not occur.

Here’s a solution provided by DarkHorror in the forum thread linked in my question:

The problem is created when trying to
access other objects and object
variables in your Task or other
behavior tree type blueprints. All you
need to do to fix that is simply add
those objects to your blackboard and
access them through the blackboard
rather than trying to do it directly.

It doesn’t seem like this should be necessary, but it’s a good workaround for now!

I’ve tried that workaround and didn’t work for me. Still crashing. Still inoperative. Need a solution!

It turns out that I couldn’t implement the workaround because I need access to an array, which blackboards don’t seem to support. So I’m still waiting for a real solution as well.

Just wondered, have you tried reinstalling the engine completely? I don’t understand why 4.1 works for me and not for you. I did the verify install on 4.2 made no difference. I think I’ll try removing and re installing 4.2 later, I’ll let you know what happens.

Any you’d be okay with zipping up a BT and BTT asset that work for you in 4.1 but not in 4.2? I can see if they work for me in 4.1 and if not then maybe it’s something with my engine install.

mail me replace the * ill send you some files that do exactly that.

Finally some good news! I built the editor from the source (it was tagged as version 4.2.1) and indeed, no more problems. So hopefully it’ll be fixed for after the hotfix next week!

For me the problem was related to a function declared in a Blueprint FunctionLibrary and used in a BTT.

This function was casting the actor to my character class.

On version 4.6.1 only the last one of the problematic BTT was corrupted.

My solution was to use the code directly in the BTT without using the function.

Hi there, just wanted to give an update.

We have a fix for REINST_ errors coming soon.

To clarify, the method of communicating between tasks, services and decorators should be to use your black board as described by dbc211. Since the original question was posted, we now offer a complete quickstart guide that will help to clarify what the best practices are with behavior trees. Here is the guide if you are interested:

https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/