Heron Shallow Water Lab (2D)
2D companion to the 3D wading-bird scene: turbidity and prey-visibility sliders feed a Beer–Lambert style detection-radius formula, and herons stalk and strike real fish with a genuine intercept calculation instead of a scripted animation.
The 3D scene shows a heron hunting shallow water without exposing the mechanism behind it; this 2D lab makes that mechanism explicit and adjustable. A detection radius is computed each frame from two sliders through a Beer–Lambert style attenuation formula — higher turbidity and lower prey visibility both shrink how far a heron can actually spot a fish, and spotting itself is probabilistic rather than a hard cutoff, so fish near the edge of the radius are noticed far less reliably than ones close by. Once a heron spots a fish it computes a genuine intercept point from the fish's current position and velocity rather than chasing where the fish already was, closes the distance at a slow stalking speed, then attempts a strike whose success probability depends on how fast the fish is fleeing at that instant. Herons that go a while without a catch drain their energy budget and drop into a resting state until they recover. Drag the heron count, turbidity, prey-visibility and fish-density sliders and watch the hunt-success stats respond in real time.
A Beer–Lambert style formula (R = R_max · visibility · e^(−k·turbidity)) sets the detection radius; spotting inside that radius is a distance-weighted probability; pursuit uses a velocity-based fish-position intercept; strike success is a function of the fish's flee speed; and each heron carries an energy budget that gates stalking and recovers only after a successful strike.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install