How to setup a behavior tree?

So I recently learned about a plugin that lets you make behavior trees so I’ve been trying to learn about them as it will be very useful for trying to make the AI in my game, however, I’m a bit confused on I guess how to structure one.

Here’s the approach I’m currently trying to take have each action the AI can make and then just expand on the node to see if it can make the action

I’m confused on a few things though mainly is it better to make one big tree like this would be? Or should I break it up into multiple trees? Also for things like attacking there can be multiple different choices like should am I close enough to attack? Do I wanna do a range move? Do I wanna get closer? Is the player doing something that I should react to? (ex: blocking) etc. Can’t seem to figure out how to plan all of this.

I know this is a mess though and probably not good lol.

1 Like

Not to be rude but this is for scripting not for node editors. As for your question it seems more like preference and it wouldn’t actually do anything other than look nicer.

Technically this should be in #help-and-feedback:game-design-support instead.

It would probably be better to organize each behavior tree based on their category, like Pvp is one tree of it’s own. ‘Eating’ would be another etc.
So in your case, one big tree dealing with PvP would do you good.

However this plugin seems to be pretty nice, though all of it can be scripted instead.