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

Boid Twitch/Forcefield Fix #4

Closed
Xevion opened this issue May 24, 2020 · 2 comments · Fixed by #19
Closed

Boid Twitch/Forcefield Fix #4

Xevion opened this issue May 24, 2020 · 2 comments · Fixed by #19
Labels
state: approved Approved to proceed. type: fix Iterations on existing features or infrastructure. work: chaotic The situation is chaotic, novel practices used.

Comments

@Xevion
Copy link
Owner

Xevion commented May 24, 2020

This is most likely one of those problems that may never go away without deep investigation or violent changes to the code - or may go away with just a few lines of code.

Boids tend to bounce of other boids much too violently, they 'twitch' and hit what one could call invisible 'force fields' on other boids. Sometimes the separation range used is so small that the line between a simple physics collision and an actual separation rule is largely gone.

This fix could improve the quality of the base mechanism of the whole application. A method to 'smooth' Boid movements is needed.

@Xevion Xevion added state: inactive This will not be worked on work: chaotic The situation is chaotic, novel practices used. type: fix Iterations on existing features or infrastructure. labels May 24, 2020
@Xevion Xevion added state: approved Approved to proceed. and removed state: inactive This will not be worked on labels May 27, 2020
@Xevion Xevion linked a pull request May 27, 2020 that will close this issue
@Xevion
Copy link
Owner Author

Xevion commented May 27, 2020

After implementing Sebastian Lague's method for applying and calculating velocity (using Time.deltaTime in particular), as well as new clamp/lerp/speed calculations, the boids move much smoother.

As a side effect however, they separate very slowly and large groups can pass through eachother while barely even trying to separate. Collisions are the norm.

Additionally, I'm a little worried that all of this code wasn't even the problem with my application - while debugging I noticed that my Separation Range was double my Group Range. They were quite literally operating with a forcefield like tendency while alignment and cohesion were balanced to just barely get the Boids to line up.

And now, another problem has arisen - It's very easy to get the Boids to combine into large flocks by adjusting even a single Bias. I don't really know what's going on.

Regardless, twitching has been fixed. See #19 for changes.

@Xevion
Copy link
Owner Author

Xevion commented May 28, 2020

Associated C# Scripts by Sebastian Lague used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: approved Approved to proceed. type: fix Iterations on existing features or infrastructure. work: chaotic The situation is chaotic, novel practices used.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant