Download

Generating Behavior Tree on run time

Hi all,

My goal is to be able to “generate” Behavior Tree in c++ while the game is running and attach these behavior tree to a Pawn.

I think I have two choices but I don’t know which one can be easily done and integrated in unreal.

Solution 1
Implement my own Behavior Tree System and call it from the player controller.
I’m not sure if this one is possible? What classes will my behavior tree classes extend from?

Solution 2
Use the current Unreal behavior tree system.
This solution implies that I can instantiate the behavior tree class and add node to it at runtime without using the behavior tree editor.
I’m not sure if all of this is possible.

Can someone tell me if this is possible and what are the pro’s and con’s on the two solutions?

Thanks a lot,

Maxime.

I probably shouldn’t be answering this as I have done exactly zero with the behaviour tree, but one question I’d ask is would it be better to implement all of the possible behaviour branches and use parameters to turn them on and off?

Hi Antidamage ,

Your solution will surely work but my goal is to procedurally generate these behavior tree so that emerging behavior could result from this creation.

Thanks for your reply,

If someone is interested on this subject, I receive a nice reply on reddit : https://www.reddit.com/r/unrealengine/comments/4chk4n/c_how_to_generate_behavior_tree_at_run_time/