External Behavior Tree Yields different results when run on it's own vs. as a node in another tree.

Safemilk

New member
Hey, sorry if this is somewhere else or explained, I've been scouring!

I ran into something strange with external behavior trees.
Just like in the example given conceptually, I have an AI who stores his shoot functionality in an external tree.

If I run the tree as the main behavior tree it runs as expected, with the AI smooth damping his Aim IK to the fire point, which is a randomly chosen point inside of a sphere inside of another sphere... don't think too much on that... basically the spheres are possible aim points and then micro recoil, the change in size based on factors like being able to see the player etc.

So far so good... HOWEVER, if I run this tree as a reference, almost everything works the same EXCEPT, the SetIK Target node seems to report success and then skip the Shoot Actual node until the distance the IK aim point needs to travel gets smaller as the aiming spheres shrink.

The best guess I can make is that the smooth damp is now running at a different rate of some kind now that it's in an external tree reference, and that it never QUITE reaches it's destination.

Any thoughts/feedback/insight on why this might be happening? I love the idea of externalizing certain behaviors and dropping them in as sub trees, in fact, my plan was to make some pretty modular designs around that, but I don't want to push too far until I know why this might be happening.

Thanks!

Screenshots below.
1663707429590.png
1663707400647.png
 
External behavior trees exist at the project level so they cannot store scene references. I'm not sure what your SetIKTarget task looks like but you will need to make sure you load the references at runtime since they cannot be set at edit time.
 
External behavior trees exist at the project level so they cannot store scene references. I'm not sure what your SetIKTarget task looks like but you will need to make sure you load the references at runtime since they cannot be set at edit time.
So far my paradigm has been to store that info on the actual AI and access it that way, it's possible I got a little sloppier with some of the look IK stuff, I'll check that out. Thanks for the response!
 
I'm a foolish fool. So later in the tree there is a parallel complete that makes it so he can shoot while he's moving, and that seems to be interfering in a super detrimental way with the loop. So it was definitely my mistake to think it was having to do with external trees!

I'll have to find a way to make these portions of the tree play nicely together!

Thanks for helping me narrow it down!
 
Top