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
Using Langton's Ant to produce fractals is something mathematicians can study for years.
I challenge that
@@s_w_i_s_s_c_h_e_e_s_e3.. 2.. 1.. FIGHT!
I think the most amazing part of this all is that it takes millions of turns to generate the images
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.
@@cyberhelix5152 It could be possible that given enough time and space all permutations would stabilize, but good luck testing that theory. lol
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
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
What makes a counter useful/interesting?
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
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.
Yeah, they are pretty cool. Consider giving a like, and if you feel particularly mesmerized, you could even subscribe :)
I couldn't... i would fall asleep because they're so hypnotic.
7:50 looks like crystals growing in a surprisingly organic way, beautiful, beautiful
Because Langton's ant is grow fractally and crystals grow fractally
The first of these is such an incredible find! The sierpinski triangle making an appearance is so interesting and mysterious.
There were quite a few rules with the Sierpinski triangle. This one was the most symmetrical and interesting.
7:27 looks like a cardioid
i think it also looks like a brain
this is definitely my favorite 0 player simulator now, conways game of life was my 2021 adiction
This is amazing. I am an animator and this could come in useful for motion graphics.
Some of these deserve to have longer and larger renderings done.
8:00
we found the ant at the back of the classroom
I didn't know that the Sierpinski triangle could appear in Langton's ant
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.
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.
@@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.
@@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.
I agree, it could be cool, but getting the right configuration of ants would be challenging.
I feel like there is not a lot of videos of interesting patterns, So thanks for the work and the video
There are some patterns I've never seen that I decided to include in the video. Glad you liked it
Sick video man!
Thanks :)
i really like the patterns in 8:39, 11:15 and 12:07
4:20 Langton's Bismuth :D
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!
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
@@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.
Honestly the journeys were part of what interested me. Those, and the Mandelbrot one. @cyberhelix5152
Fractal!
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
very descriptive. I like these
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
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?
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.
youtube algorithm blessed me 🙏🙏
Can it be used to optimize video games ? Like a process for decide when we downscale renders of triangles meshs
Neato!
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.
I know they exist, but that's about all. I'll check them out. Thanks for the suggestion.
is it possible to design an ant's inputs to guarentee in finite steps it will reach a precspecified design?
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.
I couldn’t believe that one that looked like a cardioid I was not expecting that
i am your 7 subscriber :D
pretty cool :)
it's interesting how does it make solid color regions
So this the the origin of the Minecraft ant block
I think a simple algorithm would be to get patches of similar colors and make some scoring system
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.
Is there a pattern for "Langton's Ant in Langton's Ant" like the same thing in Conway's game of life?
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.
@@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.
I wonder how someone could generate a langton's ant algorithm that would produce a mandelbrot zoom freezeframe im sure its gotta be possible
What happens if you let one of the rules say to go straight?
You'll get more different patterns, I used just L and R to keep it simple.
yay
nice program where can i downlod it?
I'm doing some modifications. Once it's done (hopefully soon) I'll make another video, and make the repository public.
@@cyberhelix5152 thank you, I might use the program for my school when you are done programming it.
@Yamer I've made the repository public, you can find link in description.
@@cyberhelix5152 thanks a lot mate
So does any one know what the path is I do
You could probably make any image you wanted if you added more complexity to the ant rules
(Like Turing machine type things)
you are right, Langton's ant is universal Turing machine
Love it~! moar plz
Some of them could have ran for longer. Pattern kept changing and evolving
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 :)
Cool video overall hope your channel grows
Very interesting a shame not many know what they are looking at and there is only one that does know what is going on
so now i know the secret of the ant block in minecraft
Now do hexagons
redo this with accented color pallets.
Try some of these on a large grid (at least 4000x4000) :)
LLRLLLRLLRLRLLLLLLLRLRRLRLR
RRLRLLRRLRRRRRRRRRLLLLRLRR
RRRLRRLLRLRRRRLLRRLRLRRR
LRLRRLRRLRRLRRLRRRRRRRRLLLLR
LLRLRRRLRRLLLRRLLLLLLRLLRLRR
-0:01 look a fractal
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.
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
@@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!
That's great advice, thanks, I'll try to implement it.