Inspiration
The childhood fun of ant farms inspired us to create this ant simulation.
What it does
Simulates ants from multiple colonies that fight for territory, collect food, and dig tunnels. Every ant has a role but is interconnected with the other ants.
How we built it
- The entire program is written in Python, leveraging PyGame to render surfaces to the screen.
- Quadtrees are used to manage the location of the ants, where they have dug, and what pheromones they have laid down efficiently
Challenges we ran into
Optimization issues using a large pheromone grid to cover the large game surface. We decided to use a quadtree to manage the pheromones instead. Now, performance drops only when there are a lot of pheromones rather than constantly.
Accomplishments that we're proud of
Our proudest accomplishments include:
- Getting the ants to forage in a way that allows other ants to find the food by following pheromone trails.
- Having the underground ants collaborate with the above-ground ants to expand the colony in the direction of food.
- Our commitment to realism.
What we learned
We learned how to implement state-machine AI systems for the ants. Each ant has a state, and certain conditions will cause the ant to change states. For example, if an ant is searching for food but stumbles upon a pheromone trail, the ant's state will change to follow the trail instead.
What's next for Ants
- We hope to better optimize the code to eventually allow for larger-scale simulations.
- A queen who lays eggs, spawning more ants
- Food system where the foraging ants use their food to feed the other ants in the colony.
- Unique species of ants that act differently.
Log in or sign up for Devpost to join the conversation.