Questions tagged [behavior-tree]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
72 votes
1 answer
38k views

Difference between Decision Trees & Behavior Trees for Game AI

What are some differences between Decision Trees and Behavior Trees for AI Game Development? For what applications would you use one over the other?
Free Lancer's user avatar
  • 1,263
26 votes
6 answers
6k views

Preempting Behavior Trees

I'm attempting to get my head around behavior trees, so I'm spiking out some test code. One thing I'm struggling with is how to preempt a currently running node when something of higher priority comes ...
me--'s user avatar
  • 942
19 votes
1 answer
5k views

Behavior Trees :: Actions That Take Longer Than One Tick

From what I understand on Behavior Trees, each Behavior should be a short goal oriented Action that could be done in a few iterations. So for example, below is an image of a Behavior Tree: Now let ...
Free Lancer's user avatar
  • 1,263
5 votes
2 answers
2k views

Behavior tree implementation details

I have been looking around for implementation details of behavior trees, the best descriptions I found were by Alex Champarand and some of Damian Isla's talk about AI in Halo 2 (the video of which is ...
angryInsomniac's user avatar
3 votes
2 answers
925 views

Behavior Tree Iteration Rate

How is a Behavior Tree iterated in a game? For example, let's assume you have an extremely large Behavior Tree with about a hundred Actions/Conditions. If we were to run one action or condition ...
Free Lancer's user avatar
  • 1,263
3 votes
1 answer
624 views

Characters ai code organization

I want to create a an ai with finely customizable character. The ai should be able to handle generic behaviors, like scheduled activity, shared across all character, but have specific override for ...
user29244's user avatar
  • 327
2 votes
1 answer
968 views

How do I end a behavior tree's action early without evaluating the entire active branch?

I'm reading about behavior trees, and one of the common recommendations I've seen is to maintain a reference to your running action so that you don't have to traverse the entire tree during every game ...
Ben Rubin's user avatar
  • 167
2 votes
1 answer
2k views

How much logic should be in an individual behaviour tree node?

Let's say I have a condition node which has to spend a lot of time calculating something to finally return a bool to the behavior tree. But in the following action, we need this information again. I ...
Ramon's user avatar
  • 145
2 votes
1 answer
164 views

How do I Invert a Guard in GDX-AI?

I am trying to define an AI behavior where if a conditional (MyCondition) is false, execute the task. I know I can do this as follows: ...
John's user avatar
  • 660
2 votes
1 answer
479 views

Ternary conditional in behaviour trees?

When designing a behaviour tree that controls an agent, is it possible to construct the tree so that the agent first attempts task A, then depending on whether task A succeeds it attempts either task ...
HelloGoodbye's user avatar
2 votes
0 answers
180 views

Scheduler for Event Driven Behaviour Tree

The Behaviour Tree Starter Kit (BTSK) on GameAI Pro suggests using a scheduler for an event driven behaviour tree. To recap: A behaviour tree (BT) is traversed fully every time the root node is ticked ...
Ralph's user avatar
  • 23
1 vote
2 answers
1k views

Interrupt on behaviour tree

I'm using a custom Behaviour Tree library (not UDK or any other engine) so I'm wondering on the best way to cause an interrupt to a currently running node. I don't have decorators or parallel nodes in ...
user441521's user avatar
1 vote
1 answer
75 views

How should I share the states amongst all the executions of a Behaviour Tree triggered from all ticks?

I'm still learning about Behaviour Trees and my understanding of the "blackboard" is essentially a state object. When passing the state object through the ticks to the function calls (which ...
xenon's user avatar
  • 437
1 vote
1 answer
866 views

Behaviour Trees: How to clean up when a sequence is interrupted?

I'll try to show my problem on a minimal example, in reality it's more complex: It's a simple behaviour, that repeats "an action" that has a certain animation. If a player gets close, this ...
Paprik's user avatar
  • 151
1 vote
2 answers
2k views

Single or Multiple Behavior Trees?

I just finished coding a generic Behavior Tree structure for my games. My question is, when creating behaviors for enemy AI's, do I create one large behavior tree with every possible configuration as ...
Free Lancer's user avatar
  • 1,263
1 vote
0 answers
789 views

What are Unreal Engines Pawn Action's Used for?

Inside of a Behavior Tree you can create a task called Push Pawn Action, and it appears you can select between several types of actions or create your own. What is the purpose of this and how is it ...
Aaron.Bidwell's user avatar
1 vote
1 answer
913 views

Implementing priority structure into a behavior tree, to react to player actions

My goal is to have a behavior tree that can run alone (autonomously) but also react to input from the player. I'm making an AI for a hack and slash game where the AI will fight you, chase you, etc. ...
Angelo's user avatar
  • 38
1 vote
0 answers
169 views

Using behavior tree with custom pawn and movement component

I am trying to have a custom APawn along with its custom UPawnMovementComponent and AIController, to move to a location using the MoveTo node of a behavior tree. I've followed the code in the engine ...
Stud's user avatar
  • 121
1 vote
0 answers
352 views

Behaviour trees and agent sensors

Assume I have a behaviour tree like the following: [A] / | \ [B] [C] [D] A = Selector (Priority node) B = Perception task C = Idle task D = Walk to point ...
brazorf's user avatar
  • 111
0 votes
3 answers
3k views

Behavior Trees or GOAP for Rimworld-like game?

I am currently making a Rimworld-like game. For now, it is identical in appearance, how the map works and how the pawns (colonists) are supposed to function. Core world-generation logic and A* ...
caleidon's user avatar
  • 561
0 votes
1 answer
311 views

Data in blackboards of behavior trees

In Ian Millington's "AI for Games" it is stated that behavior trees should not actually own any data, and instead a blackboard can be used to store data nodes of a behavior tree need to know ...
Ralph's user avatar
  • 23
0 votes
2 answers
2k views

Behavior tree: why?

I am new to UE4 and game programming altogether. Following multiple tutorials and documentations I see mentions of behavior trees. In tutorials they do not use them in favor of blueprints because they ...
psznm's user avatar
  • 13
0 votes
0 answers
178 views

Behavior tree: tick frequency and fast-running tasks

My behavior trees tick at 1Hz, while the rest of the game logic runs at 60Hz. This means even simple tasks can't be accurately managed by tree nodes. For example, "turnToFaceTarget" can set ...
alekop's user avatar
  • 641
0 votes
1 answer
39 views

Behavior tree: invert grandparent's return value

I'm trying to figure out how to return one result to the immediate parent, while returning a different one to the grandparent. The idea is: given a "turnToFaceTarget" tree, skip the rotation ...
alekop's user avatar
  • 641
0 votes
1 answer
106 views

(Fluid Behavior Tree) Random NavMesh position returning the same position, instead of calculating a new one

I have a NavMesh agent that wanders around every x seconds, moves to a random position, and lastly it repeats the sequence. I made a test using a coroutine, which was called through a context menu ...
YoshGJ's user avatar
  • 495
0 votes
0 answers
315 views

What is the earliest documented use of behavior trees?

I'm curious about when behavior trees first appeared in the context of AI design. I've looked at many sources (e.g., GDC talks, academic literature such as Behavior Trees in Robotics and AI: An ...
Reign of Error's user avatar
0 votes
1 answer
722 views

In behavior trees, how do you retain your place in a sequence?

For context, I am coding a naive implementation of behavior trees myself, in C#. Let's say I have two scenarios that I want to create behaviors for. Both AI's will traverse/patrol four specific ...
Takaji Messer's user avatar