I have always been fascinated by ants and their ability to find paths so I decided to create a very basic simulator to see if I could manage to observe this behaviour virtually :) Github github.com/joh... Music found on freepd.com/
@@villaticlang4844 thats how i remembered the name but i think the official name is: en.wikipedia.org/wiki/Ant_mill and yes, it can sometimes happen until some of them die of exhaustion :(
My dad was creating a similar simulator once upon a time, and any time he hit a snag he'd explain the problem to me as a way to get a new perspective etc... one of the problems he'd encountered that sometimes the ants would just start circling around each other in a loop... and he just couldn't figure out how to stop it.. Until I pointed out that they're called "Ant mills" and that it happens in real life too. Some times, it both is and isn't a bug.
That technique is called "Rubber ducking" in software development (as in explain your problem to a rubber duck, because sometimes just going through the problem from the beginning, from a fresh point of view, can help you find a solution). And the ants forming loops is a bug in nature, not your father's simulator XD
So if I got this right, you are telling me that your father didn't code to make it happen but just happened anyway, just like in nature? I have no experience in coding so I might misunderstood. Hope to get a response, I'm really curious
Whenever I'm showing my code to my Dad and he mentions something thats both a bug and a feature we usually end up saying "is it a bug or a feature? Yes"
something similar that i've had happen to me is that i would ask a teacher/professor for help, and as i described the problem to him i would end up thinking of a solution myself and not needing the help after all.
Now add, an ants killer, then ants, can craft railguns if they can find the resources and then they can try to defend themselves learning with a genetic algorithm, then add jectpacks, laser and spaceships and then...
Sadly, They are not conducting electricity enough to get accellerated in a railgun... Otherwise they had plenty of ammo that could keep on attacking even after it impacted 🤔
I love this. One thing I think is missing that would be fun to see is the two different personalities or behaviors of ants that will correct the paths to be more and more direct over time. You'd need some ants to be really strictly following the paths and then others that are more experimental that wander off the trail even when it's there. I'm not sure exactly how it works, but over time this tends to straighten out the paths.
The fact that u can create such an accurate model of how ants work with 3 rather baisc rules is absolutely fascinating. u can even easily translate this into 3 and even higher dimensions. just incredible
actually, most of so-called complex systems can be modeled/are determined by few simple rules. For example: flocking of schools of fish, John Conway's Game of Life, any cellular automata etc
I think one of my favorite thing about ants is they have a nature best path solution. Since as the ants follow the trail back they slowly cut corners and turns as they can sense a little ahead of themselves. This automatically straightens rounded paths out over time
I keep finding myself coming back and rewatching this ant sim series. It's so interesting to think about, and I always try to see if I can make an ant simulation myself, which, I haven't fully succeeded in yet, but I'm getting there. I love this series!
I love watching your vids before bed I saw one the other week and lost your channel but I found it again! I love how relaxing your videos are they are simple yet amazing
This is such a brilliant simulation. Will probably implement something similar but more basic for KAE, your algorithm here creates such great patterns and it's fun to watch!
The pattern at 4:06 reminds me of a plasma ball. I would love to see one that's a perfect circle of food that is regenerating constantly and see if the ants would move around the same way the plasma in a plasma ball does.
I know you didn't ask, but it's a different case though. in plasma balls there is an ionization path that forms which has less electrical resistance, and so all electrons go through that same path until the path is so long that there is another path of ionization with lesser resistance that forms, while in this scenario that "other path" never forms as long as there are ants going through the old path. The new ionization path forming is visible when the little "sparks" of the plasma ball snap to a new place
@@carlosmspk Yes, but the random component of the movement of each ant (its "freedom" coefficient) should still cause the trails to move and shift spontaneously.
I think this can be a good algorithm to make caves in a 3D voxel terrain. I code every day on unity3D and I'd like to do something similar in the near future.
I once made this same simulation in JavaScript. I ended up iterating so many objects (scent trails, ants, and food) that it crawled to a halt in my browser. I keep meaning to make a better version in Unity or something like that. Very cool to see this version.
Fascinating. I'm willing to bet that the ant probably treats every path as a different source of food, even though it leads to the same source as the other
This is incredible!!! Thank you so much for sharing! I'm going to read your code and learn how you did this :) This makes me very happy I get to learn something new!!!
@@PezzzasWork cheers! what books have you read re. the physics videos you've done? They're awesome. I'm planning to get into that stuff over the next couple of months.
Physics is so fun to play with :D I mostly used what I learned during my education but I ve read some nice articles here gamedevelopment.tutsplus.com/series/how-to-create-a-custom-physics-engine--gamedev-12715 and you can also check the Verlet integration which allows you to quickly have nice things en.wikipedia.org/wiki/Verlet_integration (I am using it everywhere)
Richard Feynmann described this logic in his book "you must be kidding, Mr. Feynmann". He observed, that once ants found some food, they excitedly run back to the nest and bring some fellows checking the path a couple of times. While running they cut corners, therefore every time they reiterate the path to the food it is optimized. After 7 iterations it is usually the shortest path to their home. Also there are two types of ants who follow the path and other are making it. It would be nice addition to this model I suppose.
Ok so I was doing my coding HW and right after this I started my research about ants because I got my brand new ant farm today. Guess what was in my recommendations? Great work btw!
Now imagine this video is "home", us viewers are the "ants", and whichever video we click next in the recommendations is the tastiest "food", and you get a pretty good idea of how the RU-vid recommendation agent works. (There's also an interesting parallel to draw to the way our brain works)
This simulation reminds me of how the Physarum Polycephalum fungus spreads to find food, its interesting to see how the paths develope to shorter and shorter connections
When I made this simulation for myself, my ants with food always seem to get lost on their way home. They end up following the wrong trail of home pheromones while leaving food pheromones, causing other ants without food to follow that path, leaving more home pheromones, and it becomes a bad cycle where the ants get into a loop of nothingness that only break after a random wiggle causes them to veer off the path or until much time has passed. I was wondering how you avoided this issue. In the video, it seems that the ants almost always begin building back toward home after finding food.
Markers closer to objectives are stronger so ants have more chances to pick the trail in the right direction. I had exactly the same problem of "bad circles" to avoid this ants have a limited amount of markers they can drop (which is recharged when they encounter home or food) so wandering ants have no impact on other after a certain time.
@@PezzzasWork is it possible to make some kind of unique markers, so that when returning home ants would pick their own way (markers that they left) and not someone else's?
Reminds me of the birds routine from a visual perspective - not logic of course. Might be interesting to do a bees version - flower to hive and back soft of thing. Good scaling by the way. And thanks for the code as well. Bugs me (no pun) when someone has a good sim and doesn't post the code to play with.
A fabulous work I really like it, I would love ust to highlight bout the idea of (ant colony optimization method) to choose the hortest path from and to their food source based on their pheromone propagation. But really great job bro
As i know, in reality ants are able to find the straight line from food to home by making a sort of vector sum of the path they travelled. It would be even better if made in this way!
It was indeed a little problem. The solution I came to is making ants drop smaller and smaller markers (in terme of intensity) so that when an ant finds a trail it is naturally attracted to the older ones leading to the objective. This approach is not perfect but it works quite well :)
Very cool! It would be interesting if it had more signals. For example, different species that avoids the signal of the other species, or sentinels that are near the hive and just go out if they receive dots signaling danger. It can get very complex with just a few parameters.
Lately, RU-vid is getting more interesting as more researchers using to publish their work. Than Archive.org. Who's got time for reading research papers.
Complex systems simplified. Doesn't show how ants often find the optimal route back to nest and not the original path any of them took, when they find food.