Classic Boids/Vicsek models average the headings of every neighbor inside a fixed metric radius, as if each fish had 360° omnidirectional sensing. Real fish don't: their eyes cover a limited field of view with a blind sector directly behind, and a nearby fish can physically occlude the line of sight to one further away — exactly as studied in golden-shiner schools (Strandburg-Peshkin et al.; Rosenthal et al., PNAS 2015, "hidden networks of interaction").
Each frame, fish i scans every neighbor j inside its vision range that also falls within its forward field of view (excluding the blind zone). Each candidate's angular footprint in the visual field is approximated by its subtended visual angle:
θ_j ≈ 2·atan(r_body / d_ij) (apparent size — closer/bigger fish loom larger)
Candidates are then swept in order of increasing distance; any angular interval already covered by a closer fish is subtracted from a farther one's interval — a nearer fish literally blocks the view of one hiding directly behind it. Only the unoccluded fraction contributes. The resulting per-neighbor weight is
w_j = θ_j × visible_fraction_j
Steering combines three zones, closest priority first: an omnidirectional short-range repulsion (lateral-line pressure sensing, not vision — fish don't need to see a collision to feel it), a vision-weighted alignment toward Σ w_j·heading_j, and a vision-weighted cohesion toward the weighted neighbor centroid Σ w_j·(pos_j − pos_i). Heading turns toward the desired direction at a capped angular rate, not instantly.
Group order is measured with the standard polarization order parameter:
Φ = | (1/N) Σ (v_i / |v_i|) | ∈ [0,1]
Φ→1: everyone swims the same way (a true school)
Φ→0: headings cancel out (a disordered swarm/mill)
- Blind zone — widen it and each fish effectively goes half-blind behind itself; occlusion and the missing rear information slow how fast alignment can spread and Φ tends to fall.
- Vision range — how far a fish can resolve another fish at all, independent of angle.
- School size — more bodies means more mutual occlusion at fixed density.
- Turning agility — the physical cap on how fast a fish's body can rotate toward the vision-derived desired heading.
- Startle — injects a random-direction fright impulse into every fish, letting you watch the school re-polarize purely from vision-based local sensing.