3. Escape Behaviour - LariWa/BoidSimulation GitHub Wiki

To make the Boid Simulation more dynamic and lifelike, we decided that we wanted to add an Escape Behaviour if a Boid detects a Threat.

Related work

Delgado-Mata et. al. [1] extended Reynolds' Boid algorithm to integrate the effects of fear. Each Boid can "feel" emotions, which will affect its decision making. Additionally, the emotion is communicated through virtual pheromones, so that the flocking behaviour is affected. Therefore the Flocking behaviour algorithm from Reynold is extended with the additional rule for escape (see Figure 1). The fear factor influences the cohesion and escape rules, therefore the boids try to stay close to each other and escape the threat.

Figure 1 - Influences of the Fear factor on the Flocking Behaviour (from [1])

Our Implementation

We implemented a simplified version of Delgado-Mata et. al. proposed implementation. Through raycasting, each boid, can detect threats around it. Depending on the distance to the threat, the fear is calculated. Additionally, the fear of the nearby Boids is added. We simply add the fear of the nearby perceived Flockmates, and don't use virtual pheromones like Delgado-Mata et. al. If a threat is detected, the Boid will steer away from the threat with an increased speed. If a collision and a threat are detected, the boid will not directly steer away from the threat, but will choose a direction, which avoids both the collision and the threat.

Click the image below to see a video demonstration.

EscapeBehaviour.mp4

References

[1] C. Delgado-Mata, J. I. Martinez, S. Bee, R. Ruiz-Rodarte, and R. Aylett, “On the Use of Virtual Animals with Artificial Fear in Virtual Environments,” New Gener. Comput., vol. 25, no. 2, pp. 145–169, Feb. 2007, doi: 10.1007/s00354-007-0009-5.

⚠️ **GitHub.com Fallback** ⚠️