Langton's Ant

Поділитися
Вставка
  • Опубліковано 19 чер 2024
  • Langton's ant is a simple cellular automaton similar to Conway's game of life that can produce interesting and complex patterns. I explored images produced by the ant composed of up to 16 colors.
    Wiki: en.wikipedia.org/wiki/Langton...
    Project: github.com/BioMarek/langtonsAnt
    00:00 Introduction
    01:23 The number of Langton's ant rules
    03:00 Langton's ant patterns gallery

КОМЕНТАРІ • 88

  • @THExRISER
    @THExRISER 5 місяців тому +68

    Using Langton's Ant to produce fractals is something mathematicians can study for years.

  • @hkayakh
    @hkayakh 5 місяців тому +20

    I think the most amazing part of this all is that it takes millions of turns to generate the images

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +15

      And some rules produce chaos for up to several million steps and then suddenly produce orderly structures. It is possible that I missed some interesting ones by limiting the number of steps for each rule.

    • @crushermach3263
      @crushermach3263 5 місяців тому +7

      @@cyberhelix5152 It could be possible that given enough time and space all permutations would stabilize, but good luck testing that theory. lol

  • @a52productions
    @a52productions 5 місяців тому +24

    it's amazing how many of these are "sort of" symmetric. theyll have regions of order, but different regions disagree on what that order should look like. or theyll have a symmetric overall structure, but areas of chaos or small asymmetries, and somehow the ant revisiting those areas of chaos doesnt end up in the overall structure being destroyed

  • @MichaelDarrow-tr1mn
    @MichaelDarrow-tr1mn 5 місяців тому +44

    if you add straight as an option you can use LS as a binary counter, LLS as a ternary counter, and LLLLLLLLLS as a decimal counter

    • @edomeindertsma6669
      @edomeindertsma6669 5 місяців тому +3

      What makes a counter useful/interesting?

    • @randomlol-ya3063
      @randomlol-ya3063 4 місяці тому +3

      I think a "turn back" option would be very interesting too
      Or a "go diagonally (right)"
      Or maybe even "more straight but move diagonally when u meet left/right"
      More rules means more complex shapes

  • @RagaxYT
    @RagaxYT Рік тому +60

    These patterns were so mesmerizing I could watch them for hours. I havent even noticed when 12 minutes passed! Thank you for the video man.

    • @cyberhelix5152
      @cyberhelix5152  Рік тому +8

      Yeah, they are pretty cool. Consider giving a like, and if you feel particularly mesmerized, you could even subscribe :)

    • @chrisakaschulbus4903
      @chrisakaschulbus4903 4 місяці тому

      I couldn't... i would fall asleep because they're so hypnotic.

  • @terdragontra8900
    @terdragontra8900 5 місяців тому +18

    7:50 looks like crystals growing in a surprisingly organic way, beautiful, beautiful

    • @kepka55
      @kepka55 5 місяців тому +2

      Because Langton's ant is grow fractally and crystals grow fractally

  • @_miobrot_603
    @_miobrot_603 5 місяців тому +19

    The first of these is such an incredible find! The sierpinski triangle making an appearance is so interesting and mysterious.

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +11

      There were quite a few rules with the Sierpinski triangle. This one was the most symmetrical and interesting.

  • @kepka55
    @kepka55 5 місяців тому +11

    7:27 looks like a cardioid

    • @MaxiCubi
      @MaxiCubi 4 місяці тому +2

      i think it also looks like a brain

  • @BLOCKADE_CAT
    @BLOCKADE_CAT 5 місяців тому +6

    this is definitely my favorite 0 player simulator now, conways game of life was my 2021 adiction

  • @richhackney
    @richhackney 5 місяців тому +7

    This is amazing. I am an animator and this could come in useful for motion graphics.

  • @KrishanBhattacharya
    @KrishanBhattacharya 3 місяці тому

    Some of these deserve to have longer and larger renderings done.

  • @asheep7797
    @asheep7797 5 місяців тому +5

    8:00
    we found the ant at the back of the classroom

  • @kepka55
    @kepka55 5 місяців тому +4

    I didn't know that the Sierpinski triangle could appear in Langton's ant

  • @Ubsje
    @Ubsje 5 місяців тому +4

    Amazing stuff. I'd be interested to see what's possible with multiple ants on the same grid, either using the same rules or differing rules. I feel like that could allow for many more cool images.

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +4

      My guess is that getting an interesting image with multiple ants will be much harder because they will overwrite each other, and to avoid that, they would have to be placed on precisely defined spots on the grid, which will probably be hard to find. But maybe I'll take a look into that.

    • @Ubsje
      @Ubsje 5 місяців тому +1

      @@cyberhelix5152 As long as they use the same colors they will just use each other's tiles, which could maybe lead to a lot of cool stuff. The only problem I could think of is them going onto the same tile at the same time, but that could be solved by stepping them after each other and not at the same time. Their starting positions and rotation could vary, so every simulation would start with the rule, position and rotation for each ant.

    • @Soken50
      @Soken50 4 місяці тому +1

      @@cyberhelix5152 I remember playing with a mobile app that allowed multiple ants to be placed and use more complex rules like go straight, turn around, switch rule sets upon hitting specific colors. Multiple ants on the same rules in some configurations would create much more intricate patterns than the rule set allows with a single ant but most of the time they would just amplify the chaos or sometimes speed up the process by looping on each other's trails. Getting ants on specific coordinates was challenging at high resolutions though with a touchscreen.

    • @cyberhelix5152
      @cyberhelix5152  4 місяці тому

      I agree, it could be cool, but getting the right configuration of ants would be challenging.

  • @Dadax9398
    @Dadax9398 5 місяців тому

    I feel like there is not a lot of videos of interesting patterns, So thanks for the work and the video

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому

      There are some patterns I've never seen that I decided to include in the video. Glad you liked it

  • @LINDkung
    @LINDkung Рік тому +4

    Sick video man!

  • @MinusNC
    @MinusNC 5 місяців тому +1

    i really like the patterns in 8:39, 11:15 and 12:07

  • @juliuszkocinski7478
    @juliuszkocinski7478 4 місяці тому +1

    4:20 Langton's Bismuth :D

  • @ladyravendale1
    @ladyravendale1 5 місяців тому +1

    Very fun video! Some ideas on trimming down the patterns more to find “interesting” ones:
    They seem to fall generally into at least one of two categories, which should be filterable:
    1. A high percentage of empty tiles to filled tiles (find highways)
    2. A set of colors making up a large percentage of the image
    Combining one of these with the earlier “must include all colors” rule, it might be possible to filter out almost all the “boring ones”
    One other type I noticed while watching the video is those where the relative percentages of colors cycle after some number of steps, which would find the flashing patterns.
    I would be really excited to see a follow up if these ideas actually work!

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому

      Thanks for the suggestions; color cycling sounds interesting and could be worth trying.
      Unfortunately, point 1 fails with rules that fill a large portion of the screen and then produce a highway. Increasing picture dimensions could help with that, but it would also increase computing time.
      Point 2 fails with rules that fill a large portion of the screen with few colors. Maybe surprisingly, they are very common, and when I see tens of thousands of them, they are not that interesting. That said, I also cannot use this to get rid of them because there are very rare almost monochromatic pictures.
      I tried a few algorithms, but they usually fail on the simple premise that an interesting pattern is unpredictable and rare, and each algorithm that eliminates boring patterns could accidentally get rid of some interesting ones.
      I'll probably gather all the suggestions in the comments and make another video if they help to find some new patterns

    • @ladyravendale1
      @ladyravendale1 5 місяців тому

      @@cyberhelix5152 maybe it would then be worth considering the change over time. What about patterns that start as one type, then shift to a different one? Or patterns that have a large/continuous change in the relative color densities? I feel like once you get into the multi-million set large patterns, either the search space will have to be very restrictive, or just random sampling, and some interesting patterns will be lost just because of the search space size.

    • @ianmoore5502
      @ianmoore5502 5 місяців тому

      Honestly the journeys were part of what interested me. Those, and the Mandelbrot one. ​@cyberhelix5152

  • @EquaTechnologies
    @EquaTechnologies 5 місяців тому +2

    Fractal!

  • @benjaminlum5894
    @benjaminlum5894 5 місяців тому +6

    I like to call this one
    3:22 Lilly pads
    3:32 Dantrite highway
    3:44 Family of Fields
    3:56 Dandrite
    4:08 Butterfly
    4:15 Rocket
    4:20 Family of Bismuths
    4:50 Prism
    4:56 Snowflake
    5:20 Atrium
    5:36 Keyway
    5:39 Nuclear
    5:51 Glass
    6:22 Semi-crystalline
    6:30 Leaf
    6:59 Ice cube
    7:07 Mushroom
    7:15 Brain
    7:38 Crystal
    8:40 Crystal glass
    8:58 Leaking candy
    11:37 Metallica (because more dandrites aren't very creative right?)
    12:23 Borders

    • @santherstat
      @santherstat 5 місяців тому

      very descriptive. I like these

  • @davejacob5208
    @davejacob5208 5 місяців тому

    you could turn some of these into pictures to hang on a wall (if you switch some colors, in some instances at least), or maybe print them on t-shirts. for example, imho, the one at 7:09 had a very interesting shape, the one at 9:40 created a cool overall-picture

  • @IterativeTheoryRocks
    @IterativeTheoryRocks 4 місяці тому +1

    Marvellous. Fantastic video.
    Looks like wolfram is on to something! What do you think that these rules that literally look like some phenomenon literally are the rules for that thing?

    • @cyberhelix5152
      @cyberhelix5152  4 місяці тому

      I think so, for things like crystals there are rather simple physical rules. Some patterns we see in living things seems to be governed by simple rules as well like snails' shells, Romanesco broccoli, and so on.

  • @WhyLonk
    @WhyLonk 5 місяців тому +3

    youtube algorithm blessed me 🙏🙏

  • @Venden_IX
    @Venden_IX 2 місяці тому

    Can it be used to optimize video games ? Like a process for decide when we downscale renders of triangles meshs

  • @Deveyus
    @Deveyus 5 місяців тому +1

    Neato!

  • @AlexPinkney
    @AlexPinkney 5 місяців тому +1

    Nice. Have you considered doing this for "turmites"? These are a generalisation of Langton's ant where the ant has its own internal state. Most of the examples I've seen online only use 2 colours.

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +1

      I know they exist, but that's about all. I'll check them out. Thanks for the suggestion.

  • @TheUntamedNetwork
    @TheUntamedNetwork 5 місяців тому +2

    is it possible to design an ant's inputs to guarentee in finite steps it will reach a precspecified design?

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +1

      Depends on the design, for some simple things like lines and shapes, it should be possible. However, I haven't tried to figure out what is possible and what is not.

  • @Epsilon3141
    @Epsilon3141 5 місяців тому

    I couldn’t believe that one that looked like a cardioid I was not expecting that

  • @maciej12345678
    @maciej12345678 Рік тому +2

    i am your 7 subscriber :D

  • @hristopetrov129
    @hristopetrov129 4 місяці тому

    it's interesting how does it make solid color regions

  • @maxyong1152
    @maxyong1152 5 місяців тому

    So this the the origin of the Minecraft ant block

  • @cyan2910
    @cyan2910 5 місяців тому +1

    I think a simple algorithm would be to get patches of similar colors and make some scoring system

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +1

      Do you mean something like en.wikipedia.org/wiki/Hashlife? That should work. Maybe I'll try to make another Langton's ant video with suggestions from the comments.

  • @0rphaneye
    @0rphaneye 4 місяці тому

    Is there a pattern for "Langton's Ant in Langton's Ant" like the same thing in Conway's game of life?

    • @cyberhelix5152
      @cyberhelix5152  4 місяці тому +1

      I don't understand your question, but since Langton's Ant is a universal Turing machine, it is theoretically possible to generate any pattern with it.

    • @0rphaneye
      @0rphaneye 4 місяці тому

      @@cyberhelix5152 Watch the video "Life in Life" by Phillip Bradbury, it's a gigantic pattern that recreates the functionality of Game of Life on a massive scale. It's hard to explain but the idea is creating a Langton's Ant pattern where the ant creates giant pixels on a grid that follows the same rules as Langton's Ant, so if you zoom out really far it looks like the regular thing even though the pixels are actually made of thousands of tiny pixels.

  • @dolph1nn
    @dolph1nn 5 місяців тому

    I wonder how someone could generate a langton's ant algorithm that would produce a mandelbrot zoom freezeframe im sure its gotta be possible

  • @hiiistrex2838
    @hiiistrex2838 5 місяців тому

    What happens if you let one of the rules say to go straight?

    • @cyberhelix5152
      @cyberhelix5152  4 місяці тому

      You'll get more different patterns, I used just L and R to keep it simple.

  • @gravityshark580
    @gravityshark580 5 місяців тому +1

    yay

  • @yamer_ai
    @yamer_ai Рік тому +3

    nice program where can i downlod it?

    • @cyberhelix5152
      @cyberhelix5152  Рік тому +2

      I'm doing some modifications. Once it's done (hopefully soon) I'll make another video, and make the repository public.

    • @yamer_ai
      @yamer_ai Рік тому +1

      @@cyberhelix5152 thank you, I might use the program for my school when you are done programming it.

    • @cyberhelix5152
      @cyberhelix5152  Рік тому +1

      @Yamer I've made the repository public, you can find link in description.

    • @yamer_ai
      @yamer_ai Рік тому +2

      @@cyberhelix5152 thanks a lot mate

    • @D43123
      @D43123 9 місяців тому

      So does any one know what the path is I do

  • @NandrewNordrew
    @NandrewNordrew 5 місяців тому

    You could probably make any image you wanted if you added more complexity to the ant rules
    (Like Turing machine type things)

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому

      you are right, Langton's ant is universal Turing machine

  • @marticus42
    @marticus42 5 місяців тому +1

    Love it~! moar plz

  • @YoutubSosetXui
    @YoutubSosetXui 5 місяців тому +1

    Some of them could have ran for longer. Pattern kept changing and evolving

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +10

      When I watch the video now, there are a lot of things that could be done better, but it would take too much time to finish it. So next time, I will make it better :)

    • @YoutubSosetXui
      @YoutubSosetXui 5 місяців тому +2

      Cool video overall hope your channel grows

  • @D43123
    @D43123 4 місяці тому

    Very interesting a shame not many know what they are looking at and there is only one that does know what is going on

  • @exceletor3426
    @exceletor3426 5 місяців тому

    so now i know the secret of the ant block in minecraft

  • @balijosu
    @balijosu 5 місяців тому +1

    Now do hexagons

  • @96thelycan
    @96thelycan 5 місяців тому

    redo this with accented color pallets.

  • @MrCamoga
    @MrCamoga 4 місяці тому +1

    Try some of these on a large grid (at least 4000x4000) :)
    LLRLLLRLLRLRLLLLLLLRLRRLRLR
    RRLRLLRRLRRRRRRRRRLLLLRLRR
    RRRLRRLLRLRRRRLLRRLRLRRR
    LRLRRLRRLRRLRRLRRRRRRRRLLLLR
    LLRLRRRLRRLLLRRLLLLLLRLLRLRR

  • @klozy2
    @klozy2 4 місяці тому

    -0:01 look a fractal

  • @TheAgamemnon911
    @TheAgamemnon911 5 місяців тому

    I beg to differ. There are _plenty_ of ways to describe what is an interesting image and what isn't. Depending on your personal definition of 'interesting' you don't even need fancy AI for that, just tracking some more useful statistics than just iteration count.

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +1

      For me, an interesting pattern is one I haven't seen before. I'm working on another similar project. Feel free to suggest some approaches; I might use them to filter patterns. Thanks

    • @TheAgamemnon911
      @TheAgamemnon911 5 місяців тому

      @@cyberhelix5152 Okay, that is a rather vague definition - which makes the investigation open ended and interesting, YES!
      For relevant source data I would:
      - Track number of blank cells touched and count of cells grouped by color
      - Track the max and min coordinates the ant has visited (gives rectangular bounding box)
      - Track ant position in polar coordinates: Distance from origin and angle (if it's too slow, approximate)
      - (maybe experiment with tracking moving averages of the above on a dynamic window with varying length calculated from boundary size and/or distance and/or iteration)
      These are time series that I would give the standard treatment to start. That is: Bulk-analyze for linear, quadratic and periodic behaviors. Then condense further, find commonalities, construct a few dozen or so of what I'd call 'signature metrics' that can tell about short-term and global behavior without looking at the picture itself. (I'll not spoil what I expect to see for each kind of pattern. Figuring that out is what I consider to be the fun part) If I really wanted to get fancy, I'd run a cluster analysis on those signatures and examine outliers more closely. Any rule that settles into a predictable pattern within n iterations I would filter out / set aside. Any that don't settle into one of the main patterns will stand out from the others and thus be interesting - to me - and worth running more iterations and see if it will stay chaotic or eventually go highway or floodfill or be of a class of patterns that the method described above doesn't easily catch.
      Have fun!

    • @cyberhelix5152
      @cyberhelix5152  5 місяців тому +1

      That's great advice, thanks, I'll try to implement it.