84 comments

[ 37.8 ms ] story [ 1210 ms ] thread
Nice. Have you tried a version where the particles have a small atraction/repulsion? (Bonus points for a bar to choose the force.) (1/r^2? can I choose the exponent?)
This is a very slippery slope towards making a full blown 3d three.js octree based n-body gravity simulation, at least for me :)
it doesn't have to be 3d though. another idea would be to assign mass values to the particles and see if after an amount of time if everything settles down to some sort of orbital track around each other. but either idea moves it from being a relaxing visual into a bit of sciencey simulator that totally changes to the scope of the project
It shouldn't be that complicated. I tried it once with gravity and without limits on the edges. The cluster of stars moved around in 2d space and stars were repeatedly catapulted out, which then disappeared. Maybe you need a super gravity (black hole) in the center to keep it stable.
From my experiments, you need to flip the velocity if it goes out of bounds, and have a little bit of drag, multiply each vel by 0.9999 each frame.

Otherwise, a few particles being ejected at very high speeds IS realistic... they carry away surplus kinetic energy, which allows the remaining cluster to contract.

And once too much matter has lost too much kinetic energy, it does converge and become a black hole.

The weird thing is that their radius scales proportional with their mass, not volume... so they grow in this weird way where adding a 3 solar mass black to a 3e6 solar mass SMBH causes the SMBH's volume to grow by several, several times the volume taken by the 3e0 BH. It's like black holes force themselves to grow in a straight line internally, but then the entire sphere encompassing that line becomes event horizon, which is probably why there only seems to end up being 1 SMBH per galaxy, they get so big so quickly at the 1e6+ range, that any other BHs drifting around the vicinity get absorbed by the growing EH, which causes the EH to grow more, causing it to absorb more BH... so there's this period where a bunch of relatively tiny, sparse black holes suddenly hit the critical density where the entire region they were all sharing suddenly pops into one huge event horizon that encompasses all the empty space they were sharing previously.

Did some experimenting with gravity, not sure how far the physics is correct, but looks okay

https://tiki.li/run/#cod=dVLbbuIwEH33Vxyp0gqKGhIktKVqeO1HIB5...

I was expecting a +/- charge interaction like this as well, but that was just based on my brain's default interpretation of the word particle in the title with this being HN and all. It took a second for my brain to switch to just a visual fx particle system use of the word.

Nonetheless, my default thoughts do not take away from it being a fun visual to zone out to for a bit

I feel like that's what's happening to my neurons when I'm browsing Reddit. And Hacker News.
Nice. Reminds me strongly of levitated.net (sadly broken due to no Flash) and complexification.net (sadly broken due to no Java).

Geeking out over Jared Tarbell over dial up basically got me into computers in the first place.

there is a website on the internet that has this in the banner or background, but i cannot remember what it was.
What if you incorporate game of life type rules into this?
I can't relax, the fact that connections don't affect their speed/direction infuriates me.
I didn't think I'd care, but I had the same reaction.
Made a version with charged particles. Probably bad physics all around, but here it is: https://shorturl.at/ocvEO
Funny how the "shortened" url is actually longer than the real url. Any reason you shared it using the former?
It seems to me that it is inevitable: every programmer goes through a phase where they do a bounded billiard ball simulation. It’s like a right of passage.
rite* of passage
A "wright of passage", a "craftsperson of passage", someone who facilitates or creates transitions -- like a metaphorical bridge-builder
Rite, as in the ritual one performs to pass to the next stage of their goal.
I'd like to share mine as well. There's a bit of more interaction between particles but I don't remember the exact logic. Code should be easy to read: https://kaeruct.github.io/projects/short-experiments/dots/
[flagged]
You alright there, buddy? I think some grass touching might be in order.
I'm good. I forgot to add there would be a nazi salute too!
I like how some of the particles get thrown out of the cluster on wider elliptical orbits, they look like comets.
Cute. First thing I did though was to see if moving my mouse or clicking affected it. Doesn't seem to, please add that!
This would make the perfect hero background to my portfolio site!
That... is... mesmerizing... ... ... ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏

Thank you. I wonder if I could use it for meditation. If only it would not require a blue screen.

I'd love to see the connection line come from both particles and join between them! Ooo and also if they can like start with random colors and slowly as they meet their colors average out
Having a hero background that was a variation of this was really popular about 10 years ago or so. You’ll still find them on plenty of websites built around that time.
It's still extremely common in web site templates for cryptocurrency and AI companies. Sure, it's cliché as all hell, but that doesn't stop people from using it.
(comment deleted)
This is a lot like how I imagine a mesh net with mobile nodes working.
Hello author here. I'm a little surprised to see this on the front page of Hacker News. This is just a simple demo for my educational programming language Easylang. You can easily edit the code and increase the particle count for example. In the IDE you can then create a link with the code embedded in the URL.

https://tiki.li/run/#cod=dVLNbsIwDL7nKT5p0gRDdEGMA9PYM+yO0FT...

Well, that looks suspiciously like caustics in and around a swimming pool on a sunny day.
How hard would it be to push this into 3 dimensions instead of 2? It made me think of a starting point for a model of the universe and galaxy interactions.
cant believe nobody has asked... what is the goal of easylang? why did you start working on it? why design choices are you most proud of?
The aim is to offer beginners a simple and interesting entry into programming. IMO there is an unoccupied niche for this between Scratch and Python. In the days of home computer BASIC, it was easier to learn programming - you switched on the computer and with a few lines of BASIC code you could magically create a nice sine wave on the screen. Nowadays, beginners are often overwhelmed by all the complexity.
Are they? I learnt with Scratch from about four then moved to Python when I was about 9 (iirc), and I found the move pretty easy. There isn't much I would change about Python to make it better in that role, and there are plenty of online environments that do a great job of reducing the setup you need. The BASIC experience is now https://projects.raspberrypi.org/en/projects/editor-hello-wo... - are they really so different?

Plus, when you want to move onto slightly more complex projects you can just keep using Python and steadily adding to your knowledge.

E.g. I began with turtle, then something that showed who's in space using requests and an API, then a little chat app with sockets, then a full GUI chat app that pretended to be notepad so I could chat at school. Nowadays, I still sometimes write software in the same language that I first wrote print("Hello, world!") in.

Don't get me wrong, I think it's great that you're making it. I just think that Python is already a great language coming from Scratch.

@design choices: The graphic primitives built into the language - this is not useful for a general purpose language - but in beginner language this is an important motivating factor.
Would love to see this with boids simulations :D
curious what do ppl usually use to make these animations? i’ve used pillow with python in the pass but that only really works with images and seems clunky
This made me realize how much I miss screensavers. I used to sit and just stare at them meditatively as a teen.
I think I learned more about chaos theory by hacking a first person Rössler attractor "rider" into xscreensaver (instead of the usual Lorenz attractor) than by any other thing.
Also the cool effects in music players.
Yeah this one definitely has a JWZ vibe. Probably worth porting and contributing to XScreensaver.