Post

made some fish schools! kind of a fake boids algorithm that i made up then some test enemies attacked me while i was trying to get a better look 😄 #indiedev #gamedev

6 reposts29 likes

Basic idea is you're moving around a point which is the center of the fish school, and the fish try to stay at some offset from that fish offsets are defined by a fibonacci sphere + random radius which mostly guarantees no overlapping fish without doing per-fish avoidance

Each fish animates to its desired position (the offset from school center), via velocity + rotation The fish school as a whole does sphere collision with the environment to mostly avoid fish clipping through obstacles + various polish like fluctuating the school radius, fish wiggle shader, etc