Description:
This project implements a pheromone-based ant colony simulation utilizing GPU programming via Unity computer shaders (HLSL). The world is represented as a hexagonal grid, where each hex cell stores state information such as neighbor connections, pheromone levels, food values, and anthill markers. The simulation models pheromone dynamics across the grid to support ant-like behaviors such as exploration, foraging, and homing.
Each cell maintains four pheromone channels: exploration, forage, food, and hill. These pheromones evolve every tick through a combination of:
- Decay – pheromone levels naturally decrease over time.
- Spreading – pheromones diffuse to neighboring hexes based on tunable spread rates.
- Reinforcement – food sources and ant hills emit a continuouse stream of pheromones.
- Clamping – pheromone values are throttled to stay within specified bounds.
The GPU compute shader executes these updates in parallel across all hexes, writing results into an updated buffer each frame. This enables large-scale, real-time simulations of pheromone trails that ants can later use for navigation and decision-making.