Home▸Animals & Their World▸Ant Colony Foraging Lab — 2D Pheromone Trail Lab

Ant Colony Foraging Lab — 2D Pheromone Trail Lab

A top-down 2D companion to the 3D colony scene: workers wander until they spot food or cross a strong enough scent trail, then carry it straight back to the nest while laying fresh pheromone behind them — the same stigmergic foraging read as a clean overhead map with live food, energy and trail-density readouts.

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

This 2D companion strips the colony scene down to an overhead view of the same foraging behavior driving the 3D version, rebuilt around real ant stigmergy instead of ants beelining straight to a fixed target: workers leaving the nest wander using a pheromone-biased random walk, sampling the scent trail a short distance ahead at several candidate headings and turning toward whichever direction smells strongest, with a random exploration term so a colony can still find food before any trail exists. Once an ant is close enough to see a food pile it heads straight for it, picks up a load, and turns back toward the nest — depositing a fresh green pheromone trail the whole way home. Other workers crossing that trail are pulled toward it, so a route that keeps paying off gets reinforced while paths to exhausted piles fade as the pheromone evaporates, the same self-organizing shortcut-finding real ant colonies use. A live readout panel tracks cumulative food collected, a colony energy figure that rises with deliveries and drains slowly with upkeep, and the current trail density across the pheromone field.

⚙ Under the hood

2D top-down ant-foraging lab: pheromone-biased random-walk search, direct pickup once food is in range, trail deposition on the way back to the nest, exponential pheromone evaporation, and a live food/energy/trail-density readout panel.

ant colonypheromone trailstigmergyforagingswarm intelligence

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

What did you find?

Add reproduction steps (optional)