Bait Ball Ecosystem

Creative Coding

Tools: p5.js, Processing

Fish are friends…
And maybe also food?


Each fish in this system is an autonomous agent, aware of its surroundings and able to make decisions based on that environment. Schooling behavior was achieved using Craig Reynolds' flocking model, in which each fish has three key behaviors: separation (don't bump into other fish), alignment (go in the same direction as the school), and cohesion (stay close to other fish). Fear behavior is derived from the separation algorithm, except that now fish are really not trying to bump into a shark!


I made this project as I followed my way through Dan Shiffman’s, “The Nature of Code.”

Creative Coding

Tools: p5.js, Processing

Fish are friends…
And maybe also food?


Each fish in this system is an autonomous agent, aware of its surroundings and able to make decisions based on that environment. Schooling behavior was achieved using Craig Reynolds' flocking model, in which each fish has three key behaviors: separation (don't bump into other fish), alignment (go in the same direction as the school), and cohesion (stay close to other fish). Fear behavior is derived from the separation algorithm, except that now fish are really not trying to bump into a shark!


I made this project as I followed my way through Dan Shiffman’s, “The Nature of Code.”

Copyright © 2024 Sebastian Viasus