Week 8: The complete setup
May 9, 2026
Hello everyone!
As the senior project is nearing its end as a whole, I’ve also finished adding all features I wanted to add into the simulation.
Additions:
Since I’ve made a lot of changes, I’ll go rapid fire into everything:
Simulation side:
- 1. Merged the previous simulation (food, obstacles, and ant pheromones) with SimulationManager.
- 2. Decreased spider spawn time and total simulation time. This way, when spiders are spawned in, ants will likely have already established a stable trail to food.
- 3. Added value “wolf spiders deaths caused by ants” in EvolutionManager.
Wolf spiders:
- 1. Wolf spiders now have an HP bar. When HP reaches 0, the spider dies.
- 2. When wolf spiders eats an ant, they will always lose HP. The normally, HP loss is set equal to 25 * antMass / spiderMass. However, when spiders eat 2 ants within a 20 second time frame, an “Ants_stack” counter will go up, and the damage will begin scaling exponentially. In total, the damage is set to 25 * antMass / spiderMass * 1.7ants_stack, meaning the second ant an ant eats in a row will do 1.7 times the damage of the first. This is meant to represent ants being able to “gang up” and often defeat enemies of larger sizes by working together. In real life, this might be surrounding the spider and attacking all legs at once. (Side note: this makes it especially dangerous for wolf spiders to attack on a food-trail, since lots of ants are crowding there)
- 3. Wolf spiders are now stunned for 10 seconds after eating every ant. This represents both the process of fighting and the process of eating an ant.
- 4. In addition to eating 5 ants, a wolf spider now also needs to survive for a 30 second time period after fulfilling its ant quota.
- 5. Gave wolf new trait: bravado. A wolf spider with high bravado will attack ants even when many are nearby, while a wolf spider with low bravado will actually keep their distance (sometimes even fleeing) when they are near a high number of ants, attacking only when they encounter 1 or 2 ants.
Ants:
- 1. When the wolf spiders eats an ant, the ant will release either an attack pheromone or alarm pheromone. Attack pheromones sends ant into a temporary “attack mode”, while avoid pheromones work the same way they did for the antlions (have ants scatter and run away).
- 2. “Attack mode” is when ants drop what they are doing, and this time begins actively hunting for wolf spiders. They have a speed buff in that time period.
- 3. Ants are now split in a 60-40 ratio of worker / scout ants. Currently, there is no difference in terms of traits between the two, but soldier ants will neither release nor follow pheromones, meaning there are always some ants wandering around the world.
Summary:
Throughout this process of implementing everything, I also did some research on attack pheromones in nature. Ants tend to use attack pheromones and avoid pheromones internchangably, releasing attack pheromones when they believe the threat to be small, and avoid pheromoens when the threat is unfightable. There is obviously a lot more nuance to this, but what I found interesting is that some ants use the same pheromones for attack and avoid, and instead differentiates the two based on concentration (normal = attack, too much = avoid). This actually mirrors how I’ve coded attack/avoid pheromones in my own simulation, where they both fall under the “AlarmPheromone” class, but only has different initializations for the two.
Anyways, to wrap up this week’s blog (and all of the backend coding work on simulations), I added a raw 16 minute video fo the simulation running. There’s still some small bugs here and there, but overall I really like the place the simulation’s at.
Up Next:
I’m really glad to finally be done coding for this project! All that’s left is to analyze the current data I have. After that, I hope to spend the remaining time adding finishing touches (polishing UI) before I ship off the simulation.
For those trying to download my project, also note that this project was done using Unity version 6000.3.11.f1.
See you all next week!

Leave a Reply
You must be logged in to post a comment.