Week 5: Fixes and Complexity
April 13, 2026
Last week, we ended off with the addition of antlions and a couple of new bugs. This week, I fixed some prominent bugs and changed the behavior of the antlions.
Bugs and Fixes:
The biggest issue last week was that the movement was off. Namely, ants sometimes made small loops before they went on the correct direction.
I spent quite a long time trying to figure out where the issue was, mostly using the Debug.Log tool that unity provided. Eventually, after noticing ants sometimes detected pheromones “outside” their detection zone, I decided to try visualize the ant’s detection radius using the “OnDrawGizmo” tool.
It turns out the ant’s detection zone was actually to it’s left, instead of above itself. This was a result of me being confused with the direction of vector.up and vector.right during a previous debug session. Oops.

The silver lining was that the OnDrawGizmo tool was very handy for visualization, and I used it to also visualize the ant’s desired direction. This made it very easy to know what the ant is currently tracking. Below is a video showcasing what it looks like in editor mode.
Anthill changes:
I made it so new ants would spawn every time ants brought enough food back to the anthole. This made it so ants would always spawn “to-home” pheromones in relative close proximity to home, instead of all wandering. This is important for antlion changes. This was a pretty small fix, but please enjoy a customary video of ants running around foraging their food.
Antlion changes:
This was the big addition this week: previously, the alarm pheromone would “contaminate” other normal pheromones (ones used for tracking), telling ants to avoid the tracking pheromones, instead of the alarm pheromones itself. Now, I made it so that ants enter a “panic mode” when they touch an area with alarm pheromone. Panic mode overrides other functions, and instead has the ant run in a straight line as far as possible for 5 seconds, before returning to other tasks.
I love this change because the ants are finally showing a bit of “back and fourth” with the antlions. As the video below shows, the antlions start by eating a couple of unlucky ants, but soon the alarm pheromones guide ants to avoid the area the antlions are in and establish their own safe channels.
Future changes:
Now that antlions are in a somewhat complete state, I hope to expand further by finally adding the wolf spider to the simulation.
Additionally, no new additional bugs at this time! so I’m excited to get working by adding new features immediately. No bugs also meant all new code and changes have been published on github.
I hope to see you all next week!

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