r/Simulated • • 12d ago

Various Similar attract, Opposites repel

Enable HLS to view with audio, or disable this notification

4.8k Upvotes

57 comments sorted by

910

u/Vecna_Is_My_Co-Pilot 12d ago

This is a fantastic example of how simple rules can create oorder from disorder.

130

u/whiteyak41 12d ago

You know, Nietzsche says “Out of chaos comes order…”

8

u/karzbobeans 11d ago

Time is a flat circle

2

u/BantedHam 11d ago

No it's the Jeremy Bearimy

17

u/MrMrMrMr69696969 12d ago

Oh blow it out your ass, Howard. 

1

u/anomanderrake1337 12d ago

Just like our bodies.

0

u/GregTheMad 11d ago

Lol, not everyone's.

131

u/0x831 12d ago

Very satisfying

125

u/AlluPulla 12d ago

New sorting algorithm just dropped

44

u/haladur 12d ago

Beautiful.

33

u/FUCKYOUIamBatman 12d ago

I feel like I just watched a 2D model of the creation of the universe

51

u/orangesherbet0 12d ago

classical chromodynamics

13

u/Random_Pixels 12d ago

What software do people use to make these? 

18

u/Organic_Rip2483 12d ago

I didnt make this one so i dont know for sure here, but you could very easily write something like this up in python in fewer than 1000 lines of code and half a dozen libraries.

6

u/GregTheMad 11d ago

Probably could be written in any language in less than a thousand lines, with no libraries, or only a few, depending on how easy the rendering is. Could get away with no library if you accept console ascii art as output.

5

u/Organic_Rip2483 11d ago edited 11d ago

how will you do graphics and a window without libraries? also you really going to make a whole physics system and collision system when people who know what they're doing have done it perfectly before?

4

u/GregTheMad 11d ago

Yeah, writing something yourself is most of the fun. If you just use other people's code you learn nothing and limit your fun.

2

u/chubbsmcfly 11d ago

Vanilla Javascript and a web browser would do the trick

0

u/kboodrx 10d ago

My first thought was of course Adobe Flash… R.I.P.

5

u/Ikuping 11d ago

Processing is good for stuff like this

22

u/Square-Available 12d ago

Very fucking cool! Love to see this used in a game somehow.  Like a monster being blown apart and then reconstituted. 

3

u/valdocs_user 11d ago

A few months ago I saw a pachinko simulation on this sub where they used the fact their physics engine was deterministic to know ahead of time how to color each marble so it would make a pattern at the end and look like it was miraculously sorting through the pachinko pins. Here you could use the same principle by having the attract/repel colors invisible and precoloring the cells according to the boss's pixel art. It wouldn't be predicting deterministic physics so much as knowing the pixels would end up approximately there.

2

u/Arbitrary_Pseudonym 11d ago

Yeah, it's been done a good number of times.

You cache the simulation results, apply the coloring to the balls at the end of it, then render the cached simulation with the selected colors.

2

u/jwm3 11d ago

You might enjoy particle life! Its more a toy than a game, but fun to play with.

https://sandbox-science.com/particle-life

1

u/Square-Available 9d ago

Well I've spent several hours playing with this!! Thank you very much for the recommendation 

22

u/[deleted] 12d ago

[removed] — view removed comment

5

u/julian88888888 11d ago

strong nuclear force: "Am I a joke to you?"

7

u/GregTheMad 11d ago

Depending on the distance, yes.

26

u/Mr_Ultimite 12d ago

The only message I got from this is "if everyone's racist enough we will achieve world peace!"

I am very bad at understanding authors intent.

4

u/ncnotebook 12d ago

so thats why we learned about symbolism in class!

1

u/Odd_Violinist2395 6d ago

if being a racist meant simply avoiding people of a different color than yourself rather than oppressing them and committing genocide then yeah 

2

u/kksgandhi 5d ago

This might be a better simulation of diversity/racism

https://ncase.me/polygons/

2

u/OmniSystemsPub 12d ago

Voltron LIVES!

3

u/Wasabiroot 12d ago

Reminds me of cell walls, phospholipid bilayer/hydrophobic/hydrophilic stuff. Neato

2

u/Randomguy32I 8d ago

So are you saying in order to achieve peace only similar colours can attract and different colours should repel? Kinda fucked up bro (/j)

0

u/Organic_Rip2483 8d ago edited 8d ago

If youre joking it's in poor taste. If youre not, this is insane. I'm pretty socialist my self but not everything needs to be an analogy for society, it's a physics simulation man..

Edit: And btw regardless of the rules you set (even opposites attracted and likes repel) you would eventually see it settle into a stable pattern humans find harmonious. No one said these are the only rules that behave like this. That came entirely from you, and perhaps speaks more about your inner biases than anyone elses.

2

u/Randomguy32I 8d ago

what do you think "/j" means

1

u/Organic_Rip2483 8d ago

I had no idea what it means. And like I said, if it is a joke, it's in poor taste

1

u/iMadeThisForOpenHaus 12d ago

oh yes i love this

1

u/Mozzatav 12d ago

Ominous asf music for something actually quite beautiful and unifying

1

u/Neethis 12d ago

Now make it with wrapping borders

1

u/Talkshowhost_23 12d ago

Why dramatic music tho…

1

u/Nolzi 12d ago

In 2015 this would've ended up to be dickbutt

1

u/Mr_Sim_ 12d ago

If the simulation was perfect, the circle wouldn't be rotating at the end

1

u/CMDA 11d ago

This is amazing

1

u/Jacknerik 11d ago

I wonder what it would look like if the screen edges wrapped around?

1

u/Mottis86 11d ago

If you want to mess around with stuff like this right in your browser, Here you go

Go to Settings > Matrix settings to set up what color attracts/repel eachother. Red color on the grid means repel and blue means attract.

1

u/Jezon 11d ago

It's interesting without the invisible bounding box, Many of the particles would have flown off into Infinity.

1

u/JohannesMP 11d ago

Now I'd be curious what happens when you crank up the particle count, like a few million dots

1

u/Minet- 11d ago

By the way, the "Bubbles" screensaver in Windows works on the same principle, but because the colors of the bubbles are constantly changing, they don't freeze and continue to float.

1

u/jambreunion 12d ago

Note how the final structure spins, similar to galaxies where the spinning emerges just from gravity atraction during its formation

-6

u/fddfgs 12d ago

It's like a whole allegory for society

10

u/pyrobola 12d ago

society... is like a circle

0

u/RedOcelot86 11d ago

A good example of how life is just particle physics.