C++ Ants Simulation 3, Maze

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 339

  • @DaSpazbot
    @DaSpazbot 3 года назад +1954

    It would be super cool to see a maze with multiple correct paths so we could watch them optimise their route

    • @sinnvollerkommentar263
      @sinnvollerkommentar263 3 года назад +143

      I don't think they will. If the ants only find one way they will only follow it careless if there's a better one they haven't discovered. If they find 2 at the same time they will use the shorter one because there will be more pheromones because the ants don't Have to walk that fast to spray them out

    • @Madlion
      @Madlion 3 года назад +25

      u can see their multiple routes at the smiley near the end

    • @nikitademodov3446
      @nikitademodov3446 3 года назад +30

      @@sinnvollerkommentar263 I mostly agree with you(btw hello German m8), although there is a chance that they will be able to optimise their path, if many ants decide to be "adventurous". Albeit this chance is very low.

    • @nikosplugachev6610
      @nikosplugachev6610 3 года назад +7

      The first path the ants find will mostly likely be the shortest

    • @nikitademodov3446
      @nikitademodov3446 3 года назад +10

      @@nikosplugachev6610 "most likely" is about too strong a claim IMO, but you're right

  • @jpsalis
    @jpsalis 3 года назад +612

    It's really interesting how the path optimizes overtime once they've discovered the food.

    • @schwarz8614
      @schwarz8614 3 года назад +16

      @@smilingx4-189 the best trajectory changes with how high the objects velocity, mass etc. is.
      The path the ants take will most like not be the best path for anything else besides them.

    • @vang3001
      @vang3001 3 года назад +1

      its somthing ants do

  • @Bladavia
    @Bladavia 3 года назад +860

    RIP to all the ants who're still stuck on the right side of the complex maze

    • @00Krohnos
      @00Krohnos 3 года назад +41

      They were definitely bugs

    • @nou4898
      @nou4898 3 года назад +3

      cant like bc 69 likes

    • @tommium9658
      @tommium9658 3 года назад +1

      F

    • @sitfish1113
      @sitfish1113 3 года назад

      kogh

    • @MikkeMan
      @MikkeMan 3 года назад

      @@nou4898 Now go like for 420

  • @MudakTheMultiplier
    @MudakTheMultiplier 3 года назад +208

    I would love to see an environment that changes dynamically so they have to adapt to changes potentially getting in their way.

    • @frozenfiredarknight3764
      @frozenfiredarknight3764 3 года назад +7

      like, for example, a sandcastle the 1st day but then a bunch of sand rocks the next.

  • @Zhincore
    @Zhincore 3 года назад +106

    the density views looks like scifi energy or something, I love it

  • @logins
    @logins 3 года назад +166

    Ants eating Pezzza's logo in the end are next level.

    • @nou4898
      @nou4898 3 года назад +1

      cant like bc 69 likes
      also ur comment was below someone with 69 likes

    • @ittixen
      @ittixen 3 года назад

      @@nou4898 nice

  • @noms1711
    @noms1711 3 года назад +98

    It's so cool how the turns change to be more optimal.

  • @nieabtw
    @nieabtw 3 года назад +65

    I'm finally early on one of your videos, fantastic work. It's fascinating to watch them go from a scattered mess to a perfectly organized and optimized path.

  • @leventeszasz7361
    @leventeszasz7361 3 года назад +35

    This was one of the coolest outro i've ever seen.

  • @realquincyhill
    @realquincyhill 3 года назад +63

    Always top quality simulations plus you provide the source 👌🏾

  • @SaladBowlz
    @SaladBowlz 3 года назад +10

    Not gonna lie. I have no idea how i ended up finding your videos, but youtube has been drip-feeding me your ant simulations and its been a blast to watch. The slime molds were wild too. thanks

  • @ZackBogucki
    @ZackBogucki 3 года назад +5

    4:27 looks like the t-shirts always worn by that one high school classmate who really loved Slipknot

  • @walterh2113
    @walterh2113 3 года назад +13

    I love these ant sims so much!

  • @tyler2854
    @tyler2854 3 года назад +9

    Cool video man! I can't wait to see the next addition to this series.

  • @imveryangryitsnotbutter
    @imveryangryitsnotbutter 3 года назад +18

    So one thing I've noticed is that when ants get stuck in limbo (usually explorers from before the food path is established), it can take them a really long time for them to eventually return to the path, if they ever return at all before the food supply runs out. These ants in limbo are essentially wasting the colony's resources while they continue to exist; because the number of ants on-screen is fixed, ants in limbo effectively lower the number of ants that can contribute to bringing back food.
    I propose that you give each ant a "life timer" which dictates how long they can survive outside the colony. You set the timer based on how long it should realistically take to find a food source. At the start, several thousand ants are spawned from the colony, one per millisecond (don't spawn them all simultaneously, otherwise large amounts of ants will die simultaneously, which looks really weird). If an ant's life timer expires, it dies and a new one spawns at the colony. If an ant picks up a food morsel, its life timer is completely refilled. If an ant delivers food back to the colony, its life timer is also completely refilled. In other words, only the ants that most effectively contribute to the colony survive, while the stragglers eventually die off.
    Maybe later on, you can probably implement some kind of birth-death system so that the number of ants fluctuates based on how plentiful or scarce food is, but for now I think the "life timer" mechanic is a good first step.

    • @jessiejanson1528
      @jessiejanson1528 3 года назад

      Ants actually leave a trail as they leave the nest so they can follow it back home later. im not entirely sure, but i suspect they go home eventually, but maybe they stay out until they find food or die... when they find food they leave a different trail while following the trail back to their home. this is so that other ants can find the food. in real world situations, its not just one big block of food and the ants are always looking for more food. that is to say them still looking for food is a good thing, if they died too quickly they never would have made it out of the maze and all ants follow the same set of rules.

    • @lLenn2
      @lLenn2 2 года назад

      You do it!

  • @TheJobCompany
    @TheJobCompany 3 года назад +4

    I'm soo glad I found this channel, this is great

  • @Vollkornaffe
    @Vollkornaffe 3 года назад +11

    The end screen reminded me of one of these plasma globes!
    Come to think of it, this would probably also work well in 3D, right?

    • @tekbox7909
      @tekbox7909 3 года назад

      It should but its most likely not as nice to watch and also a bit more complicated to implement (Not much more though). Though I'm not onehundred percent sure on that

  • @Escue_dread
    @Escue_dread 3 года назад +1

    i wonder what would happen if you treated it kinda like snake, you have one scorce of food and when it is depleted another source randomly pops up.
    I can think of 3 possible results:
    1- they set up a form of pseudo base that acts as a middle man from a depleted source to a new one, it would slowly be optimized and the pseudo base wouldn’t be there anymore.
    2- once a source is depleted they revert back to looking for new food and they completely forget about the old location
    3- the most probable outcome is a mix of these two that depends on what any finds it first. if it was an ant that was at the old source when it depleted and started looking for a new source then the pseudo base might appear, and if te ant was just a stray wonderer then the 2nd result may happen.

    • @Escue_dread
      @Escue_dread 3 года назад

      Another idea i think would be cool is a sort of “Respect score” where each ant has a respect score. each time an ant takes one peice of food to the base they gain one point. The more points an ant has the more likely other ants are to follow them.
      And yes, i understand the problems with coding this due to having so many ants all being treated uniquely so its a complete hypothetical.

  • @sinnvollerkommentar263
    @sinnvollerkommentar263 3 года назад +31

    Great work Again
    Also that you wrote an algorithm to turn your image into food. It's so little details that show how much work you put into it

  • @azaria_phd
    @azaria_phd 3 года назад +12

    Like because you never cut the ants eating the "thanks" screen until they are done with it.
    It'll be interesting to see what you come next? Maybe two tribes of ants competing with each other? Maybe ants can die if they don't find food soon enough, so we see where there are "traps" for ants?

  • @markusbuchholz3518
    @markusbuchholz3518 3 года назад +3

    Really impressive work and clean code. Your effort, innovative way of thinking only boost great C++. Perfect && thank you. Have a nice day!

  • @justinlua4848
    @justinlua4848 3 года назад +2

    No way I found this project earlier today and get to watch a new video on the same day. This project is inspiring to me

  • @stevesajeev6477
    @stevesajeev6477 3 года назад +3

    Wow your videos are so awesome. I really fall in love with you training a drone video.
    Like it was so much cool.

  • @TheFoxfirelight
    @TheFoxfirelight 2 года назад

    Just left a comment in another video of yours that I wanted to see this in a video. Here it is. Excellent

  • @UmzGames
    @UmzGames 3 года назад +1

    Man, just gotta love the way ants work, it's such a powerful algorithm and so effective.

  • @HGitTFC
    @HGitTFC 3 года назад +1

    i like that the 303 started in the song when the acid maze came on screen

  • @nikosplugachev6610
    @nikosplugachev6610 3 года назад +1

    Really cool how these ants are in essence performing BFS. It's also quite interesting how they optimize their path, like in the simple maze

  • @anonymousburrito4743
    @anonymousburrito4743 3 года назад +1

    The density thing reminds me of some sort of life-drain spells and I enjoy it more for that

  • @FullmetalAngyl
    @FullmetalAngyl 2 года назад

    Your ants look like real live brine shrimp swimming about. I love it! These videos are amazingly satisfying!

  • @rot_studios
    @rot_studios 3 года назад +1

    That density view looks like electricity arcing. Very cool!

  • @khatharrmalkavian3306
    @khatharrmalkavian3306 3 года назад +7

    I think you may get better initial dispersal if you add a behavior to cause explorers to steer away from each other slightly, boids-like. Possibly they could steer toward nearby collector/returners as well. I haven't actually looked at your code, though, so I don't even know if their states are discrete, lol.

    • @IOtheFifth
      @IOtheFifth 3 года назад +1

      They could just also avoid the high concentration of return-home pheromone in search-for-food state.

  • @Zalied
    @Zalied 2 года назад

    what i find interesting is the path tightening looks so much like a string that was weaved through the maze and pulled tight

  • @ravinrabits4858
    @ravinrabits4858 3 года назад

    I like how they straighten into a line when they receive path nodes.

  • @insertname9305
    @insertname9305 2 года назад

    the density view really mimics an electric current, really cool

  • @jaideepshekhar4621
    @jaideepshekhar4621 3 года назад +1

    Watching the green face eaten away and replaced by a red "face" in the end was scary.

  • @MgaDrkSkll
    @MgaDrkSkll 3 года назад +1

    uh guys. Why does the complex maze path say "sus"? If you cant see it, its more obvious at 3:34, look at the top half of the maze, and in the center it says "Sus".

  • @ThatNerdGuy0
    @ThatNerdGuy0 3 года назад

    everybody gangsta till the ants turn into an energy beam

  • @Dirk_Berserk
    @Dirk_Berserk 3 года назад

    that's really cool how the line becomes more efficient

  • @kevnar
    @kevnar 2 года назад

    My boy spilled some sugar in the kitchen. A few days later we had a trail of ants. This explains it, I guess.

  • @lazyyuki4652
    @lazyyuki4652 3 года назад +15

    Ahhhhhhhh, in my timezone its currently 0:47h and i have school tomorrow, but f*ck it, I have to see this Video now

  • @rylanyoung2018
    @rylanyoung2018 Год назад

    this creates a really cool visual. I think it would be interesting to generate graphics or vfx assets by using similar simulations

  • @lukassattler2363
    @lukassattler2363 3 года назад +1

    the density view looks awesome - kinda wanna use it as visuals for the next time dejaying

  • @veggiet2009
    @veggiet2009 3 года назад +1

    You cool make some cool looking lightning with this, considering that the ants act something like negative particles, and the food like positive particles, then run the simulation take the density view and the speed up the frames to the speed of lightning.... you might have to change the finding function after the food has been found and or depleted, to then make the lightning end correctly.

  • @relativepi5046
    @relativepi5046 3 года назад

    This stuff is fascinating! I would love to see how they would behave with things like, maybe, desserts that can only be gathered as food after the other 'main' food supply is depleted, or even having a simple checkpoint (or two!) that they would need to hit before the path to the food is open. Of course, it entirely depends on how things are set up, and I am super happy to see this done as it is already.

  • @krysmun
    @krysmun 3 года назад

    you can see the moment the first ant makes it home with the food, the trails are alteady set, and then everyone else starts to follow the trail and it solidifies.

  • @zkll5052
    @zkll5052 3 года назад

    the density view of the complex maze would be a pretty dope electric effect

  • @grapedfruit9792
    @grapedfruit9792 3 года назад

    Was watching the other ant videos this morning thinking about how they would be in a maze. Very cool

  • @plebisMaximus
    @plebisMaximus 3 года назад

    This is basically the monkey typewriter thing. You slip out a huge amount of ants and eventually one will solve the maze, then the rest fall in line. Super cool stuff.

  • @sergodobro2569
    @sergodobro2569 3 года назад

    Currently this is the best ant algorithm video, at least because you show us markers!

  • @AllStuffofWonder_YT
    @AllStuffofWonder_YT Год назад

    1:07 this is like a hose spraying on mud so satisfying

  • @DavidZMediaisAwesome
    @DavidZMediaisAwesome 3 года назад

    the density view looks so cool

  • @nolanbie3664
    @nolanbie3664 3 года назад

    That last little bit looks a lot like those universe maps it’s cool

  • @gx3305
    @gx3305 3 года назад

    the density view was sick. watching the exploration without any speed multiplier was way cool though.

  • @lindsayheyes925
    @lindsayheyes925 3 года назад +3

    Thank you for this, it's an outstanding demonstration. I am planning an exhibition about mazes and would like to feature this video with your permission.

    • @PezzzasWork
      @PezzzasWork  3 года назад +1

      Yes no problem :)

    • @lindsayheyes925
      @lindsayheyes925 3 года назад +1

      @@PezzzasWork Many thanks, this is beautiful work and I really appreciate it.
      Do you have a demonstration of Flood and Backtrack (the Lee-Moore Algorithm)?

  • @codyball3329
    @codyball3329 3 года назад

    The amount of communication between ants is insane

  • @user-qp7td6ov5v
    @user-qp7td6ov5v 3 года назад

    Literally every ant in a 5 mile radius when food gets dropped

  • @Gunnahan
    @Gunnahan 3 года назад

    just thinking... in the circular maze at the end there was still quite some activity in the upper right quadrant of the maze.. those are old ants that never find their way out of that part of the maze? interesting phenomenon..
    and having watched all of your ant simulations i had the idea this would be recreatable as an experiment.. i don't know how "cruel" it would be to build the same maze and put 2000 ants in there with a block of sugar at the other end (or something nutritious for them, excuse my ignorance)
    i remember watching an ant-otaku some time ago that would be an ideal partner for that kind of experiment ^^
    thanks for sharing your ideas.. your vids motivate me to pick up a long-neglected skill: programming..

  • @marekzyla1659
    @marekzyla1659 2 года назад

    that is just what i wanted to see when i saw the part 2

  • @Sincuttiere
    @Sincuttiere Год назад

    I love the "Density View"!

  • @nikitademodov3446
    @nikitademodov3446 3 года назад

    Forget A*, ant simulation is the *real* best pathfinding algorithm.

  • @samyakgupta4301
    @samyakgupta4301 3 года назад

    This video is about to blow up!
    Really cool.

  • @HungryTacoBoy
    @HungryTacoBoy 3 года назад

    The density view reminds me galactic filaments, the largest known structures of the Universe.

  • @timur5241
    @timur5241 3 года назад

    Density view looks so cool

  • @georgplaz
    @georgplaz 3 года назад

    I especially loved the part with the simulated ants

  • @Thenoobyone2981
    @Thenoobyone2981 3 года назад

    2:01 what's in my head when those ants{automatic negative thoughts} take over

  • @vmened
    @vmened 3 года назад

    Looks like they digg pure argent energy from the hell)). Nice simulations

  • @untro7287
    @untro7287 3 года назад

    Came for antz, stayed for chill techno vibes

  • @Jellyjam14blas
    @Jellyjam14blas 3 года назад +2

    *Pezzza you're a legend =D*

  • @Xenotric
    @Xenotric 3 года назад

    would be interesting if you expanded the markers to act like ant pheromones do. Not only "we found the goal go this way" but also "we found nothing here move on" and have the markers pass from ant to ant a bit better so they could generate messenger ants that follow trails from exploratory groups until it reaches a place where it can no longer progress along the exploration marker without touching its messenger marker etc.
    that way pockets wouldnt get stuck and you could do time trials by altering weight of when ants will swap to messengers, how long before a nothing here marker is placed, and how many will follow a "we are exploring this way" marker etc.

  • @ericscheit5540
    @ericscheit5540 3 года назад

    The simple maze with markers view is just like a plague

  • @mauriroper
    @mauriroper 3 года назад

    if you havent, i think you should add a chance that the most ahead ant, will communicate to the previous wether if they chose a right direction or not, and then also the other one has a chance to listen to it or not

  • @martinfisker7438
    @martinfisker7438 Год назад

    The density function looks a lot like lightning. I guess it has some similarities with how lightning works, following the path of the plasma

  • @feintha
    @feintha 3 года назад

    The density view could probably make a good lightning effect for a game

  • @koro1096
    @koro1096 3 года назад

    Basically ants are masters of optimization.

  • @wormjuice7772
    @wormjuice7772 3 года назад +2

    So inspiring! Beautiful

  • @samuels1123
    @samuels1123 2 года назад

    Though unrealistic, a 3D environment would be interesting
    Another few things to try: forces, a barrier that slides slowly, a wind blowing the pheromone northwest, designated 'explorer' ants that ignore paths to develop new ones

  • @gandalfthemagenta7364
    @gandalfthemagenta7364 Год назад

    First, Could this be a maze solving algorithm? and second, I love the way the paths shift, like a rubber band tightening around an object

  • @mementomori7160
    @mementomori7160 3 года назад

    That...
    ...was beautiful(the density view)

  • @nikolatasev4948
    @nikolatasev4948 3 года назад

    The ending was sooo good.

  • @rupand1853
    @rupand1853 2 года назад

    They make the perfect racing line 😊

  • @Nixxen
    @Nixxen 3 года назад

    This is so oddly satisfying to watch!

  • @CreamPolo
    @CreamPolo 2 года назад

    I love that software. Been playing scenarios for hours. Only small issue are those crashes :)

  • @mertulas5967
    @mertulas5967 3 года назад

    U r amazing bro, I love your works, congratulations

  • @riteshsuresh3847
    @riteshsuresh3847 Год назад

    density view was next level

  • @cedrigo
    @cedrigo 2 года назад +1

    Super cool! Thank you

  • @Guihgo
    @Guihgo 3 года назад

    can i use this to get street routes ?

  • @blinking_dodo
    @blinking_dodo 3 года назад +2

    Did you include known-false avoidance?
    (when searching for food, staying away from "to-home" markers?)

    • @LoreleiBlaine
      @LoreleiBlaine 3 года назад +1

      i was just about to make a comment like this! i didn't know the name, but i was thinking that they'd probably explore and find food much faster if ants followed signs of "no home pheromones" towards places other ants thereforr havent explored recently/thoroughly

    • @blinking_dodo
      @blinking_dodo 3 года назад

      @@LoreleiBlaine a simple case of eliminating places to search that are known to be empty.
      Would like to see side-by-side comparison with the current system.

  • @haomakk
    @haomakk 3 года назад

    soo density view leads me to believe that ants are actually lightning

  • @Manabender
    @Manabender 3 года назад

    I'd like to see a simulation where the ants are enclosed in a large area completely filled with food, with the home in a corner (and the immediate area around it empty). I think it would be interesting to see how the ants harvest such a massive resource supply. Will they reliably find the closest bit of food, thus creating a growing radius devoid of further food? Or will they dig into the supply in a single direction and carve out a linear tunnel, changing direction only when that tunnel reaches the far wall? Or something in between?

  • @strawberry641
    @strawberry641 2 года назад

    i cant help but see "Sus" written in the complex maze and im SO sorry if thats unintended

  • @Guihgo
    @Guihgo 3 года назад

    can an ant take same space with other one ?

  • @megamasterblogs
    @megamasterblogs 3 года назад

    This is amazing, ever since I saw your video Im trying to implement this algorithm on mi own.

  • @embodimentof_ANGER
    @embodimentof_ANGER 2 года назад

    2:29 this is what a vaccum cleaner looks like when sucking up dust

  • @brandonstevens6886
    @brandonstevens6886 3 года назад

    0:49 I was just about to ask the difference between this and a genetic algorithm, and then BOOM

  • @richtigmann1
    @richtigmann1 3 года назад

    This is pretty amazing

  • @CallMeTess
    @CallMeTess 3 года назад

    The density view makes me think of lightning ionizing air.

  • @musclechicken9036
    @musclechicken9036 2 года назад

    That outro was sick

  • @stoobe
    @stoobe 3 года назад

    I wonder how often ants get lost in real life. Ending up losing scent and going off forever

  • @aidenwasson7489
    @aidenwasson7489 2 года назад

    I think it would be cool to see if you could program a death circle situation and how that would look

  • @holomorphy
    @holomorphy 2 года назад

    This video exploded my mind