Aquaworld 1.0

by josh king

Introduction

When fish swim in schools in the ocean there is no "leader fish". Rather, each fish evaluates its surroundings and makes a choice of what to do and where to go based on sensory feedback. Aquaworld takes this approach at simulating schooling fish. Each fish will take into account its speed, how close it likes to be to the other fish, how interested it is in following the school, and how far away from the walls to stay.

Algorithm

The fish tank was divided into bins, which will simulate the fish not caring about distant activities, only those in its immediate surroundings. Then the fish will evaluate various forces in the tank. For example, the fish will determine how close it is to a wall. The closer it gets to the wall, the stronger its desire is to not hit it. This exponential increasing of forces is what drives the fish to slowly curve away from the wall. If it gets dangerously close, the fish will take a much stronger evasive action that if it is just casually swimming close to the wall.

The fish also want to be with the other fish. So they take into account where the other fish are and they tend, but don't have to, follow the group. They try to be at the center of the group and at the same time try to swim along with the general momentum of the school. Avoiding mid-sea collisions is also an important part of the algorithm. The "close, but not too close" rules keep the fish at a sort of dynamic equilibrium.

Instructions

Camera movement
The camera tries to maintain a cinematic feeling while watching the fish. to cycle through the fish, use the tab key.
Add a new fish
You can add new fish to the tank by clicking the "Add Fish" button. There is no hard coded maximum for the fish. You are only limited by your computing power.
Remove a fish
You can remove all but one fish from the tank.
Speed
There are three speeds: fast, medium, and slow. They determine how quick the little buggers swim.
Wall Repellent
Wall repellent determines how much of a "force field" the wall projects. Increasing the strength will keep the fish closer to the center of the tank.
Independence
Independence determines how much of an influence the school's direction effects each fish. A lower setting will make it more likely the fish will go about their own business.
Proximity
The proximity determines how vigorously the fish will try to get to the middle of the school. This setting effects how "clumped" the fish will try to be.

Inspiration

Flocks, Herds, and Schools: A Distributed Behavioral Model

About the author

Josh King is fifth year computer science student at RIT. He needed an extra class to get financial aid so he decided to take Multi-user Media Spaces (an IT course). He wound up implementing a complex adaptive system in Macromedia Director. Good fun!