Coding Adventure: Ant and Slime Simulations

A small exploration of an algorithm inspired by ants, and some little experiments into simulating some of the behaviour of ants and slime moulds. I hope you enjoy!

The slime simulation project files are available here:
If you'd like to get support the channel, and get early access to future projects, you can do so here:

Links to some learning resources and cool videos / projects:
Slime pattern paper
Slime write-up and cool examples
Ant simulation video by Pezzza
Slime video by Deep Look
Physarum project by Michael Fogleman

0:00 Intro
0:17 Traveling Salesperson Problem
1:36 Ant Colony Optimization
4:37 Creating a Visual Ant Simulation
9:15 Unleashing the Ants!
10:16 Side-tracked by Slime
14:07 Single Slime Experiment
16:02 Multiple Slime Species

Forest Overture by Yehezkel Raz
Honey Bee Waltz by Kadir Demir
Newborn by Roie Shpigler
Joking by Kadir Demir
Joyfulness by Kadir Demir
Wakeup Call by Ran Raiten
Anthill by Kadir Demir
Synesthesia by Michael FK
A New Horizon by Cloud Wave
Selfless by Eleven Tales
Reel by Anbr


  • Wander
    Wander4 orë më parë

    man... the values for each pattern would be great to know, being tweaking with your github project for 2 hours and cant get them be this pretty xD

  • SlicedTacos
    SlicedTacos6 orë më parë

    Imagine the slime part being your Monitors wallpaper 😍😍

  • Markus Zielke
    Markus Zielke7 orë më parë

    I love those music in the background... So satisfying to watch WELL DONE!

  • Tedd
    Tedd11 orë më parë

    Did I enjoy the video?! The way you set up what we're about to see, then having the music pair so beautifully and perfectly to the visuals _almost_ had me in tears. I gasped. Literally spine-tingling. Bravo! Edit: To be clear, the code and explanation was also fantastic. Your presentation just blew me away - it's superb! Instant subscribe.

  • 洪明寺
    洪明寺15 orë më parë

    The pattern may look like they come from an organism in a microscopic view

  • Đức Phan Công
    Đức Phan Công15 orë më parë

    amazing game

  • ToeTruck
    ToeTruck21 orë më parë

    that atla reference in the beginning was great

  • Nutral 1234
    Nutral 1234Ditë më parë

    I want the slime simulator, how do i make it work?

  • ghostneko
    ghostnekoDitë më parë

    Watching this for some reason made me think of old computer screen savers and it looked so cool makes me want to put it on my computer

  • RandomGgames
    RandomGgamesDitë më parë

    Now if I could only get this as an animated wallpaper...

  • Colin Boice
    Colin Boice2 ditë më parë

    Could you use this to solve mazes?

  • On Your Mark Lets Play!
    On Your Mark Lets Play!2 ditë më parë

    honestly the ants were more like spiders, just slinging webs from branch to branch XD as always, good video!

  • BlueToad07
    BlueToad072 ditë më parë

    16:55 hey where'd you get that picture of the back of my pc?

  • Dr Seuss
    Dr Seuss3 ditë më parë

    Beautiful work god-like

  • Beniven Totem
    Beniven Totem3 ditë më parë

    The blue red and green reminded me of a bunch of wires

  • Peter Stanley
    Peter Stanley4 ditë më parë

    ways to win a fight: pour milkshake over your own head strip naked

  • Nepo Gamer
    Nepo Gamer4 ditë më parë

    First 20 second of the video and you already earned the like

  • J B
    J B4 ditë më parë

    The slime is so beautiful, good job man. This is really great work.

    GLEBRON4 ditë më parë

    Stunning and mesmerized work

  • Weldeborn
    Weldeborn6 ditë më parë

    So glad I found your channel in the ALthe jungle! Great work!

  • Rino Monkey
    Rino Monkey6 ditë më parë

    Omg I need this code in wallpaper engine or as a screensaver

  • Truth Wizard
    Truth Wizard7 ditë më parë

    You should do a multiplayer ant simulation game where players compete for most food obtained and they win by constructing ant facilities in key areas. You could host it live and then players would give you feedback on what should be changed would be cool

  • Nyde
    Nyde7 ditë më parë

    This video blew me away. I litteraly said "holy sh&t" out loud when you increased the slime scale.

  • Shane Burke
    Shane Burke7 ditë më parë

    From 15:00 onward looks incredibly like our brains neural network. I'm incredibly curious to know how this would relate to chaotic flows in nature. For example, at 17:33, if you start at the middle of the screen and go diagonally to the bottom left a few centimeters, there is a spot that seems to replicate the storm on Jupiter for a few seconds. Also as another user pointed out at 14:16 it looks like its preforming mitosis, albeit in reverse. You could attribute it to how bubbles pop and conjoin. Absolutely fascinating.

  • Toren Johnson
    Toren Johnson8 ditë më parë

    I would love to see more of your ant sims!

  • Frenchypony
    Frenchypony8 ditë më parë

    I regulary come back to this video, the editing is stunning

  • Eko Jar
    Eko Jar8 ditë më parë

    This needs a scientific paper written on it. Is it just me, or can you not see mutation and Evolution happening before your eyes. It looks just like life under a microscope. And it's all from tiny things with simple rules. I love it when the smaller loops naturally close up to make more direct paths, it's incredible. I feel like there are some answers in this.

  • Eko Jar
    Eko Jar8 ditë më parë

    I have been trying to figure out a way in illustrator or photoshop, to put pen points in random spots manually, but then have it automatically draw a line or join all of the points together, or only make polygons between each anchor. I can't figure it out.

  • Matyanson
    Matyanson8 ditë më parë

    Please do you have any links to the Ant colony optimalisation? (for path finding)

  • Big Brain Monke
    Big Brain Monke9 ditë më parë

    Ok the slime is something I'd want for a background

  • Lol Lol
    Lol Lol9 ditë më parë

    Looks like a neural network

  • Sebastian Armstrong
    Sebastian Armstrong9 ditë më parë

    the slime stuff doesn't look beautiful at all.

  • Randill
    Randill10 ditë më parë

    I know nothing about coding but I love your videos

  • Marcin Skrobański
    Marcin Skrobański10 ditë më parë

    game of life on steroids

  • Preston Cunningham
    Preston Cunningham10 ditë më parë

    I wrote a program to quickly and accurately find the best route between some series of points and I thought I did a good job...

  • dakkamaster12
    dakkamaster1210 ditë më parë

    How do I go about running this program?

  • BlueJay


    7 ditë më parë

    by making it yourself

  • Lucas Walters
    Lucas Walters10 ditë më parë

    Do you sell NFTs?? Because you should haha

  • Darren Richardson
    Darren Richardson11 ditë më parë

    This is VR. Please.

  • BlueJay


    7 ditë më parë

    what? its not

  • ishner
    ishner11 ditë më parë

    Try dropping the different species in different areas

  • james
    james11 ditë më parë

    the title of this really should have been "Man creates living organism in 18 minutes". You would have gotten 60m views not 680k lol

  • Anders Rottschafer
    Anders Rottschafer11 ditë më parë

    Cellular Automata baby!!!

  • SinkPlaysYT
    SinkPlaysYT12 ditë më parë

    Up until finding this channel, I'd only been watching "how to create x" coding videos. Now I've just been watching this guy understanding about 3% of what's happening but being crazy impressed with what he achieves. With such a relaxing voice and audio scheme.

  • Falcon
    Falcon13 ditë më parë

    How do i super-like this video! Its amazing!

  • Hussalojr
    Hussalojr13 ditë më parë

    This is like the national geographic of gaming, I'm absolutely enthralled by this channel

  • Bonnie The Bunny
    Bonnie The Bunny13 ditë më parë

    If I could know how to make the slime thing into a screen saver I would and it would be awesome

  • TimOrnn
    TimOrnn13 ditë më parë

    Jesus man you did not need to show that horrid ant model import error that is terrifying

  • Joseph Craig
    Joseph Craig14 ditë më parë

    The level of production quality combined with the amount of interesting things I learned is off the charts, I’m an engineering student and this has really inspired me to look into coding on a deeper level. Thanks :)

  • Robbyte
    Robbyte 14 ditë më parë


  • 7isAnOddNumber
    7isAnOddNumber14 ditë më parë

    And people say unity can’t look cool!

  • ndc55
    ndc5514 ditë më parë

    very daring to introduce bugs in a computer program

  • DankNoodles420
    DankNoodles42014 ditë më parë

    How to run simulation files you have on github ?

  • Nipuna Sudharaka
    Nipuna Sudharaka14 ditë më parë


  • Belldofers Matlack
    Belldofers Matlack14 ditë më parë

    14:32 ah yes hexagons The best shape

  • Astra 060
    Astra 06015 ditë më parë

    I dunno why, but I started shouting APPLY SCALE! APPLY SCALE! APPLY SCALE!

  • AvenDonn
    AvenDonn15 ditë më parë

    "Imagine you're a merchant" and dots started appearing. Oh shit it's P=NP time

  • Brennan Fehr
    Brennan Fehr15 ditë më parë

    This is really neat, but could you explain how to program these types of things? I want to program it myself, and be able to tinker with it.

  • Mahendra Sharma
    Mahendra Sharma16 ditë më parë

    Amazing ants simulation, do you have sample code on git for ant 🐜 simulation.please do share the link,

  • CJ M
    CJ M16 ditë më parë

    16:50 sent me straight back into a dmt trip from years ago

  • Cedric Villani
    Cedric Villani16 ditë më parë

    Try the fungi approach

  • Mighty Possum
    Mighty Possum16 ditë më parë

    First video I've seen from you and you got a new subscriber because I loved this video. Those patterns by both the ants and the mold were mesmerising. Keep up the good work! ♡

  • Shreyan Kumar Mishra srl_33
    Shreyan Kumar Mishra srl_3316 ditë më parë

    Sebastian Lague has absolutely changed the dimension of coding

  • Alexander Kilpatric
    Alexander Kilpatric17 ditë më parë

    The Slime simulations has to be one of the most amazing things I have seen in a long time. I got goosebumps when the first one broke off and started expanding.

  • Lord Drakostar
    Lord Drakostar17 ditë më parë

    Can't wait for the first two species he'll add to his planets be ants and slime mold

  • epox2004 _
    epox2004 _18 ditë më parë


    LiTHiUM THiEF18 ditë më parë

    My god, this is beautiful

  • GD Crow
    GD Crow18 ditë më parë

    Slenderant won’t let me sleep tonight

  • VirtualGobllim47
    VirtualGobllim4718 ditë më parë

    My Cabbages!!

  • zEscOOt
    zEscOOt18 ditë më parë

    imagen the slime as your wallapaper

  • Gowage
    Gowage18 ditë më parë

    Would there be any way of converting this to a screensaver or would it be too compute-intensive to run on the fly like that? I would love to have this as my scrensaver.

  • Tristan Rentz
    Tristan Rentz18 ditë më parë

    Hey Sebastian, only just now discovered your channel, and as a seasoned deep diving geek, I am sooooo hooked! Many thanks :D

  • AnimalLoverWeirdo
    AnimalLoverWeirdo18 ditë më parë


  • Evan Pruitt-Crawford
    Evan Pruitt-Crawford19 ditë më parë

    Yeah please definitely come back to this. Specifically on your observation about how organic all of this. I love your videos, especially your coding adventures. Keep it up!!

  • Evan Pruitt-Crawford
    Evan Pruitt-Crawford19 ditë më parë

    15:20 woah…

  • Thomas Palmer
    Thomas Palmer19 ditë më parë


  • Женя Волков
    Женя Волков19 ditë më parë

    This shot on 14:17 is the most beautiful piece of video I've ever seen. Music doubles it.

  • Andrea Da Corte
    Andrea Da Corte20 ditë më parë

    Coolest screensaver ever. That’s for sure.

  • Nova Starpaws
    Nova Starpaws20 ditë më parë

    15:45 Ah, so this is how they made the things for "Control"

  • Max Poppe
    Max Poppe20 ditë më parë

    it's insane how you can generate something so beautiful with just some code

  • Shankar
    Shankar20 ditë më parë

    wow this is ultimate secret to life. I see hexagons everywhere.

  • Tim Tam
    Tim Tam20 ditë më parë

    Those patterns would make a sick visualizer

  • XoRdi
    XoRdi20 ditë më parë

    Can You port that to Wallpaper Engine? That would blow my mind :D

  • Jean des Isnards
    Jean des Isnards20 ditë më parë

    My mind has officially been blown

  • ohlssonster
    ohlssonster21 ditë më parë

    Hey! What coding language is this?

  • Lindon Peasley
    Lindon Peasley21 ditë më parë

    very cool

  • LPS Foxstar
    LPS Foxstar21 ditë më parë

    Can we have this as a website to play with the settings?

  • O Porquê de Tudo
    O Porquê de Tudo22 ditë më parë

    Would you hire an intern?

  • rando limbo
    rando limbo22 ditë më parë

    16:48 reminds me of a tribe called quest

  • Chop Labalagun
    Chop Labalagun22 ditë më parë

    i like your stuff please show more code.

  • Grex L
    Grex L22 ditë më parë

    your visualizations are really damn nice to watch. Great job, love these videos!

  • Ayden HK
    Ayden HK23 ditë më parë

    Tigers eat frogs eat wild bugs eat ants eat honey Number 🐯1 🐸 50 🦗 1750 🐜 45000 🍯 1500000

  • Aaron Lowder
    Aaron Lowder23 ditë më parë

    14:40 The piece that Slowly gets Longer

  • Aaron Lowder
    Aaron Lowder23 ditë më parë

    When they release the 500 ants it actually reminds me of an actual ant trail

  • Daniel Lomelí
    Daniel Lomelí23 ditë më parë

    Sooooo beaautifuuuull! do you have any programing courses I could acquire??

  • Bobingstern
    Bobingstern24 ditë më parë

    I’m trying to recreate the ant simulation, what prevent the ants from just making a line following an ant with food wandering around? What if there is a high concentration of home pheromones in a different area will the ants trail away?

  • Kilikus
    Kilikus25 ditë më parë

    Me looking over at my ant colony: Lazy bugs, just sitting there....

  • Me Atgoogle
    Me Atgoogle27 ditë më parë

    9:26 brings back dark memories of my old house

  • Jeremy Miller
    Jeremy Miller27 ditë më parë

    If you look it up, there’s a newish video on YT about how a particular species of slime mold may be so capable of tasks perceived as requiring generalized intelligence that they’re trying to use simulations of its behavior to control small moving robots with the eventual goal of efficiently represent the behavior to guide autonomous nanoscale machines in medical and engineering tasks.


    bro, i thought i was watching a movie about microorganisms

  • Kris Szczurowski
    Kris SzczurowskiMuaj më parë

    Amazing! truly amazing! I've seen a lot of interesting algorithms in life but your video remind me why I love programming. This video is the best one I've seen this year! Well done!

Faqja Tjeter