News for hackers. Stuff that matters.
Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @10:14AM (#7591906)
I am the developer of the game (StefanoM). I'm glad people are enjoying the game, and I'm sorry for the downtime -- I did not expect it to become this popular.

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!

Re:Show HN: Super Planet Crash by sullivanmatt on Tuesday April 15, 2014 @11:34AM (#7592344)
Hey stefanom, fantastic game. I see your website is having some trouble keeping up. You should sign up for the free version of Cloudflare and put your website behind it - then you'll not have nearly the trouble with the traffic load.

(I'm not affiliated with them in any way)

Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @01:44PM (#7593194)
Thanks for the tip, Matt. I believe I have it set up now.
Re:Show HN: Super Planet Crash by nmeofthestate on Tuesday April 15, 2014 @11:32AM (#7592332)
A new game always comes with a planet at a random orbit - would be good to get rid of that, although I can see it makes understanding things easier, initially.

Also, the speed shouldn't affect the results - perhaps the simulation could always be done at the same resolution, separate from the animations.

Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @04:34PM (#7594108)
The simulation is always done with the same time resolution (time step). What the speed factor does is just change how many integration steps are taken between frames, so speed should indeed not affect the evolution.

If you have a reproducible case, let me know.

Re:Show HN: Super Planet Crash by thix0tr0pic on Wednesday April 16, 2014 @06:23AM (#7596934)
How about half of the high scores? When watching their replays I can't seem to get a reproducible result. Sometimes their 400MM score is crashing out as early as 10y.
Re:Show HN: Super Planet Crash by stefanom on Wednesday April 16, 2014 @08:55AM (#7597415)
I wrote about this issue a bit here:

http://www.stefanom.org/2000000-systems-played/

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.

(a) is something I struggle with coming up with a good solution. People can just enter the Javascript console and mess with the internals (change points, multipliers, etc.). When the data is sent to the server, the server cannot re-run the entire integration, it is too computationally expensive (almost 4,000,000 games played!). So what I do is do some basic checks on the server, loop over & reject systems that are clearly fake, ban IPs that are obviously trying to exploit the high score table, and call it a day since I cannot be monitoring the high-score table all the time. As I wrote in another comment, they are all fake internet points anyway, so I'm not too concerned. If anyone has a better idea, my email is [email protected] -- drop me a line.

(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.

Re:Show HN: Super Planet Crash by soneca on Tuesday April 15, 2014 @11:03AM (#7592177)
I could use some astronomy tips. It is fun, but sadly I am not learning anything with this.

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.

Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @04:25PM (#7594060)
Soneca, there are a few links on the sidebar. My hope is that people will look for answers among the many excellent resources that are already available online. I also hope to develop the game further to make the physics that drives the planetary dynamics a little more clear.
Re:Show HN: Super Planet Crash by nkuttler on Tuesday April 15, 2014 @10:22AM (#7591943)
You should probably stop reloading the page for new games. Seems like it should be possible to run the game and restart it client-side only?
Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @10:26AM (#7591971)
I definitely took a shortcut there. I'm not a professional programmer, and any time I dedicate to this I tend to consider as "stealing" my attention from my actual job as an astrophysicist...

I'll do a bit of testing and see what I can come up with.

Re:Show HN: Super Planet Crash by nkuttler on Tuesday April 15, 2014 @12:21PM (#7592698)
Have you considered open sourcing the code? Some people might want to fix problems they see :-)
Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @04:31PM (#7594092)
I have. It will be posted on GitHub as soon as I have a bit of free time. I want to make sure the code is well commented & readable.
Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @06:21PM (#7594690)
I bit the bullet, and wrote a bit of extra javascript to restart the game server-side.

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:

http://www.stefanom.org/devel/

Re:Show HN: Super Planet Crash by Scaevolus on Tuesday April 15, 2014 @02:03PM (#7593316)
What kind of integrator is this system using? Is it symplectic?
Re:Show HN: Super Planet Crash by stefanom on Tuesday April 15, 2014 @04:21PM (#7594040)
It is a simple leapfrog integrator (which is indeed symplectic). I found that, at least in a test implementation, higher order methods were too computationally expensive to run the simulation at a good frame rate.
Re:Show HN: Super Planet Crash by anigbrowl on Tuesday April 15, 2014 @01:00PM (#7592927)
An API that would output the positions on a per-tick basis would allow it to be hooked up to a simple rendering engine an generate eclipse scapes, which I think would be very educational.

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!

Re:Show HN: Super Planet Crash by cmpqu on Tuesday April 15, 2014 @02:14PM (#7593373)
what equations did you use? the mufti-body problem does not have closed for solutions for more than two bodies so I'm curious
Re:Show HN: Super Planet Crash by roquin on Tuesday April 15, 2014 @03:00PM (#7593678)
There is no analytical solution for multi-body problem. But one can still use numerical solution to simulate. Though the error will become bigger and bigger and not reflect the real world scenario.
Re:Show HN: Super Planet Crash by fsk on Wednesday April 16, 2014 @07:15PM (#7601095)
The biggest improvement - let you specify the initial velocity when you add a planet.
Re:Show HN: Super Planet Crash by baking on Tuesday April 15, 2014 @11:56PM (#7596017)
"click anywhere" is misleading.