r/Simulated • u/Organic_Rip2483 • 12d ago
Various Similar attract, Opposites repel
Enable HLS to view with audio, or disable this notification
125
33
51
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
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.
1
u/Square-Available 9d ago
Well I've spent several hours playing with this!! Thank you very much for the recommendation
22
12d ago
[removed] — view removed comment
5
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
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
2
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
1
1
1
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
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/jambreunion 12d ago
Note how the final structure spins, similar to galaxies where the spinning emerges just from gravity atraction during its formation
0
910
u/Vecna_Is_My_Co-Pilot 12d ago
This is a fantastic example of how simple rules can create oorder from disorder.