Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Super Planet Crash – A game of gravity (stefanom.org)
116 points by pndy on June 20, 2022 | hide | past | favorite | 30 comments


Super cool! Nice and clean.

I had an idea to build something very similar a couple of years ago, but didn't have the skills/time for it.

What I built ended up being quite visually simple (, pragmatic,), but it's cool in that you can control some of the parameters of the differential equation solver to trade off between speed and accuracy. Mine also shows you where the bodies will go in the future, rather than just a trail of where they have been. And you can click and drag to add a planet with initial velocity and see how the entire system will react immediately and interactively.

I also implemented collision with conservation of momentum (the displayed body radius is much larger than the simulated radius).

https://jurasofish.github.io/gravity/


Trying to figure out how to create a stable orbit makes me think of "The Three-Body Problem" by Liu Cixin (https://en.wikipedia.org/wiki/The_Three-Body_Problem_(novel)). The characters in the book have to figure out something similar, though more complex and in a VR like world.


As an aside, question for astronomy / orbital mechanics experts: I've always assumed that science fiction landscapes of earth-sized planets with a huge planet or moon in the sky, not to mention several, is basically impossible. Either tidal effects would destroy the landscape, or the planet-in-the-sky would be far enough away but too large to actually be a planet. Is there a solar system configuration that would allow that kind of landscape?

Example here, from the Star Trek pilot: https://api.time.com/wp-content/uploads/2016/09/star-trek-pi...


It's possible... sort of. The closest distance two identical planet-sized bodies in a hypothetical binary system can be together without destroying each other is about 2.5 radii, which is pretty close and the other planet would take a noticeable chunk of the sky. At that distance they'd be very oblate and tidally locked to each other; not exactly a world friendly to biological life, and won't look like your picture either.


> Example here, from the Star Trek pilot: https://api.time.com/wp-content/uploads/2016/09/star-trek-pi...

If you have enough zoom, you can place the camera far enough and take such a photo of our moon. With a large telescope, I guess you can even do the same thing with Venus (on a very clear afternoon). So this is by no means "impossible", this is already the planet that we live in!


It is implied that these are views that a human or human-analogue life form would see with the unaided eye.


The most sensible such situation is having the action happen on a moon of a smallish gas giant. Something a bit smaller than Saturn could hold an earth-sized moon in close enough orbit to have reasonable day-night cycles even if it's tidally locked. (And those days would be a bit freaky -- unless it had a very high inclination, in such a close orbit around such a large body, there would likely be an eclipse every day at midday.)


Our own moon used to be much closer(few billion years ago), and would have looked something like that.


I'm pleased to say I managed to invent a system so crazy that it actually caused a planet to reverse direction and go counter-clockwise around the sun before slingshotting wildly out of the solar system. Very fun to see what craziness can be invented.


772k over 92 years. I just made a really tight binary system. I got bored after a while and added giant planets until I added juuuust too many

Second attempt is racking up around 600k/50 years and it's a dwarf star binary.


18,260,000 at the 1000 year limit. Just restating till you get a starting planet in the habitable zone and adding the largest mass in a super tight binary is very stable.


I got it to 43M with this basic idea and some experimentation with starting planet distances. Getting the dwarf star stable relative to the planets in the habitable zone allows you to drop a few more Earths into the habitable zone and push the score up.


I did the same thing, with similar results: 17,398,525 points after 1100 years. It has to be pretty far into the habitable zone, though, and the dwarf star has to be in an uncomfortably-tight orbit, and timing probably matters a fair bit, too.

Putting dwarf stars on the outside produces some rather fun and funky orbits, though :)

EDIT: and I managed to accidentally (and disappointingly) produce a stable one with a far-orbiting dwarf star; 12,122,408 points at 1101.1 years.


27M points at 385.7 years. I added an ice giant at a 1:1 resonance with the highly elliptical orbit. Looks like it wasn't perfectly in resonance, but it was close enough to get the 385 years.


The scoring for the game should probably be points/year averaged out over the last decade. :)


28.4 million... Just put a dwarf star right next to the center sun.

https://i.imgur.com/2spuvSm.png


57 million. Good stuff. I think there is a bug that it goes beyond 1000 years if you turn the speed up.

https://i.imgur.com/hE8oX4S.png


6.9 million points and 1000 years by having an Earth at 0.2 AU and a Dwarf at 1.8 AU.

15.9 million point and 1000 years with a Dwarf at 0.1 AU and an Earth at 1.5 AU.


It seems surprisingly easy to make stable orbits in this simulation. I once made a solar system simulator a long time ago (in VB6 of all things) but when I placed a large mass in a similar orbit to a small mass, the small mass would often get ejected out the system. Here that doesn't seem to happen very easily. I used simple newton integration so my sim wasn't very accurate but I wonder if there's more to it than that.


Generally the trick is regularise the inverse square law so that below a certain radius the force clips and stops things pinging off to infinity.


High Scores doesn't seem to work.

Awesome otherwise.


Agreed. HN for high scores for now I suppose! 347,319 in 0.7 years best I could do in 15 minutes.


An easy way to get a fair number of points is a binary star system they're pretty stable.


Very cool! It would be nice if we stayed on the same page when we fail instead of being redirected to the choice of setups...?


I wish the huge high score dialog wouldn't cover so much of the screen. I'd like to see the end result.


Couldn't scroll down to see the whole thing. Why limit the radius at which you can add planets and things?


It's a game to build the largest system that doesn't eject any planets approximated by having a limit that ends the game.


Good try trisolarans


This doesn't seem to model gravity - planets don't appear to exert any force on each other and the orbit is exactly a circle.


Not true? Just place a planet of the same size next to an existing one and see the effect.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: