Colonies of Pheidole ambigua ants excavate soil and drop it outside the nest entrance. The deposition of thousands of loads leads to the formation of regular ring-shaped piles. How is this pattern generated? This study investigated soil pile formation on level and sloping surfaces, both empirically and using an agent-based model. We found that ants drop soil preferentially in the direction in which the slope is least steeply uphill from the nest entrance, both when adding to an existing pile, and when starting a new pile. Ants respond to cues from local slope to choose downhill directions. Ants walking on a slope increase the frequency and magnitude of changes in direction, and more of these changes of direction take them downhill than uphill. We found that ants carrying soil on a slope wait longer before dropping their soil compared to ants on a level plane. These mechanisms combine to focus soil dropping in the downhill direction, without the necessity of a direct relationship between slope and probability of dropping soil. These empirically determined rules are used to simulate soil disposal. The slight preference for turning downhill we had measured empirically was shown in the model to be sufficient to generate biologically realistic patterns of soil dumping when combined with memory of the direction of previous trips. From simple rules governing individual behaviour an overall pattern emerges, which is appropriate to the environment, and allows a rapid response to changes.