Each triceratops is a point-mass steered by summed accelerations, integrated with simple Euler stepping every frame:
- Forward drive — constant push toward the far bank, scaled by herd density (a tighter herd advances more confidently).
- River current — a turbulent lateral force,
a_y = current·(0.5+0.5·sin(ωt+φ)), strongest inside the river band and weaker near the banks; it never reverses direction so the whole herd drifts downstream while crossing.
- Cohesion / separation — each animal is pulled toward its local neighbors' average position (boids-style cohesion) and pushed away from anyone closer than ~1.4 m (separation), so the herd holds formation without agents overlapping.
- Rock avoidance — a repulsive force from submerged rocks scattered through the river band.
- Juvenile shielding — young animals move slower and get an extra pull toward the adult centroid, keeping them physically inside the herd rather than on its exposed edge.
Energy drains with current strength and distance travelled, and regenerates while standing on a bank. Crossing the far bank counts a "crossing" (≈0.12 km of river width) and respawns that animal back at the start bank for the next attempt, so the herd cycles continuously.