If you have any improvements or suggestions (especially on the programming side!), please email me directly.
Update: As an astronomer (and not a professional programmer), being on HN makes me super proud. Thank you!
(I'm not affiliated with them in any way)
Also, the speed shouldn't affect the results - perhaps the simulation could always be done at the same resolution, separate from the animations.
If you have a reproducible case, let me know.
It's a combination of (a) people straight up exploiting the fact that the server trusts that the data sent from the client is correct, (b) some truncation error that happens when the system is saved for replay may lead to a different final outcome when replayed (the systems may be highly chaotic), or (c) a bug that I haven't been able to reproduce yet.
(b) is a feature inherent to the N-body problem, so not much can be done on that front.
(c) I still haven't come across a system that I created on my testing environment (that I save with some extra debug information), that behaves differently when replayed.
For example, someone here commented about two stars systems, and if the planets are between them, they should closer to the center one as possible. This kind of thing I can test, see how it works and learn a little.
So a few tips as why another star in the center transform a planet's path from circular to an elliptic one, could help.
I'll do a bit of testing and see what I can come up with.
By the by, if you like what I've done, I will soon be available to freelance. A few other projects of mine are here:
Meantime, I have wanted something like this ever since I was a kid and ran into the three body problem while trying to devise a sci-fi game. Finally I can build the solar system of my dreams!
I should add that the entirety of the code will be published on GitHub, like my other projects (http://github.com/stefano-meschiari/), so people should feel free to fork, make pull requests, etc.
If anyone likes what I do, I will be available soon for freelancing. I have a small portfolio of applications I built here:
 - http://www.stefanom.org/spc/?view=2974678
Same thing, but I scored higher, unsure why.
I ended up at 190M (I also had a big crowdedness factor), but I can't find the "share" link.
I've heard good reviews (I've never played it myself though). It's also on Steam.
No, not really.
Even without knowing the masses of the planets and the sun here, the scale of this game is tiny compared to the real solar system. In realistic scales, it is a lot easier to come up with stable configurations.
Planetary systems form slowly from a gas and dust disk surrounding a new born star. The early protoplanets will collide with each other and form bigger bodies and the system will slowly reach a stable configuration. Planets may be thrown out of the system or flung into the star too.
The best current understanding of exoplanet systems is that there are planetary systems orbiting the majority of stars out there. Our solar system is neither an extremely lucky coincidence or a rarity among other stars.
All the exoplanet systems were discovered only recently (span of a few decades). So we don't really know if those systems are stable in the long run, and hence we don't really know if our solar system is "lucky" or not.
Yes, all exoplanet systems have been discovered recently but the best theories explaining the birth of planetary systems predict that the planets form very soon after the formation of the central star. And we have good estimates about ages of stars, which are several orders of magnitude (as in 10^8 vs. 10) older than observations about exoplanet systems.
Statistically that means that we were not "lucky" and neither were any of the other exoplanet systems.
Given that the science behind exploring exoplanet systems is so young, this theory is not necessarily correct but it is the best understanding that the scientific community currently has.
We are lucky that our stable arrangement happens to have a planet with surviving water within the habitable zone and with a few elements in the system that make collisions less likely. (Both the Jupiter and the Moon "sweep" space so that collisions with earth are much less common than they would be without them.)
Of course, the anthropic principle is in full force. The earth had to be lucky for you to stand on it wondering about how lucky it was -- so, if it hadn't been lucky, you would not do so and maybe some green-skinned alien halfway accross the galaxy would spend time wondering how lucky his planet was.
Exactly. For instance, there was a time when Earth didn't have a Moon, which would make collisions more likely. At least one of these collisions seems to have created the Moon. We of course are familiar with the version of Earth that has a Moon; it is unlikely that we would have evolved without that Moon such that we were left thinking "Gee, it would be nice to have a moon.."
Come and get me, copper.
I also think that the solar system isn't entirely stable. The orbits of the planets do influence one another in a way that isn't in equilibrium. It just happens very slowly.
Surprisingly stable, given the Earth-sized planet's erratic orbit.
Congrats! You reached 500 years without going unstable!
I was able to get 65 million fairly easily but have not been able to beat it yet.
Of course "far out" is the key there. I'm pretty a real planet stuck between two stars with <2AU separation would be deeply, deeply fucked. o.O
P.S. Got to 430 years.
The very first planet started on the absolute edge, then when I added a Dwarf Star pretty close to the Sun, it altered the orbit such that the planet went out of bounds but it didn't kill me.
Just throw dust everywhere. planets will absorb materials, will become bigger. Some smaller planets could crash against others (bigger ones) and could create a mini planet orbiting the other (moon-earth).
A very simple and elegant idea. Well done.
500 Years, Score: 33,445,876, 7/12 bodies
I just observed the same result (89m 336y).
500 years, 42million
Admittedly, the point system could have been better designed. However, for this first attempt, I could not come up with a better alternative. "Exploiting" the point system within the game is not that easy, so the people that achieved the high-scores must have played tens, if not hundreds or more, of games before finding the right timing and initial condition.
Those are all imaginary internet points anyway :)
Create 12 planets as fast as you can, watch the sun in the middle.
After some time watching and focusing, change tabs...
"Real life image burn" :)