Swarm Intelligence- Replicating Ant behaviour

Hi I am looking for studying and replicating ant behaviour. I came across several plugins like culebra, cocoon which are giving me results to certain level.

What I wish to do is take soil from one part and move it to another place. repeatedly . So that the soil at point A is excavated to form cavity and Point B forms a structure.

Check out the video in the link. Any suggestions how to do it?

Idea: Maybe voxelization of soil is first step. But how tdo you move voxels from A to B?

1 Like

Interesting!
But also a difficult challenge.

Voxelizing is a nice idea, and maybe also the only feasible one.
You probably want to build a simpler solution first, in 2D… maybe.

You’ll need to mark some point/sphere underground as target for ants to dig, an area where to work… and a dome shape to “fill” above the ground… raw idea…


The soil/dirt is 4in1:

  • obstacle
  • walk-able path (ants dont fly)
  • an object to transfer
  • structure (you can’t leave floating soil, we are not in minecraft)

We can have a bool, true/false = soil/air.
You can also consider to have each soil pixel pre-calculating at each iteration if he is exposed to air or not, and what is the distance to the nearest air pixel. And even how much is exposed to air.
A soil block exposed to 2 air blocks (or 4 in 3D) should not be removed (actually it is more complex than this, but this is the concept), or the structure would fall!
Instead, a soil block with just 1 side exposed to air can be removed without worries.

On the opposite rule, an air block cant be filled if it would close a passage!

Then the ant.
Probably having more ants at the same time is troublesome, might want to start with a single lone ant.
No “swarm” then… i’m thinking more of the anthill now :upside_down_face:.
The ant, which can travel only in air, will have a bool “carrying_soil”, making it wanting to go near the underground sphere if false, or towards the dome if true.

Determining the likeliness of blocks to be digged or filled can be done with a sort of diffuse reaction / game of life combo of rules.


Here a related link after a fast google search:
http://aanthill.free.fr/noframe/en/simulation_en.html


Keep this updated, post here if you find something else related on the web.

Seems like a big project.

Edit:
Another way , with no voxel/pixel, could be to treat soil as particles (spheres) that have a sort of micro-gravity or capillar force or “glue” … and ants move and drop them…

3 Likes

Apart from @maje90’s great suggestions, I’d recommend to take a look at Sebastian Lague’s tutorial series on procedural cave generation. He mostly works in the Unity game engine, but the concepts are valid along the board!

Another thing to look for is the term stigmergy. It basically describes the coordination system of ants.

And there is a great book called “Turtles, Termites and Traffic Jams” by Mitchel Resnick about these kinds of systems and ways to simulate some of their aspects. It appeared 1994 in MIT Press!

This is an ambitious, but really interesting project to tackle! I hope you’ll keep updating this post with your progress. Would be quite interesting to see. :slight_smile:

5 Likes