Home▸Animals & Their World▸Ant Colony Trails (2D)

🧪 Ant Colony Trails (2D)

Top-down pheromone-foraging lab: ants shuttle between a nest and four food sources, depositing a decaying scent field on a grid as they walk, and steering up its gradient once trail-following is switched on — the stigmergic rule that builds efficient foraging routes without a map.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-s37-ant-colony-trails ↗ Open standalone

This 2D companion runs the same nest–food–pheromone loop as the 3D version through a flat top-down field built for reading the mechanism rather than orbiting a scene: a scalar pheromone grid accumulates scent wherever an ant walks and decays exponentially every frame, a trail-following slider blends each ant's direct line to its target with the steepest nearby gradient so trails visibly sharpen into a handful of dominant paths as the strength is raised, and a live colony-stats panel tracks delivery count, delivery rate and average trip time so the effect of every slider shows up as a number, not just a picture.

⚙ Under the hood

2D top-down ant-colony lab: a decaying pheromone scalar field on a 72×72 grid, ants that blend direct-to-target movement with gradient-following once trail-following is enabled, and a live readout of deliveries, delivery rate, average trip time and peak scent intensity.

ant colonypheromone trailsswarm intelligencestigmergyemergent behavior

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)