
My reef sim's fish were swimming through the algae they weren't eating — fixed it with a 27-year-old steering behavior I didn't know I'd half-implemented already
Small technical post. I've been building a boids-based reef sim (fish graze, sharks hunt, decomposition feeds new growth). Added chunk avoidance a while back so creatures wouldn't swim straight through debris — worked fine, but only for chunks. Fish still swam right through algae nodules they weren't currently targeting.
Went looking for the "right" way to think about this and found out I'd already been implementing Craig Reynolds' 1999 steering taxonomy without naming it — force_separate, force_align, force_cohere, force_arrive map exactly onto his Separation/Alignment/Cohesion/Arrival. The piece I was missing had a name too: Obstacle Avoidance, listed right alongside Seek in his original paper. Not a new mechanic — the one I hadn't built yet.
Generalized it: every creature now avoids every nearby "node" — algae or debris — except whatever it's actually seeking. Sharks that have never had a reason to notice algae at all now dodge it in their path without ever being drawn toward it. The reef reads noticeably more alive with almost no new code, just the missing 20% of a pattern that was already 80% there.