Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining behaviors? #17

Open
frozen-banana-123 opened this issue Nov 15, 2020 · 0 comments
Open

Combining behaviors? #17

frozen-banana-123 opened this issue Nov 15, 2020 · 0 comments

Comments

@frozen-banana-123
Copy link

Hi! I've been having a lot of fun using this library. Thanks for sharing your great work! I'm working on making a sports game and have been considering using this library as a basis for the movement AI. I've been trying to combine different behaviors, but am having trouble getting it to work.

For example, I want to have a game object use both Arrive and Evade at the same time. Imagine a football player running towards the end zone, while also trying to move away from an incoming defender that gets close. I've seen other movement AI tutorials that use the concept of "blending" or "weighting" behaviors, so that you can combine different behaviors and give priority to one behavior over another. Sticking with my football example, I want the players top priority to be running to the end zone, but slightly changing course to try and put separation between him and an incoming defender.

I've tried adding in a "weight" variable to behaviors, and in the SteeringBasics "Steer" function, multiplying the weight by the existing "linearAcceleration" variable. I was hoping to achieve blending multiple behaviors like this, but haven't had any luck in getting it to work.

Has anyone been able to achieve blending multiple behaviors in any sort of way? Or is there something already built in to this library that would help me do this, and I have just plain missed how to do it? Any help would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant