Тёмный

Create Artificial Life From Simple Rules - Particle Life  

Brainxyz
Подписаться 23 тыс.
Просмотров 736 тыс.
50% 1

Source Code and Program:
github.com/hunar4321/particle...
Click here for a live demo:
hunar4321.github.io/particle-...
This project was inspired by: Jeffery Ventrella's Clusters www.ventrella.com/Clusters/ I don't have access to Ventrella's code but I guess the main difference of my project with the other particle life projects is that I didn't implement collision detection and this has simplified the simulation. Also, I added GUI controls to change the parameters in real-time. This allows easy fine-tuning & exploration, hence, I was able to find some never-seen-before patterns emerge form some extremely simple models of relations.
The code here is probably an order of magnitude simpler than any other Artificial Life codes out there because I started this solely as an educational material for non-programmers and the general audience.
Other related videos:
Simulation Hypothesis: • Create a Universe From...
Local Maxima: • Who Wins in a Simulati...
Related topics:
#programming #game #simulator #alife #life #evolution
Particle Life Simulation
Primordial Soup - Evolution
Conway's game of life
Cellular automata
Self organizing patterns
JavaScript programming
❌ Disclaimer: Please know that we do not place any of the ads on this video. Since we use copyright-protected music, ads are placed by RU-vid automatically to generate revenue for the license holders of the music.
Music in the video:
Cjbeards - Fire and Thunder
Death Note - Low of Solipsism
Firefly in a Fairytale - Gareth Coker
Buried Desire - Divine
00:00 Simulation Demo
02:40 Code Walkthrough
08:28 The Program
09:08 Explanation
11:25 More Demos

Наука

Опубликовано:

 

