Integrating Behavior Designer

You can use my assets with any AI solutions. However, you many need to create a bridge between the assets. In the case of Behavior Designer, I’ve done some of that for you.

With Behavior Designer, we create custom actions and conditions that call into the ootii components. I’ve created some common actions and conditions as well as some demos. However, you may need to add more for your unique game.

While the video below highlights Node Canvas, the integration with Behavior Designer is exactly the same. I simply ported the Node Canvas code over to Behavior Designer. Your flow would be very similar, but with Behavior Designer specific workflow.

 

Setup

  1. Import the latest Motion Controller.
  2. Import Behavior Designer 1.5.10 or higher.
  3. Import my integration package.

 

Actions and Conditions

You’ll find the actions and conditions here:

\Assets\ootii\_Integrations\MotionController\Opsive\BehaviorDesigner

By looking through the folders, you should get an idea of the kind of actions and conditions I’ve added. For example, the ‘Set Attribute Float’ action sets an attribute value that is a float.

As far as I could tell, Behavior Designer doesn’t allow developers to customize the actions and nodes much. So, the UI is a bit rough. For example, I can’t show a nice drop-down for the Condition Index property.

In this case, you’ll have to remember the following:

0 is =
1 is !=
2 is <
3 is <=
4 is >
5 is >=

 

Navigation

One of the easiest ways to let your character be moved by AI is to simply check the Actor Controller’s Use Transform option. This will allow external code (like Behavior Designer) to control the position and rotation using the standard transform properties.

The other option is to keep the Actor Controller’s ‘Use Transform’ option unchecked and allow the Motion Controller to move the character by simulating user input.

Both options are valid.

NavigateTo Action

The NavigateTo action is a powerful action that can be used to move your character using Unity’s Nav Mesh and Nav Mesh Agent.

The Use NavMeshAgent Position property coincides with the ‘Use Transform’ property mentioned above.

By setting a Focus Target, you can have your character move in one direction while facing another. This is great for combat. However, it requires one of the ‘strafe’ motions to be enabled.

The Voxel Size property helps when the nav mesh is created above the ground. We’ll offset the character by the specified amount.

Page Contents