C++ Ants Simulation 3, Maze

  Рет қаралды 562,521

Pezzza's Work

Pezzza's Work

Күн бұрын

Пікірлер: 339
@DaSpazbot
@DaSpazbot 3 жыл бұрын
It would be super cool to see a maze with multiple correct paths so we could watch them optimise their route
@sinnvollerkommentar263
@sinnvollerkommentar263 3 жыл бұрын
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 жыл бұрын
u can see their multiple routes at the smiley near the end
@nikitademodov3446
@nikitademodov3446 3 жыл бұрын
@@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 жыл бұрын
The first path the ants find will mostly likely be the shortest
@nikitademodov3446
@nikitademodov3446 3 жыл бұрын
@@nikosplugachev6610 "most likely" is about too strong a claim IMO, but you're right
@jpsalis
@jpsalis 3 жыл бұрын
It's really interesting how the path optimizes overtime once they've discovered the food.
@schwarz8614
@schwarz8614 3 жыл бұрын
@@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 жыл бұрын
its somthing ants do
@Bladavia
@Bladavia 3 жыл бұрын
RIP to all the ants who're still stuck on the right side of the complex maze
@00Krohnos
@00Krohnos 3 жыл бұрын
They were definitely bugs
@nou4898
@nou4898 3 жыл бұрын
cant like bc 69 likes
@tommium9658
@tommium9658 3 жыл бұрын
F
@sitfish1113
@sitfish1113 3 жыл бұрын
kogh
@MikkeMan
@MikkeMan 3 жыл бұрын
@@nou4898 Now go like for 420
@MudakTheMultiplier
@MudakTheMultiplier 3 жыл бұрын
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 жыл бұрын
like, for example, a sandcastle the 1st day but then a bunch of sand rocks the next.
@Zhincore
@Zhincore 3 жыл бұрын
the density views looks like scifi energy or something, I love it
@itsmedmitrii9362
@itsmedmitrii9362 Жыл бұрын
I thought I was the only one
@DigitalHandle
@DigitalHandle Жыл бұрын
Agreed!
@nieabtw
@nieabtw 3 жыл бұрын
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.
@logins
@logins 3 жыл бұрын
Ants eating Pezzza's logo in the end are next level.
@nou4898
@nou4898 3 жыл бұрын
cant like bc 69 likes also ur comment was below someone with 69 likes
@ittixen
@ittixen 3 жыл бұрын
@@nou4898 nice
@noms1711
@noms1711 3 жыл бұрын
It's so cool how the turns change to be more optimal.
@realquincyhill
@realquincyhill 3 жыл бұрын
Always top quality simulations plus you provide the source 👌🏾
@leventeszasz7361
@leventeszasz7361 3 жыл бұрын
This was one of the coolest outro i've ever seen.
@SaladBowlz
@SaladBowlz 3 жыл бұрын
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 жыл бұрын
4:27 looks like the t-shirts always worn by that one high school classmate who really loved Slipknot
@tyler2854
@tyler2854 3 жыл бұрын
Cool video man! I can't wait to see the next addition to this series.
@imveryangryitsnotbutter
@imveryangryitsnotbutter 3 жыл бұрын
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 жыл бұрын
I'm soo glad I found this channel, this is great
@walterh2113
@walterh2113 3 жыл бұрын
I love these ant sims so much!
@stevesajeev6477
@stevesajeev6477 3 жыл бұрын
Wow your videos are so awesome. I really fall in love with you training a drone video. Like it was so much cool.
@markusbuchholz3518
@markusbuchholz3518 3 жыл бұрын
Really impressive work and clean code. Your effort, innovative way of thinking only boost great C++. Perfect && thank you. Have a nice day!
@sinnvollerkommentar263
@sinnvollerkommentar263 3 жыл бұрын
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
@Vollkornaffe
@Vollkornaffe 3 жыл бұрын
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
@azaria_phd
@azaria_phd 3 жыл бұрын
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?
@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
@MgaDrkSkll
@MgaDrkSkll 3 жыл бұрын
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".
@justinlua4848
@justinlua4848 3 жыл бұрын
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
@UmzGames
@UmzGames 3 жыл бұрын
Man, just gotta love the way ants work, it's such a powerful algorithm and so effective.
@FullmetalAngyl
@FullmetalAngyl 2 жыл бұрын
Your ants look like real live brine shrimp swimming about. I love it! These videos are amazingly satisfying!
@Escue_dread
@Escue_dread 3 жыл бұрын
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.
@nikosplugachev6610
@nikosplugachev6610 3 жыл бұрын
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
@rot_studios
@rot_studios 3 жыл бұрын
That density view looks like electricity arcing. Very cool!
@khatharrmalkavian3306
@khatharrmalkavian3306 3 жыл бұрын
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 жыл бұрын
They could just also avoid the high concentration of return-home pheromone in search-for-food state.
@samyakgupta4301
@samyakgupta4301 3 жыл бұрын
This video is about to blow up! Really cool.
@sergodobro2569
@sergodobro2569 3 жыл бұрын
Currently this is the best ant algorithm video, at least because you show us markers!
@llth_devices
@llth_devices 3 жыл бұрын
i like that the 303 started in the song when the acid maze came on screen
@grapedfruit9792
@grapedfruit9792 3 жыл бұрын
Was watching the other ant videos this morning thinking about how they would be in a maze. Very cool
@Guihgo
@Guihgo 3 жыл бұрын
can i use this to get street routes ?
@ThatNerdGuy0
@ThatNerdGuy0 3 жыл бұрын
everybody gangsta till the ants turn into an energy beam
@AllStuffofWonder_YT
@AllStuffofWonder_YT 11 ай бұрын
1:07 this is like a hose spraying on mud so satisfying
@anonymousburrito4743
@anonymousburrito4743 2 жыл бұрын
The density thing reminds me of some sort of life-drain spells and I enjoy it more for that
@Guihgo
@Guihgo 3 жыл бұрын
can an ant take same space with other one ?
@lindsayheyes925
@lindsayheyes925 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 жыл бұрын
Yes no problem :)
@lindsayheyes925
@lindsayheyes925 3 жыл бұрын
@@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)?
@wormjuice7772
@wormjuice7772 3 жыл бұрын
So inspiring! Beautiful
@lazyyuki4652
@lazyyuki4652 3 жыл бұрын
Ahhhhhhhh, in my timezone its currently 0:47h and i have school tomorrow, but f*ck it, I have to see this Video now
@Dirk_Berserk
@Dirk_Berserk 3 жыл бұрын
that's really cool how the line becomes more efficient
@insertname9305
@insertname9305 2 жыл бұрын
the density view really mimics an electric current, really cool
@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.
@mertulas5967
@mertulas5967 3 жыл бұрын
U r amazing bro, I love your works, congratulations
@nikitademodov3446
@nikitademodov3446 3 жыл бұрын
Forget A*, ant simulation is the *real* best pathfinding algorithm.
@lukassattler2363
@lukassattler2363 3 жыл бұрын
the density view looks awesome - kinda wanna use it as visuals for the next time dejaying
@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.
@blinking_dodo
@blinking_dodo 3 жыл бұрын
Did you include known-false avoidance? (when searching for food, staying away from "to-home" markers?)
@LoreleiBlaine
@LoreleiBlaine 3 жыл бұрын
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.
@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
@jaideepshekhar4621
@jaideepshekhar4621 3 жыл бұрын
Watching the green face eaten away and replaced by a red "face" in the end was scary.
@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..
@Nixxen
@Nixxen 3 жыл бұрын
This is so oddly satisfying to watch!
@rylanyoung2018
@rylanyoung2018 Жыл бұрын
this creates a really cool visual. I think it would be interesting to generate graphics or vfx assets by using similar simulations
@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.
@veggiet2009
@veggiet2009 3 жыл бұрын
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.
@megamasterblogs
@megamasterblogs 3 жыл бұрын
This is amazing, ever since I saw your video Im trying to implement this algorithm on mi own.
@DavidZMediaisAwesome
@DavidZMediaisAwesome 3 жыл бұрын
the density view looks so cool
@gx3305
@gx3305 3 жыл бұрын
the density view was sick. watching the exploration without any speed multiplier was way cool though.
@Sincuttiere
@Sincuttiere Жыл бұрын
I love the "Density View"!
@marekzyla1659
@marekzyla1659 2 жыл бұрын
that is just what i wanted to see when i saw the part 2
@vmened
@vmened 3 жыл бұрын
Looks like they digg pure argent energy from the hell)). Nice simulations
@mementomori7160
@mementomori7160 3 жыл бұрын
That... ...was beautiful(the density view)
@zkll5052
@zkll5052 3 жыл бұрын
the density view of the complex maze would be a pretty dope electric effect
@sfsinfinity5862
@sfsinfinity5862 2 жыл бұрын
3:42 what is this? Plasma?
@ravinrabits4858
@ravinrabits4858 3 жыл бұрын
I like how they straighten into a line when they receive path nodes.
@timur5241
@timur5241 3 жыл бұрын
Density view looks so cool
@slobakia3203
@slobakia3203 3 жыл бұрын
Nice channel bro. Keep it up 👍
@Thenoobyone2981
@Thenoobyone2981 3 жыл бұрын
2:01 what's in my head when those ants{automatic negative thoughts} take over
@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.
@DissyWorld
@DissyWorld 2 жыл бұрын
Can you please how you made the ant?? I mean which softwares you use. Does it comes under game development???
@codyball3329
@codyball3329 3 жыл бұрын
The amount of communication between ants is insane
@maximplyashchenko5610
@maximplyashchenko5610 3 жыл бұрын
Does anyone know the name of the track at 1:52?
@TheCommanderFluffy
@TheCommanderFluffy 3 жыл бұрын
I look forward to these, it got me started in coding.
@georgplaz
@georgplaz 3 жыл бұрын
I especially loved the part with the simulated ants
@Jellyjam14blas
@Jellyjam14blas 3 жыл бұрын
*Pezzza you're a legend =D*
@untro7287
@untro7287 3 жыл бұрын
Came for antz, stayed for chill techno vibes
@cedrigo
@cedrigo 2 жыл бұрын
Super cool! Thank you
@lexihaley2887
@lexihaley2887 3 жыл бұрын
This was fascinating; thank you
@jatinsaini7790
@jatinsaini7790 3 жыл бұрын
Your work is very inspiring 👏👍
@wablabwerwr
@wablabwerwr Жыл бұрын
2:29 this is what a vaccum cleaner looks like when sucking up dust
@Andy-vp7vl
@Andy-vp7vl 3 жыл бұрын
Very cool stuff! Please, could you make an ant war ? Also, I love your outro
@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
@musclechicken9036
@musclechicken9036 2 жыл бұрын
That outro was sick
@richtigmann1
@richtigmann1 3 жыл бұрын
This is pretty amazing
@koro1096
@koro1096 3 жыл бұрын
Basically ants are masters of optimization.
@nolanbie3664
@nolanbie3664 3 жыл бұрын
That last little bit looks a lot like those universe maps it’s cool
@CreamPolo
@CreamPolo 2 жыл бұрын
I love that software. Been playing scenarios for hours. Only small issue are those crashes :)
@nikolatasev4948
@nikolatasev4948 3 жыл бұрын
The ending was sooo good.
@iestynne
@iestynne 3 жыл бұрын
I hope someone visualizes how The Algorithm recently discovered ant algorithms as a delicious and plentiful source of views...
@user-qp7td6ov5v
@user-qp7td6ov5v 3 жыл бұрын
Literally every ant in a 5 mile radius when food gets dropped
@feintha
@feintha 3 жыл бұрын
The density view could probably make a good lightning effect for a game
@torufujinami9558
@torufujinami9558 3 жыл бұрын
If you make 2 paths to the food, I wonder what will happen. For example, one path is shorter but with a lot of branches. And other path is longer but straight forward. Will the ants choose 1 path over the other? Or will the ants take both path but at different distribution?
@rupand1853
@rupand1853 2 жыл бұрын
They make the perfect racing line 😊
@Andrew90046zero
@Andrew90046zero 3 жыл бұрын
You said in the description that you use SFML. I don't have a lot of experience with various free graphics (or rendering, if that is the right term) libraries out there. But I know a few different ones. But I wanted to ask if you have had any experience with SDL2? And if so, do you prefer SFML? Or does each library have their own niches?
@ericscheit5540
@ericscheit5540 3 жыл бұрын
The simple maze with markers view is just like a plague
@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
@brandonstevens6886
@brandonstevens6886 3 жыл бұрын
0:49 I was just about to ask the difference between this and a genetic algorithm, and then BOOM
200K Objects simulation, Testing Explosions
2:50
Pezzza's Work
Рет қаралды 82 М.
C++ Ants Simulation 4, Colony
5:48
Pezzza's Work
Рет қаралды 290 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 12 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,2 МЛН
C++ Ants Simulation 2, Path optimization
6:01
Pezzza's Work
Рет қаралды 298 М.
C++ Ants Simulation 5, Ants Fight
9:24
Pezzza's Work
Рет қаралды 1,1 МЛН
Can Marbles Solve A Maze?
17:57
Dapper
Рет қаралды 496 М.
I Kept Fire Ants For 100 Days, THIS Happened
6:51
Ant Holleufer
Рет қаралды 376 М.
AI Agent Learns to Escape (deep reinforcement learning)
8:18
AI Warehouse
Рет қаралды 7 МЛН
Turning bugs into Art
7:43
Pezzza's Work
Рет қаралды 196 М.
Creating a Brick Breaker with my PHYSICS ENGINE
7:21
Pezzza's Work
Рет қаралды 111 М.
Writing a Physics Engine from scratch
9:24
Pezzza's Work
Рет қаралды 211 М.
C++ Ants Simulation 6, Editor
7:38
Pezzza's Work
Рет қаралды 210 М.
I Coded Pacman but it's Procedurally Generated
11:01
CodeNoodles
Рет қаралды 112 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 12 МЛН