官术网_书友最值得收藏!

Flocking, swarming, and herding

Many living beings such as birds, fish, insects, and land animals perform specific operations such as moving, hunting, and foraging in groups. They stay and hunt in groups because it makes them stronger and safer from predators than pursuing goals individually. So, let's say you want a group of birds flocking, swarming around in the sky; it'll cost too much time and effort for animators to design the movement and animations of each bird. However, if we apply some simple rules for each bird to follow, we can achieve the emergent intelligence of the whole group with complex, global behavior.

One pioneer of this concept is Craig Reynolds, who presented such a flocking algorithm in his 1987 SIGGRAPH paper, Flocks, Herds, and Schools – A Distributed Behavioral Model. He coined the term boid that sounds like bird, but refer to a bird-like object. He proposed three simple rules to apply to each unit:

  • Separation: Each boid needs to maintain a minimum distance with neighboring boids to avoid hitting them (short-range repulsion)
  • Alignment: Each boid needs to align itself with the average direction of its neighbors, and then move in the same velocity with them as a flock
  • Cohesion: Each boid is attracted to the group's center of mass (long-range attraction)

These three simple rules are all that we need to implement a realistic and a reasonably complex flocking behavior for birds. We can also apply them to group behaviors of any other entity type with little or no modifications. We'll examine how to implement such a flocking system in Unity in Chapter 5, Flocking.

主站蜘蛛池模板: 惠水县| 九寨沟县| 桐柏县| 绵竹市| 鄂温| 边坝县| 秦安县| 松江区| 濉溪县| 正阳县| 阳西县| 陇西县| 禄丰县| 乐业县| 东丽区| 梨树县| 合阳县| 兰州市| 西充县| 壤塘县| 元江| 大埔区| 昌江| 高州市| 武威市| 达拉特旗| 大田县| 祁东县| 三原县| 稷山县| 庆元县| 黔东| 海口市| 上虞市| 略阳县| 安图县| 南和县| 大化| 中江县| 潮州市| 芒康县|