Hey! Purchased the asset and this is my first post here, ever.
I am learning Behavior Designer and I thought the simplest way would be to start simple, so I tried to implement a BT that picks a random location on a grid and walks to it (using A* Pathfinding Project for pathfinding and movement), then repeats. However, doing this I encountered a problem which I'm not sure about how to solve correctly, so it's more of a question about patterns and how things are done in Behavior Designer.
Here's an image of what I want to do:
What
- get a random Vector3Int (the location in the grid)
- walk to that location
- wait a random interval
- repeat
Now, this is a really simple example, so I could just place a Wait task in a sequence next to
1. Should it be a separate behavior tree, or is there a way to group them and sort of minimize them (expand and collapse)?
2. Next, how should I be getting that random location? Is there any type similar to a conditional task or a decorator task (or perhaps I should use one of those?) that would just return that location, or should I do all of this in the Wander task's
3. Finally, because
Any input or suggestions are appreciated as I am completely new to Behavior Designer.
I am learning Behavior Designer and I thought the simplest way would be to start simple, so I tried to implement a BT that picks a random location on a grid and walks to it (using A* Pathfinding Project for pathfinding and movement), then repeats. However, doing this I encountered a problem which I'm not sure about how to solve correctly, so it's more of a question about patterns and how things are done in Behavior Designer.
Here's an image of what I want to do:
What
Wander
is supposed to do:- get a random Vector3Int (the location in the grid)
- walk to that location
- wait a random interval
- repeat
Now, this is a really simple example, so I could just place a Wait task in a sequence next to
Wander
, but if it got a lot more complex I'm wondering if:1. Should it be a separate behavior tree, or is there a way to group them and sort of minimize them (expand and collapse)?
2. Next, how should I be getting that random location? Is there any type similar to a conditional task or a decorator task (or perhaps I should use one of those?) that would just return that location, or should I do all of this in the Wander task's
OnStart()
method, because that's what I'm doing now.3. Finally, because
Wander
only needs to get a random location, walk there, and wait, how would I re-use the "walk" task without having to put that entire "walk" code in the Wander
action all over again? Should Wander
be a seperate behavior tree where I would have a sequence with the Wander
Task, which gets a random location in OnStart()
, then next in the sequence is the MoveTo
task which I can reuse elsewhere, and then finally I can add the Wait
task. Then in the main BT, I would link this external WanderBT?Any input or suggestions are appreciated as I am completely new to Behavior Designer.
Last edited: