Collect Dirt -> Use dirt to upgrade ants -> Ants expand the hive faster

UPGRADES
Buy Ant = Spawn in a new ant
Speed = Movement Speed of the ants
Production = Free ant spawn rate
Multiplier = how much each collected dirt provides

Created as part of a graduate research project. The results of the study can be found in the attached PDF file.

Thanks for trying this small game of mine!

StatusReleased
PlatformsHTML5
Rating
Rated 4.4 out of 5 stars
(8 total ratings)
AuthorJusticefied
GenreSimulation
Made withUnity
Tags2D, artificial-intelligence, Idle, Unity
Average sessionAbout a half-hour
LanguagesEnglish
InputsMouse
AccessibilityOne button

Download

Download NowName your own price

Click download now to get access to the following files:

Simulating_Realistic_Digging_Ant_Agents.pdf 337 kB

Development log

Comments

Log in with itch.io to leave a comment.

(+1)

in regard to the ant running in circles bug


you could make it so that if an ant comes to the same place, the same way 3 times without getting to the surface it stops putting down come here pheromones and instead places a stay away pheromone



or you could be boring and let players erase pheromones

(+1)

is really one of my favorites on this site tho


๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€

That is one potential solution for sure but a fundamental change to the ideology around the ant behavior. The black ants do not have any memory at all and instead react purely based on the current conditions they perceive. My goal is to make them behave close to real ants so arbitrary fixes to address issues kind of goes against that. I'd rather try to find fundamental ways to make the simulation more accurate that causes downstream problems like the doubling back issue to get resolved. 


There's a different potential solution I wanted to try to get working of letting the pheromones diffuse to nearby cells constantly. That way, more stable gradients back to the surface or towards the digging area would be formed and be more resilient against occasional double backs. While I did implement this pheromone diffusion, I disabled it as my implementation was causing constant lag spikes. I might come back and look to optimize it with something like a computer shader but I'll need to adjust several other parameters in the system to account for that. But I have no immediate plans to do so since I'm working on a bunch of other stuff for the time being.


I'm glad you enjoy my ant behavior simulation a bunch though! Sorry for rambling a bit. I like how it turned out too and keep thinking of ways I could do it better if I attempted to improve it. 

what abt erasing pheromones?

or the other ants placing the 'go away' pheromones

it's fine abt the rant

I tend to go on 500-word essays when I'm thinking

(+2)

Needs to be able to work in the background, but is a nice demo.

(+1)

This game is amazing! I'm currently working on a small experiment about ants for my year-end thesis, and the way you've simulated this ant colony is exactly what I need. Could you please share a bit about your food-finding algorithm? Please! Do you use ECS? How were you able to create thousands of grid cells and have 300 ants moving around without any lag?

(2 edits)

I'll share more in depth info publically in a week or two on how the behavior works. I don't use ECS actually but would be a good optimization if I wanted to push it even further. The entire world is a grid of nodes in memory that is just its type (dirt or empty) and some other bits of info. This data is rendered to a texture rather than each being a separate entity. When a node changes type, it changes the corresponding pixel on the texture. Basically the ants are modifying pixels on a canvas. An ant is always located at the center of a node and makes decisions moving one node at a time or deciding whether to dig a dirt next to herself. There's more info I can share if you'd like to DM me on Discord (justicefied) or something. Excited to see the results of your thesis as well! The world needs more cool ant simulators.

(+4)

(+5)

Nice game :)