What's going on here?

The schooling behavior you see is based off of Craig Reynolds' boid flocking model. In his model, each creature has three behaviors, separation (don't bump into your neighbors), alignment (go in the same direction as your neighbors), and cohesion (stay with your neighbors). The three sliders you see control the magnitude of these forces. The "neighborhood" slider controls how large of a neighborhood each fish has. So if your neighborhood is small it means you are only going to align and cohere to other fish that are only really close to you. While if the neighborhood is large, you will also align and cohere with fish that are farther away.

When a fish flashes white, it means that it's scared. The skittishness slider controls how comfortable the fish feel around a shark.

Play around with these sliders and see what types of school behaviors you can create!

Resources Used: "The Nature of Code" by Dan Shiffman

hide