reeseschultz / ReeseUnityDemos

Unity packages and demos—emphasizing ECS, jobs and the Burst compiler—by Reese and others.
https://reese.codes
MIT License
515 stars 45 forks source link

Feat/flocking Collision avoidance for the flocking system #71

Closed 0x6c23 closed 3 years ago

0x6c23 commented 3 years ago

This is an addition to the flocking/ steering systems. If flocking gets applied to an entity, it will gently (scaled by distance) steer away from obstacles. It limits clipping greatly, but it doesn't guarantee that it never happens. For that I think something else needs to be implemented. This works great, though.

I added the NavCollisionSystem and some settings. I also renamed CollisionAvoidanceStrength to respectively ObstacleCollisionAvoidanceStrength and AgentCollisionAvoidanceStrength. The new gif reflects the new changes.

reeseschultz commented 3 years ago

@0x6c23, would you mind checking the box with the label Allow edits from maintainers? There are instructions on that here.

I think there are some slight changes I want to make to your branch before we merge.

0x6c23 commented 3 years ago

It already is checked for me @reeseschultz

reeseschultz commented 3 years ago

I made some changes, most importantly making the obstacle steering optional via a component tag.

Thanks again, @0x6c23. You've done great work. If you plan on contributing more to this project or have any ideas you want to bounce off my head, please let me know. I can add you as a collaborator to this repository if you'd like. You can DM me on Discord via Reese#1275. Alternatively, Twitter works as well via ReeseCodes.

0x6c23 commented 3 years ago

I am definitely going to contribute more, adding me as a collaborator would be great. I'll likely DM you on discord. Thanks!