3 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1,2 тыс.   
@clfleishman
@clfleishman Год назад
If you came up with this you’re a genius. Even if you got inspiration from other projects making something with that little code that can simulate these complex emergent properties is a huge achievement
@brainxyz
@brainxyz Год назад
Thanks for the compliment. This project was inspired by Ventrella's Clusters (the link is in the descriptions). Once I wrote the code, I spent the entire month trying to make the code as concise as possible and as educational as possible. Hopefully, this presentation inspires more work on investigating emergent patterns from very simple rules.
@christianremboldt7028
@christianremboldt7028 Год назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-makaJpLvbow.html
@HardcoreMontages
@HardcoreMontages Год назад
no, this isn't an original idea. Code Parade did it first.
@reversev9778
@reversev9778 Год назад
@@HardcoreMontages code parade was nowhere near the first
@commenturthegreat2915
@commenturthegreat2915 Год назад
Guys, these things have existed for decades. Nearly every youtube coding series out there is drawing upon earlier research and isn't a breakthrough in of itself. The beauty here isn't "being original", it's presenting things in a simple and accessible way.
@ecliptic2ecliptic111
@ecliptic2ecliptic111 Год назад
I've never seen an algorithm of this simplicity granting such lifelike behavior. Truly Impressive
@Mushele
@Mushele Год назад
game of life
@estebanod
@estebanod Год назад
@@Mushele game of life is nowhere near a living cell simulation
@Mushele
@Mushele Год назад
@@estebanod neither is this
@Mushele
@Mushele Год назад
@@estebanod the point is, the game of life shows very well, just like this demonstation that we see above, that a set of very simple rules can produce very complex and unpredictable behaviours(just like in real life)
@RavenMobile
@RavenMobile Год назад
@@Mushele This is far closer to representing emergent life coming from simple rules than Conway's Game Of Life. I absolutely love Game Of Life, but this looks like what one sees from microscopes. Cells consuming other cells, cells losing their cell wall and leaking their insides, cells that are highly active, other cells that are mostly stagnant, etc.
@joshmyer9
@joshmyer9 Год назад
I wonder how much more emerges if we make the rule coefficients a function of a common parameter (we can call it "temperature"), then have that variable go through a "day cycle" of sin(t). This might make some of the very unstable/twitchy patterns more stable for a bit, and vice-versa. Or make t itself a function of (x,y) and make warm/cool pockets with different stable patterns, swapping particles between them. Lots of neat stuff to play with here, thanks for sharing it!
@WomboBraker
@WomboBraker Год назад
Thats a cool idea
@giannipiccioni8411
@giannipiccioni8411 Год назад
slightly differences in the game rules with add exponentially more complex structures. Like in real life
@AlissonNunes
@AlissonNunes Год назад
Isn't "temperature" the "value" of how much particles moves? At a certain point, some measurements that we use at normal level doesn't apply to molecular level
@AlissonNunes
@AlissonNunes Год назад
The "temperature" increases by the sun that emits radiation (photons), which are more molecules... Or I'm just being dumb
@joshmyer9
@joshmyer9 Год назад
@@AlissonNunes Not dumb, but I do think you're taking the model a little too literally (which his presentation kind of encouraged). This model is too simple to capture anything like that level of detail. It gives us big picture, super hand-wave-y patterns, which is neat, and helps guide one's thinking for more fine-grained problems. This is why I said "call it" temperature: it's a kinda-sorta analogue for temperature within the very coarse-grained model we're using. Honestly, my motivation is entirely to make it fun to watch for longer. It's a bummer that each model stabilizes to a static state, though. I'm mostly interested in finding ways to make it visually interesting for longer spans of time =)
@NorthernHurricane7
@NorthernHurricane7 Год назад
While Conway's Game of Life has been impressive for a long time, the striking part of this adaptation is the organic way the movement, shapes, and patterns appear. There are a number of ways to use this approach to visualize concepts about chaos, probability, prediction, and determinism in systems. The first-principles development approach to set it apart from similar programs is the cherry on top. It looks great!
@JatPhenshllem
@JatPhenshllem 5 месяцев назад
Oh hey
@user-ec3rm9wr1n
@user-ec3rm9wr1n 2 месяца назад
Amazing
@Daniel-Davies-Gonstead-Student
As a person who has never coded before but is interested in biology this was really cool!
@ruffianeo3418
@ruffianeo3418 Год назад
Computers and code are the most accessible facsimile to a generic laboratory. Be it some finance stuff, physics, biology, quantum mechanics - whatever - if you take an interest and want to see how an idea pans out, coding is the way to go. Frankly, it even teaches respect to all those scientists before the computer age, who managed to produce useful insights without computers :) But today, anyone should be able to code a little, so they can use it as a tool of learning.
@mauritspuggaard4689
@mauritspuggaard4689 Год назад
Currently studying computer science at university, and this dude is one of the reasons I love what I do and keeps getting inspired. Keep up the good work, you’re a legend!
@bencressman6110
@bencressman6110 Год назад
Dude, this was so, so well done! From the pacing, to the code walkthrough, open source, pop culture reference, music, video length. Superb. I love artificial life, and this is so exciting to see. You discovered some really dope paramaters
@JB-fh1bb
@JB-fh1bb Год назад
I don’t know whether I have enough experience to understand what might be complex for others, or whether it’s just that simple, but whatever it is I’m stunned by how simple the explanation is and how beautiful the results are. 10x points for starting from 0 with a single empty html file.
@bacillusanthracis9073
@bacillusanthracis9073 Год назад
Super interesting. In some of these simulations, there even were shapes ressembling cell division and macrophages phagocyting !
@mehrshadfarahani6071
@mehrshadfarahani6071 Год назад
I don't know what to say man, it just changes the way I look at the universe. Thank you for sharing this. Great job.
@thomassheldon2365
@thomassheldon2365 Год назад
WOW!!! I’m only halfway through the video but I’m already mindblown! It’s amazing how such a complex system can arise from so few rules!
@i_never_asked_for_an_alias
@i_never_asked_for_an_alias Год назад
You Sir have that special talent of not only making something very intersting but also explain it in a simple way.
@Lunsterful
@Lunsterful Год назад
Sublime presentation, impressive on several fronts, well done. I've seen explorations of this concept from Conway, Hoftstadter, and Wolfram as you mentioned, but I don't think I've seen anything close to this level of elegance and complexity of emerging behaviour. I think the key differentiator is adding clean, physical laws with an emphasis on simplicity - and then allowing time to take over. You also make many astute comparisons and analogies in this video. Imagine how complex our simulations could be in decades to come!
@rfly-fpv
@rfly-fpv Год назад
Oh man, this is truly amazing! First time ever I see code explained in such way with examples on the right. Really you deserve millions likes on this video
@carel91
@carel91 Год назад
This is not just perfect presentation of amazing simulation with source code, code walkthrough tutorial, but also metaphysical essay with humor and great images. I am really thankful for your work. Thank you. I will be pleased to try your program and to code my from your tutoring. Amazing
@goaty1208
@goaty1208 Год назад
This has kickstarted an amount of coding and phylosophical questions inside of me that are beyond comprehension. This is amazing.
@Eichro
@Eichro Год назад
I really appreciate how you show step by step how to achieve it with plain vanilla js
@n00dles79
@n00dles79 Год назад
I am unsure if I have ever seen anything this amazing. Thank you so much for the open GitHub file man you’re a legend. I’m at my desk screaming.
@alexhuang7681
@alexhuang7681 Год назад
While looking at the thumbnail, it's complexity put me off from watching the video, thinking "I'm probably not going to understand a thing". But upon actually watching it, you showed that the rules are so simple that you could go through writing every line of code in a small portion of the video. Stunning.
@SeanStClair-cr9jl
@SeanStClair-cr9jl Год назад
Wow. I've seen these kinds of simulations before, but what I was not expecting was this level of production and entertainment. Cool stuff, hope your channel gets the subs it deserves!
@nowar452
@nowar452 Год назад
Very cool project! It's not really a life simulator. It's more like simulating chemistry from another dimension. If you add here not only particles, but also waves, you get a quantum physics simulator!
@lemming7188
@lemming7188 Год назад
How could one go about adding waves to a program like this?
@francovillarreal7266
@francovillarreal7266 Год назад
@@lemming7188 Divide the screen into a grid, and give each cell a vector, make the cells influence their neighbors, make them change color depending on the intensity of the vector. Some thing like that, thou I'm sure there are dozens of ways of implementing this, and probably all of them run faster than my idea.
@nowar452
@nowar452 Год назад
@@lemming7188 wery good question. My suggestion about waves is more joke than offer. But i think waves could be a carrier's of powers like in real world. The simulation have a lot of powers. Every link between particles with different color is power. Every power would be an elastic plane and every particle would pertrub the plane. Waves move on plane and influence to other particles. Of course, it is very complicated. And it will be absolutely not same programm.
@christhorne116
@christhorne116 Год назад
Hmmm whoop whoop pump the brakes there sonny…just adding waves will NOT give you QM
@zarinavarina8580
@zarinavarina8580 Год назад
@@christhorne116 Adding stochasticity to maxwellian electrodynamics is enough to produce the results of QM in the linear regime. Adding non-local sources (wave-like rather than point-like) to that would probably be enough to capture at least some of the non-linear QM phenomena.
@katungwakioko465
@katungwakioko465 Год назад
I'm a python and coding beginner and such projects are an inspiration to continue learning and not give up. To me, this is a masterpiece even if I don't understand the code. Thank you.
@uuquuuquu5235
@uuquuuquu5235 Год назад
This is by far the best video I have ever seen explaining the idea of emergence. Kudos to you.
@cogtortion
@cogtortion Год назад
Thank you for this, amazing video, great explanation, I certainly did not expect to actually be shown the code let alone a full rundown from scratch. Please make more videos like these, the motivation it brings to open up a code editor is next level, these are the types of videos I wish I could find more of, perfect pacing, i like how you sped up most of the coding to match your explanation as you went. Other people would have turned this into a 3 hour tutorial including all their mistakes, fixes, overexplanation, etc. Very wonderfully produced. You sir have an amazing brain. Thanks again.
@GuilherminoBr
@GuilherminoBr Год назад
This is one of the coolest life like simulations I have ever seen
@pocketallen1051
@pocketallen1051 Год назад
it's real amazing product I have seen. It demonstrates how complexity is emergent from simple rules. Thank you
@EgonFarkas
@EgonFarkas Год назад
Hihetetlen, milyen egyszerű csak maga a létezés, a kölcsönhatások elkerülhetetlenek. Kiváló leképezése még ennek is, amit írtam.. Gratulálok!
@archilious
@archilious Год назад
Amazing job! Thanks! I looooved the "Explanation" section specially. Really well done. Also the ending show with the music was so matching. Can't wait to see your future videos.
@karmatical5837
@karmatical5837 Год назад
I like how you made and explained the code part by part, i believe even a beginner can understand your video and with your explanation i can convert this concept to other languages and plataforms and apply my own ideas, thanks for helping. Someone already said, but you are a Genius, you have a lot of potential and you are using it for good. Keep the amazing work.
@sammyclassicstarfoxfan9827
@sammyclassicstarfoxfan9827 Год назад
This is by far the most interesting cell simulation i have seen
@paulodonovanmusic
@paulodonovanmusic Год назад
this is the coolest javascript I've seen in my 10 years of coding. Amazing, can't wait to try it!
@KenoBeatZ
@KenoBeatZ Год назад
This was... Mind-blowing !! 🤯 First introduction to code, and I understood mostly everything that matters, in order to give life to all that "matter"'. Impressive ! Thank you
@cedricpelsma6012
@cedricpelsma6012 Год назад
This is one of the coolest things I have seen in a while.
@rudawabdulrahman1010
@rudawabdulrahman1010 Год назад
I can see that your content quality is improving. Keep it going.
@codeunited5905
@codeunited5905 Год назад
I came here to know about Particle Life and learned more philosophy. Tysm for the video, it looks absolutely splendid!
@tranquillities1205
@tranquillities1205 Год назад
Excelent video! This is the first time I have seen simple code come together in such a beautiful way thank you.
@mosaic34
@mosaic34 Год назад
Wow I am impressed ! This is genius man. This is so meta and also shows how life actually is formed cause of different behaviour of particles!
@heliquackterstudios
@heliquackterstudios Год назад
"I know this universe is set up against me" - Had a solid chuckle 😂. Rock on brother, really nice work.
@MarkAhlquist
@MarkAhlquist Год назад
The online demo is great, thank you! It seems that every random rule-set has something interesting going on.
@Vetrivel.Shanmugam
@Vetrivel.Shanmugam Год назад
is this based on rule-set ?
@zbnmth
@zbnmth Год назад
Glad to see complexity theory become more and more mainstream and well-explained
@redstoneranger1404
@redstoneranger1404 Год назад
What a great piece of work! This is even more amazing than Game Of Life. You HAVE to do a 3D version.
@nicolasgaritagoitia5536
@nicolasgaritagoitia5536 Год назад
This is the best video i've seen on RU-vid for a very, very long time
@Pencil0fDoom
@Pencil0fDoom Год назад
Spectacular. From core concept to implementation to presentation. This universe is stacked FOR you dude. You’ll be a yactillionaire before long.
@CarloRoosen
@CarloRoosen Год назад
Wow this is really incredible. I have always been fascinated by life-simulation programs after I first saw Game Of Life. But I never saw one where the emerging forms and behaviors resulted in such a beautiful diversity. Really, you came close to the secret of life itself...
@vornamenachname597
@vornamenachname597 4 месяца назад
Wow! That stuff around 12:28 really resembles mitosis, crazy!
@chibula
@chibula Год назад
The shakiness is purely becasue of the instability of explicit time stepping used in nemerical integration (an artifact). Also this is a perfect example to use webgl shaders to acceelrate (save particle position and velocity as rgba in a float texture, read them in vertex shader and update), render a quad with same amount of pixels mapping to the particles
@operandassembler
@operandassembler Год назад
Just wanted to stop by and say this is the coolest fucking thing I've seen as a programmer for a long time. Got me excited even. I want to make one of my own now! Thanks stranger!
@TheFishmonger2000
@TheFishmonger2000 Год назад
This is very well done! Thank you for making and sharing this. I can't wait to show this to my students.
@masterrguy4465
@masterrguy4465 Год назад
Please do an hour long video of just this! It's so satsifying.
@ayior
@ayior Год назад
This video is amazing and underrated. I've been following life simulations as a hobby for a couple of years now and this is one of the most interesting ones I've come across in a while! It seems like a more advanced Boids, the organicness of the patterns, simplicity of the code and presentation is amazing. My cell biology knowledge is a bit rusty, I think I remember polarity being an important factor in osmosis? I love the elegance of this simulation and would hate to ruin it, but I wonder if more complex mechanisms can be simulated by taking more inspiration like that from real life cells. Edit: maybe I'll try recreating this (Don't know C++ so I'll have to go from scratch) and somehow add in lifespan and evolution to get changing cells... somehow... I'll have to think on it
@AM-ui9mc
@AM-ui9mc Год назад
I’ve been looking for this exact type of simulation for years!! Thank you thank you
@konstantinabakumov5861
@konstantinabakumov5861 Год назад
Wow, you so clearly demonstrated how life emerged with this simulation
@Eltro101
@Eltro101 Год назад
I deobfuscated Ventrella's code once a long time ago. I think it worked in a very similar way, with predicting the other particles positions, except I think in his the rules can be dynamically redefined for particles based on who they've encountered so far
@RabRabNZ
@RabRabNZ Год назад
Amazing. This is the game I've wanted since spore
@bozdoganli666
@bozdoganli666 Год назад
This is gorgeous, I also implemented the game of life years ago on Canvas which is cool. This is a bit more complex then Game of Life (Conway's). You made it so simple that people can understand and improve it. Kudos!
@silentnight.official4261
@silentnight.official4261 4 месяца назад
I got a tell you. It was perfect. Perfect. Everything, down to the last a few detail.
@n0deguy
@n0deguy Год назад
Wow. I’m really amazed of that little amount of views.. Your work is very cool, hope you get much more views and subs!
@brainxyz
@brainxyz Год назад
As I said in the video, this universe setup is against me! Edit: OK now the views have increased dramatically. The settings of this universe may not be against me 😅
@n0deguy
@n0deguy Год назад
@@brainxyz Incredibly! xD
@dreadflow3155
@dreadflow3155 Год назад
Because of the music, I kept waiting for him to say "And I will become the god of a new microworld"
@MrKohlenstoff
@MrKohlenstoff Год назад
Really well made video! Even knowing Conway's game of life and everything, I still didn't expect these rules to create such a level of complexity. Very nice, can't wait to play around with something similar on my own. :)
@matjetius
@matjetius Год назад
This is a nice expansion of particle life simulations I knew I had seen long ago. After some digging, "particle life" seems to be the key search term. The first version in this vein appears to be from 2016, but the rules were simplified to be more like we see here in videos around 2018.
@williamihardwick2871
@williamihardwick2871 Год назад
This is way cool! I’d love to see more stuff like this! It’d be interesting to see what kind of self-organizing patterns could emerge from more than 4 fundamental particles, and/or with additional dynamical interactions
@aliceberethart
@aliceberethart Год назад
This video is as much a lesson in biology, programming, math, astronomy, and physics as it is a lesson in literature.
@quebono100
@quebono100 Год назад
this one was one of the best videos about programing ive ever saw
@95Geli
@95Geli Год назад
Its a crime that this channel doesnt have wayy more subscribers.
@nick2629
@nick2629 Год назад
You are a genius
@OutbackCatgirl
@OutbackCatgirl Год назад
This is friggin cool. A "randomize" button in the C app would be amazing
@JB-fh1bb
@JB-fh1bb Год назад
It might be a good first pull request to the repo
@waterpicker6879
@waterpicker6879 Год назад
@@JB-fh1bb Its number 7 apprently.
@JB-fh1bb
@JB-fh1bb Год назад
@@waterpicker6879 🎉
@clivemyrie4209
@clivemyrie4209 Год назад
Great stuff! A good motivation to get me back into doing what I studied college. Much appreciated.
@PokeKnoxDSRomHacker
@PokeKnoxDSRomHacker Год назад
Don't know why this is on my homepage but I'm glad it is!
@TheHottrod3000
@TheHottrod3000 Год назад
Very innovative. I’m a junior developer/Art & Designer. I would love to play with the code and make some nice visual elements. Imagine what you can come up with while using Zbrush, Maya, Blender and Unreal Engine.
@kitoru
@kitoru Год назад
do it
@AlanZucconi
@AlanZucconi Год назад
Whoa! This is beautiful! 🤩
@HarhaMedia
@HarhaMedia Год назад
Interesting interactions with simple rules indeed. I coded similar simulations years ago when I first started programming, but I never discovered anything of this level. Now that you tickled my curiosity, I want to add the 3rd dimension to your simulation and see what comes up with similar rulesets.
@The-Martian73
@The-Martian73 11 месяцев назад
If there's one sentence I have to say about this channel to this man ... that sentence would be: Don't never ever stop ... Please!
@iruns1246
@iruns1246 Год назад
Amazing work! It'd be a million times better if combine this with evolution-like process. What I can think of: 1. Add a new type of object, let's call it "nucleus" 2. Genetic information: Each nucleus stores the information of formation of particles in polar coordinates to it. e.g. red: [ [1, 90], [2, 45] ], blue: [ [2, 60] ] Each will be spawned surrounded by other particles arranged according to the gene. 3. Metabolism: Each time there's another type particle that is close enough to a nucleus, it will "eat" it and increment a counter of that particle inside it. e.g. red++. 4. Reproduction: When there's enough particles eaten to satisfy the number of particles of each type needed for the genetic code e.g. red == 2, blue == 1, another one of this nucleus will be spawned elsewhere 5. Mutation: For each reproduction process, there's a chance of a small change in the genetic code. 6. Death: Each time a particle that a nucleus "owns" is eaten or gone too far, the HP of that nucleus is reduced. If it's 0, the nucleus dies. 7. Growth: The genetic information can be split into stages and the nucleus will need to consume enough particles to go to its next stage. It means the consumed particles will be respawned around the nucleus based on the next stage's gene. Reproduction will be done after the last stage is reached.
@jonrjeffrey
@jonrjeffrey Год назад
Technically shouldn't analogues of all of these sorts of processes (hopefully) emerge with the right fine tuning of parameters?
@iruns1246
@iruns1246 Год назад
@@jonrjeffrey I think it should, but it would require orders of magnitude more particles, and particle types. The synthetic nucleus there should act like a shortcut that represents a mechanism that would require tons and tons of particles to function.
@rsanche4726
@rsanche4726 Год назад
this is exactly what all programming tutorials should be. Simple, clean, fast, to the point, and showing how it works. Thank You!
@Tubeytime
@Tubeytime Год назад
Did it work for you? I followed along and it didn't work.
@mememanfresh
@mememanfresh Год назад
i cant get html to display in chrome bruh its blank
@mememanfresh
@mememanfresh Год назад
now i cant yellow particles to appear i give up
@uzuna4205
@uzuna4205 Год назад
This is just beautiful. I am amazed by your work. This is so pure , elegant.. i admire you!
@washinours
@washinours Год назад
This is so cool, I'm on a long haul journey to transition from art to ML & AI and you just got me inspired to try to build this in python when my knowledge of it will be sufficient, thanks a bunch! (I'll ofc give you credit for this)
@TheTenorChannel
@TheTenorChannel Год назад
Very beautiful project, I loved every part of it. Very interesting to see a Chladni Pattern emerge at 9:09 // these are known to be the nodal lines of a resonant body, and they literally plot Helmholtz equations solutions in function of frequency, the latter being quite omnipresent in any kind of physics, and even in neuroscience, structuring the causality within brain waves. Cheers
@CrystalStearOfTheCas
@CrystalStearOfTheCas Год назад
This comment made me go down a delicious rabbit hole. Thanks Chladni is goat
@dzidmail
@dzidmail Год назад
Some of the instabilities could be a result of simulating in discrete domain. Different sample time: if you multiply all the forces by 0.5, record the simulation and play it at 2x speed, the results with fast moving particles (e.g. instabilities) will be different. There are also continues domain solvers, but understandably that would make it not very approachable.
@wurfelgott1520
@wurfelgott1520 6 месяцев назад
Wow. The video was not just a programming demo but a story in and of itself!
@tmagrit
@tmagrit Год назад
One of the most impressive images I've seen lately
@BleachWizz
@BleachWizz Год назад
4:50 if you just take out the sqrt you can correctly calculate it squared and it's actually removing code.
@mccvargues7792
@mccvargues7792 Год назад
I came here to say that, taking a squareroot is a very expensive operation. But I also think that the behaviour will significantly change due to the distance being quadratic, which means that attraction over long distances will be way stronger.
@operandassembler
@operandassembler Год назад
@@mccvargues7792 Just in case anyone reading this doesn't fully understand what y'all are talking about, they mean you square the check distance instead of taking the square root of the computed distance. So.. instead of if (CheckDistance < sqrt(dx^2 + dy^2)) you use if (CheckDistance^2 < (dx^2 + dy^2)) then, you are within the tested distance without having to call the computationally expensive sqrt function. Good suggestion you two!!
@BleachWizz
@BleachWizz Год назад
@@mccvargues7792 I think yes but I think you said the opposite. he's using 1/d instead of 1/d^2 if he excluded the sqrt d would become d^2 and 1/d^2 would make the interaction between particles get weaker as distance increases than 1/d. So yes the behavior would change. But you'd be using the correct formula for gravity as he mentioned for less effort. And the interaction has become weaker for greater distances.
@loveistheonlything3626
@loveistheonlything3626 Год назад
Feels magical, like cellular automata. This feels as if life would actually emerge in a similar way.
@patriciogesualdi7472
@patriciogesualdi7472 Год назад
Very cool, not only from the technical perspective, but as a piece of content it's very well done and entertaining, thanks!
@broncoxy
@broncoxy Год назад
Man this made my entire morning, if not day; so fascinating!
@DavidLindes
@DavidLindes Год назад
This is cool! I typed in the js code, tweaked it a little*, and made a fish! :D (I wasn't setting out to make a fish, but that's what it looks like to me.) * added two parameters to rule(), one is the maximum distance for interaction (80 by default, as in your code), and the other is an option to do 1/d² instead of 1/d. Also a few other tweaks, but I think those are the most noteworthy. The rest was just playing with rules.
@waltermcmain1732
@waltermcmain1732 Год назад
i'm no physicist but these remind me a lot of how I imagine electron shells in atoms.
@larion2336
@larion2336 Год назад
several of them resembled ice crystals at times too
@mikkirefur
@mikkirefur Год назад
no such thing as electron shells in an atom.... think it more like a magnetic & dielectric field emanating from the atom, with the field having certain properties that can be "measured as electrons, and the size of the field." As the great physicists JJ Thompson stated, an electron is simply 1 unit of dielectric induction.
@9393bakus
@9393bakus Год назад
I very very much appreciate how u showed how it can be created with coding in realtime. Very good idea, presentation n explanation!
@lospenguin5208
@lospenguin5208 Год назад
Conway's elevated .. you explain it well and organize your content in a way that allows someone to learn .. good job. Keep it up. 🦅
@KarelMatthieuLLogro
@KarelMatthieuLLogro Год назад
With your foundation, this will allow others create more complex simulations of life
@kuwertzel7980
@kuwertzel7980 Год назад
Yooo this is amazing! I've seen a couple simulations like this in the past (eg. by "Particle Life" by Code Parade) but this is far more complex than what I saw so far. Good job! I tried making a simulation like this myself in the Unity game engine but the performance sucked and I ran into some issues... Shameless self promotion: I made a 'slime' simulation inspired by one of Sebastion Lague's videos and uploaded a little showcase of that on my channel :P It brings me so much joy seeing complex behaviour emerging from simple rules :D
@zbnmth
@zbnmth Год назад
Kuwertzel, Unity is a "fourth" level programming language. Physical logic gates -> Machine language -> Programming languages (C, Fortran, etc) -> Fourth level languages (Unity, Mathematica, etc).. That is to say, Unity has something like C between it and the machine code. Generally, the more user-friendliness you have, the less efficient the physical machine (CPU) is given instructions. Maybe you already knew, but it's why your program will run (very) slow when coded in Unity.
@dealloc
@dealloc Год назад
@@zbnmth This is just plain wrong. I've written Particle Life in JS (fnky/particle-life on GitHub) and its performance is fine. This is without much optimisations (no WebGL shaders, just Canvas and purely running on the CPU). Unity is first of all, not a programming language, but an engine. Secondly, any language can be slow if you don't know about pitfalls that are usually general to every language; i.e. allocating within a deeply nested loop can be very slow if not cached or managed properly. Doesn't matter whether you write Rust, C++, C or even Assembly. The important part is to understand those pitfalls and how to use the language to avoid them. C#'s runtime (CLR) is fast and is used in many applications, more complex than this. Not only that but your C# code is also heavily optimized through Roslyn before being translated into MSIL/CIL and then to machine code by the JIT compiler.
@dougfoster445
@dougfoster445 Год назад
I mean, really gives credit to the simulation theory. This is absolutely mind blowing.
@carlosgonzalez4112
@carlosgonzalez4112 Год назад
these are amazing !! much love brother and thank u for the insights!!! watching everything come together is a trip n a half yall lmaoo
@nembobuldrini
@nembobuldrini Год назад
0:55 reminds me a lot of a recent simulation of a proton model (quarks + gluons)
@brycering5989
@brycering5989 Год назад
I saw it also, had to scroll and use ctrl+F to find the word Proton to find you :D
@OscarLazzarino
@OscarLazzarino Год назад
This is incredibly cool and I love the walkthrough of the code. I have a question. You have some rules like rule(green, yellow, f1) and rule(yellow, green, f2). It looks to me that's equivalent to rule(green, yellow, f1+f2). Is that so?
@OscarLazzarino
@OscarLazzarino Год назад
Uh, no, looking closer at the code now I see that rule() only updates atoms in the first group. So you can have asymmetrical forces which is really "non newtonian" but is probably what allows the emerging patterns. Very cool.
@brainxyz
@brainxyz Год назад
Nice observation! but I don't think so because these rules specify uni-directional relationships
@brainxyz
@brainxyz Год назад
@@OscarLazzarino Yes to make it symmetric f1 should be equal to f2. Asymmetrical forces don't exist at the atomic level but I guess it is abundant at the level of large compounds, proteins, and enzymes
@user-rr7uh4wm5y
@user-rr7uh4wm5y Год назад
@@brainxyz all forces are symmetrical in real life according to Neuton's 3rd law. But this asymmetry might be why your simulation makes such interesting results, so imo it is a good thing.
@user-rr7uh4wm5y
@user-rr7uh4wm5y Год назад
@@brainxyz also there is no conservation of energy because of the asymetry. But again, I think it is cooler
@nafit15
@nafit15 Год назад
Thanks so much for sharing this! Hours of fun making up relationships or just hitting randomise (the code-along was fun too!)
@woodenfences
@woodenfences 23 дня назад
Brilliant. I was searching for life simulations and found your video which goes very quickly from a simple dance between two yellow dots to the whole mega freakin universe thing with all its complexity. Well done! Now, me go programming. . . .
@zoltarg
@zoltarg Год назад
Really great work! It would be amazing to put this into Unity 3D and also add the third dimension along with some smooth random camera interpolations to view everything.
@FreeScience
@FreeScience Год назад
It would be interesting to see what happens with a more sophisticated integration algorithm, such as Runge-Kutta for the force-acceleration-velocity-position.
@anywallsocket
@anywallsocket Год назад
smoother but slower motion
@FreeScience
@FreeScience Год назад
@@anywallsocket Sure, but I'm more I'm thinking things like preservation of momentum and energy.
@anywallsocket
@anywallsocket Год назад
@@FreeScience the dynamics will evolve differently, but only slowly as a divergence. The chaotic nature of the system will quickly override any predictability anyway.
@faisalwho
@faisalwho Год назад
His integration scheme is broken. He is isn’t accumulating forces and stepping, he is collecting forces and stepping at the same time.
@LegitWolke
@LegitWolke Год назад
love it, i actually wantef to do something Similar a few months ago, but never got to it and then forgot about it, thank you for making this video
@boredofhumaans1418
@boredofhumaans1418 Год назад
You came up with beautiful, intellectual, and extremely unique. You have earned many people's subs including mine. I hope you get the level of recognition you deserve.
Далее
Artificial Life. The battle of clans
19:34
Просмотров 443 тыс.
skibidi toilet 73 (part 2)
04:15
Просмотров 15 млн
Coding Adventure: Simulating Fluids
47:52
Просмотров 1,5 млн
How Particle Life emerges from simplicity
10:16
Просмотров 293 тыс.
10 weird algorithms
9:06
Просмотров 1 млн
I Simulated Evolution: Something Happened…
7:06
Просмотров 483 тыс.
Coding Challenge 180: Falling Sand
23:00
Просмотров 682 тыс.
Artificial Life. Extinct simulations
21:39
Просмотров 11 тыс.
Dirty Realme 9 Pro
1:00
Просмотров 22 тыс.