Sorry if this is a silly question, but what would happen if you had a blackboard with a custom BTTask Blueprint set to “roam around”, and also had similar code inside the AI Blueprint set to “roam around” on event begin play? Would the AI ignore the Behavior Tree and just use the code in its Blueprint, or would the two conflict with each other?”
Hey @notao!
I don’t think it’s a silly question, it’s an interesting thought experiment. I would say to err on the side of caution and do checks on the Blueprint to make sure the AI is not tasking it with moving. The reason being is that movement is typically a looping action, and to have two movements going on at the same time you’re likely to get a crash. That being said two separate forms of movement would probably be okay, such as “MoveTo” and “Impulse” would likely stack, it wouldn’t be pretty but it has capacity to work its way out.
A Behaviour tree is a component acting upon the same actor, they might as well both be on the raw blueprint. If there are two looping things saying “Go to ___” but one is saying A and one is saying B, logic is broken and lo, crash. At least, that’s my educated guess. I don’t recommend doing it because things like that can ruin a project. And this is why we ALWAYS HAVE BACKUPS, right?
Hope that helps!
I wouldn’t go as far as saying crash. The last to execute would over ride the previous.
Move to → Move to. The first would fail and the second would succeed. Definitely would add a perf hit.
@notao Behavior Tree is your AI’s brain. Let it handle 100% of the movement and other tasks.
Even if they’re not on the same exec line? I guess I was mistaken in not thinking about how MoveTo has a failure condition. Don’t know why in my head MoveTo has an update pin.
Event Graph fires, then BT… as far as I remember.
It has a flow similar to Character → AnimBP Event graph → AnimBP Anim Graph
As soon as you deviate the plotted path of a Move To it fails. You can test it by interfering with it. If you can effectively block it the move to fires the fail.
A lot of behavioral patterns actively cancel the move to. Say you have a roamer and you shoot at it. Evasion logic kicks in effectively canceling the previous move.