unreal, blackboard only runs once

by Kenton Koss 6 min read

How do I get the blackboard?

Exec. Blackboard Component. Blackboard Component Object Reference. The Blackboard component that was used or created to work with the passed-in Blackboard Asset. Return Value. Boolean. true if we successfully linked the blackboard …

What is the difference between a behavior tree and Blackboard?

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.

How hard is AI in Unreal Engine 4 C++?

They are just a way to conceptually perform several tasks at once. Often they still run on the same thread and begin in some sequence. That sequence should be irrelevant since they will all happen in the same frame, but it is still sometimes important.

What is a behaviour tree in Unreal Engine?

The name the node should display in the Behavior Tree graph. This will cause the operations to be listed on the node in plain text. Using a Composite Decorator in this manner will impact memory and performance. It is possible to create a Decorator in C++ that will do same custom behavior but in a more efficient way.

image

What is compare bbentries?

The Compare BBEntries (Blackboard Entries) node will compare the values of two Blackboard Keys and will block or allow the execution of a node based on if the result is equal to or not equal to.

What is a decorator in a behavior tree?

Decorator, also known as conditionals in other Behavior Tree systems, are attached to either a Composite or a Task node and define whether or not a branch in the tree, or even a single node, can be executed.

1 - Required Project Setup

In this first step, we set up our project with the assets we'll need for our AI character to get around the environment.

2 - Blackboard Setup

In this step, we create our Blackboard asset, which is essentially the brain of our AI. Anything we want our AI to know about will have a Blackboard Key that we can reference.

3 - Behavior Tree Layout

In this step, we will lay out the flow of our Behavior Tree and the states that we want our AI to enter. Laying out your Behavior Tree with the states you anticipate your AI could be in as a visual flow will give you an idea of what type of logic and rules you will need to create to enter those states.

4 - Task Setup - Chase Player

In this step, we set up our Chase Player Task to change the movement speed when chasing the Player.

5 - Task Setup - Find Random Patrol

In this step, we set up our Find Random Patrol Task so our AI moves to a random location when it is not chasing the Player.

6 - AI Controller Setup

In this step, we do a little bit of work inside the AI Controller in preparation for the final step, setting up a Decorator to determine which branch of our Behavior Tree to enter.

7 - Decorator and Final Setup

In this final section, we adjust a few settings on the Player Character and Enemy Character Blueprints. We also set up our Decorator in our Behavior Tree which will determine what branch we can enter based on a specified condition.

image