Go Crash Some Planets!

Super Planet Crash
A screenshot of Super Planet Crash playing in Safari

 

If you enjoyed playing Super Planet Crash, please consider donating to the Science Education Fund at McDonald Observatory. Every little bit counts. Go support science!


Update 2: 2,000,000 systems were created!
Update
: Systemic and Super Planet Crash were featured on io9Space.comGlobalNews, Motherboard, Huffington Post, The Verge, and two press releases by UC Santa Cruz and McDonald Observatory. Thank you!

Super Planet Crash is a little game born out of some of my work on the online version of Systemic. It is a digital orrery, integrating the motion of massive bodies forward in time according to Newtonian gravity. It works on any recent web browser and modern tablets.

The main goal of the game is to make a planetary system of your own creation be stable (i.e. no planet is ejected, or collides with another body). This is of course exceedingly easy when your system comprises of a few Earth-mass planets, but dynamical instability can quickly set in when adding a lot of heavier bodies (from giant planets, all the way to stellar companions).

The challenge is then to fit as many massive bodies as possible inside 2 AUs (twice the distance between the Earth and the Sun), teetering close to instability but lasting at least 500 years. Accordingly, the game rewards a daring player with more points (proportionally to the mass of each body added to the system). A few simple rules are listed under the “Help” button.

The game always starts with an Earth-mass planet in a random location, but you can also have fun overloading known planetary systems! Clicking on the “Template” dropdown brings up a list of planetary systems to use as starting templates, including the compact system Kepler-11 and the super-eccentric planet HD80606 (more systems to come). You can even share your creations with your friends by copying the URL in the “Share” box.

The game is open-source, and still under active development. The entire code will be downloadable from GitHub (as soon as I get a bit of work done!).In the near future, I will be adding integration with Systemic Live, a longer list of template planetary systems and smartphone support. In the meantime, have fun crashing planets!

Credits

The game was made possible by the wonderful paper.js library, which let me quickly prototype the app despite having little experience in web gaming. The palette draws from the base16 color set.

Many many thanks to my wonderful testers: Rachael Livermore, Mike Pavel, Joel Green, Nathan Goldbaum, Maria Fernanda Duran, Jeffrey SilvermanAngie Wolfgang, and other cool people.

My work is funded by the W. J. McDonald Postdoctoral Fellowship. If you enjoyed the game, please donate to the McDonald Observatory fund to support science education.

88 thoughts on “Go Crash Some Planets!”

  1. This is a great little time waster. I’m really having fun making binary systems; I’ve often heard they have to follow one of two setups (no spoilers), and this is a fun way to test that out myself.

  2. I wasted almost an entire 90 minute class period playing this. It would be interesting to see the ejection speed for planets / stars that were ejected from the system.

  3. This is great, it’d be cool if there were a feature to zoom out the system and to change the 2AU limit to say up to 100 AU to more accurately reflect what NASA believes to be the expansion of what we view has habitable, ie Enceladus, Europa, Charon, Ariel, Callisto, Ceres, etc.

    1. Hey Tyler,

      Thank you. The 2 AU barrier is really an artificial limitation I put down to (a) add a bit to the challenge (keeping the planets inside the circle), and (b) avoid the need to zoom in/out. This was a project that I wrote very quickly, so there are lots of things that should be implemented — your suggestion is definitely on the list.

      1. A 10AU limit would be better than 100 to reduce zooming in and out. A nice feature would be to show the ejection speed of a hapless Earth as it get gravitationally launched to parts unknown. (I guess the inhabitants will have to arrange a gravitational capture at the destination star system. )

  4. Hi, while I’m a theorical computer scientist and software engineer, I’ve taken up physics as a hobby. So I love the kind of things you do here! Funnily enough, I couldn’t find a standard subscribe button (via my smartphone), so I’m using your comment system to subscribe to your blog 🙂

  5. Awesome app! I love experimenting with how the different types of planets/stars will behave in specific situations; it’s a wonder I’ve gotten anything done at work after discovering this a few days ago! I do sometimes question the incredible slingshot trajectories and speeds exhibited with certain interactions between planets. I mean, I understand when a dwarf star and Earth collide, that’s going to create some serious escape velocity but a super Earth and giant planet intersecting while traveling in fairly standard orbits, seems to me, not a case for the Earth to go wildly hurdling off into space. Unfortunately, I don’t know a lot about planetary orbits but my relatively modest education/reasoning skills can’t reconcile this. Any recommendations on what to read for a layman to learn about the physics behind what drives this app/planetary orbits?

    Thanks in advance!

    1. Hi Crystal,

      You’re right, I was hoping to have the code up on Github right away but I’ve been tangled in keeping the website up, and cleaning the code a bit more. I’ll put a link up as soon as I get it done. Sorry about that!

  6. Great work Stefano!

    I’m particularly interested in this from a software perspective. Could you tell us more about how you programmed it? What tools you used, challenges you faced, etc.

    Cheers from Cape Town!

    1. Hi Kosta,

      Thank you! I’ll put a post up soon enough describing how I created the game. Spoiler alert: it’s a combination of paper.js, Bootstrap, Google Web Fonts and the wonderful base16 color scheme.

  7. I loved this game too mutch, i spent about 3 hours trying to get a good system, most of them failed though. OMG I LUV THIS GAME!!!!! /\____/\
    ( . . )
    ( ) mow,
    /__/\___\
    SuperDwarfKittyOfAwesome
    i got like rank 889 or summit though 😀

  8. Yay, planets goin’ boom, there like tiny little boombombs or whatever there called from Mario, just splodin everywhere and such. So coolio I especially love fiddling around with the dwarf stars (read my name, DUH) /\____/\
    *******************************( . _ . )
    *******************************(________)Mow,
    *******************************/___/\___\ ******************************************SuperDwarfKittyofAwesome

  9. Very interesting to see planetary dynamics. I found a way to score 1.67 trillion however, it wont let me post the score and how I accomplished this.

  10. It’s a great little app. I definitely want to play the next incarnation of this ‘game’.

  11. Can’t wait to see the app! You did an awesome thing here. Can’t wait to see where this goes!

  12. This game is too fun! It would be nice to have the ability to “replay” the final few time steps that produced the collision or ejection – I had an interesting system set up with the time proceeding very quickly and missed the final interaction that caused one to be ejected. It would also be cool to be able to set the orbital eccentricity when an object is first inserted. Thanks for the fun! I will probably play this for several hours.

  13. That’s pretty cool, though one thing I’d like to see is faster fast-forward, 50X just doesn’t seem to be enough. I might submit a pull-request once you’ve got the code up.

  14. Glad to hear the size will be scaled up, thanks for making this–I suggest deducting points for ejected planets rather than ending the game (or have that option).

    1. Very much agree. I can’t seem to get past 30M points. Obviously you need to put in the dwarf star and that only works if it’s near the center and if the initial earth-size planet is in the habitable zone.

      But the top scorers are getting ten times as many points. I don’t think I’m likely to stumble upon their techniques by accident.

  15. Great game fun and challenging. You should see if you can turn it into a native iOS or Android native game to get more exposure.

    I am sure it would appeal to a lot of users.

  16. Arrgh! Scored 201,757,799 points but it didn’t ask me for my name for the leaderboard! Not cool!

  17. Figo! Ci ho passato quasi un ora creare sistemi e cercare di renderli stabili! Ho fatto un record di tipo 30’000’000 :’)
    Good job.

  18. Would love to know (1) how to get more than a 1.0 multiplier for “central star”, and (2) how people are scoring in the 200+million point range. Best I’ve been able to get is around 35 million.

  19. I made one of my planets obit counter clockwise. Not sure how that happened but it was WICKED AWESOME!! Going to see if I can replicate the results.

    1. I was able to replicate the results, but it was a different planet that went counter clockwise. This planet lasted about 5 years while the 1st planet only lasted about 3 years. This is so much fun! I love being able to test out theroies. I wish there was an additional part to this website so I could see how everything is effective and why those planets end up going counter clock wise. I really love this website!

  20. Wow it was really a nice game to play!
    One thing seemed a bit weird to me:
    whem I add the dwarf star the small earth-massed planet always moves away form where I placed it for a second… then normal motion resumes.
    It is like the new star repulses the planet for a bit, then begins attracting again.
    Is this some general relativistic effect?

    1. Hi Ivan,

      The small “shifting” you see when you add a large body is an artifact. It is due to the fact that the simulation is viewed from the point of view of a special frame of reference, one positioned on the center of mass (http://en.wikipedia.org/wiki/Center_of_mass_frame). When you add a large body, the center of mass is shifted a bit, and so is the position of the bodies as viewed from the center of mass frame.

  21. What a great game! Nice idea you had, you should consider to make this into a multiplayer or something and port it to mobile, It will be a big hit!

  22. would love to see a program like this to just play around in just a sandbox verstion or mode to just play around in

  23. Great work on that project.There are a lot of things that need fixing to make it perfect but it’s fantasic.Can you please post a download link.The server is lagging and i’d like to play this when i don’t have access to the internet.Also an android/iOS version would be great

      1. It has definitely changed, and is giving the scoring links, but I can no longer place the dwarf star as close as before. Also, depending on the play speed, the calculations seem to be effected. Speeding it up seems to lead to instability much more quickly (year-wise) than going 8x or less. Is it possible that at higher or lower playing speeds, some variables are altered?

  24. I earn 1.192.275.881 points but I can’t write my name to posted in the high score table… WHY?!

    1. I got one .3 billion on one of the games but I realized it was a different template so you couldn’t save it

  25. This is such an awesome game. Clearly I am too competitive, but I was watching the high scores for Sudeep Kothapalli’s top two today because they are so much higher scored than anyone else and when you replay them they don’t get to the score indicated.

    I am just curious if there is a bonus that didn’t show up because I am pretty dang proud of my 300 million ice giant system 🙂

    1. And It is actually funny because when I replay my high score the replay gives a higher score than I actually got. Strange stuff.

      1. Hi Rusi,

        Two things might be at play: (1) the highest-scoring systems tend to be highly chaotic. Due to the famous “butterfly effect”, any small change can lead to very different outcomes. The server records the coordinates of the bodies in order to be able to replay it, and I suspect that truncation of the coordinate values might be sufficient to explain why some systems have different point totals when replayed. (2) a bug in the replay system. I haven’t been able to reproduce it on my computer, so I haven’t made much inroads in that direction.

        If I were to hazard a guess, I would bet on (1), perhaps with (2) lurking in the shadow as a contributing factor. If (1) is the main cause, not much can be done — the “butterfly effect” (chaos) is an inherent property of gravitational systems 🙂

        1. It’s a pity, I had several stable triple-star systems and none of them survived the replay.

  26. Hello!

    I really enjoyed the game!

    I have one suggestion if you don’t mind: If possible pz make the habitable zone move with the star(s), because in cases like this, it is pretty inaccurate where it is:
    http://www.stefanom.org/spc/?view=4757723
    (I cheated a bit on this one, but without cheating, when the main star moves because a dwarf, the habitable zone should move as well)

  27. Passing on the following remarks from two commenters on JayIsGames, where this game was featured. They point toward numerical issues that might also be playing a role here:

    cute, but it clearly suffers from numerical instabilities. Multi-body orbital problems are highly non-linear, so the slightest rounding error can cause them to explode unexpectedly…

    I ran the high score models and didn’t get the results that they did. I suspect that when you accelerate it actually increases the model timestep, and models like this are going to be very sensitive to the timestep size and prone to quantization error.

    Upon digging in the simulation code it’s using Euler method as the integrator (gravitation force is GMm/(r^2) towards direction of the other body, or GMm/(r^3) times distance vector. The code just add the above expression up for all mass pairs). Euler method is the simplest and worst integrator of all of them, having a error size to order (step size)^1, which of course, is very bad when being used in physical simulation.

    In physical simulation the standard integrator is the 4th order Runge-Kutta method (called 4th order because error are to order (step size)^4), and it’s quite easy to implement. The downside is you have to evaluate the calculation 4 times as usual.

    1. Hi, Colin,

      Sorry, I need to correct the original commenter here.

      I am well aware of the problem associated with rounding errors, in fact I wrote about it here [1] and other places on the web as comments. When games are saved, coordinates are truncated, so for highly chaotic systems (as would be the highest-scoring systems), any approximation is inflated exponentially with time. This is a feature *inherent* to the N-body problem. (A feature I did research about during my undergraduate career, way back when!). There are a few more issues that are hard to solve — feel free to shoot me an email if you want to keep this conversation going (see below.)

      The simulation code is most definitely *not* Euler, which as the comment mentioned is a very numerically unstable, 1st order integration scheme. What is implemented is a leapfrog (Verlet) integrator, which is a symplectic 2nd order scheme. For an interactive N-body simulator (running in Javascript, so limited in performance to what the browser offers), it gives the best bang for the buck by conserving energy of the (perturbed) Hamiltonian [2]. If you could go higher order, you would not not want to use Runge-Kutta 4, which is a generic integrator, but rather a 4-th order symplectic scheme such as the Hermite algorithm.

      Increasing the speed does not change the time-step, but rather how many time-steps are taken between frames. You can verify it in the code (UI.evolve).

      Finally, I am sure the code is by no means bug-free, so anyone should feel free to report bugs via email: stefano.meschiari AT gmail.com (this of course will be easier once the code is actually on GitHub :))

      -StefanoM

      [1] http://www.stefanom.org/2000000-systems-played/
      [2] Although energy and other conserved quantities are of course not time-symmetric once you start adding bodies ex-nihilo…

      1. Hey, thanks for the quick feedback! I was going to pass your comment on, but I see you beat me to it! 🙂

  28. Hey Stefano…

    I love this game and I finally managed to know how to get really high scores. But now when I play there is no table showing the daily high scores and it seems that the high scores have been taken off the main game page. Did you transport this to another web-page? Or did you remove it permanently? I prefered the idea of high scores so I can compete with others and its a great way of getting someone motivated to play the game, that is, by rivalry. If you can please put it back on, or show me a link where you have transported the game high scores to, that would be much appreciated!

  29. Very addictive. But I’ve been playing a little differently. I’m trying to create stable retrograde orbits. Very difficult! I’ve managed to create two (out of hundreds of tries). One was highly elliptical, the other nearly circular, but both were stable and ran for several minutes until I shut them down.

  30. Dear Stefano, you should put a boundary condition that is to create only one planet into an orbit.
    This because it is so simple to reach an high score with many identical planets into the same orbit, because they won’t collide to each other anymore, orbiting all at the same speed (having the same mass and distance from the sun).
    This is an unfair condition that should be resolved.
    Stay so well, you great compatriot.
    Sergio.

  31. In addition to being able to replay the final event (or at least go in reverse after the final event), maybe you could institute a sliding switch to increase or decrease velocity, so it’s easier to locate a particular point in time. 500 can be a long time to wait, and some of the gravitational effects are easier to see at different speeds.

  32. Bravo Stefano! Gran bel gioco! 😉

    I would like to see a lot of variations, but I don’t think it is so kind to ask.

    There is only one thing I didn’t like – I suppose it’s a bug – if you select a template and then you fail, the new match doesn’t start again that template. It’s annoying to change every time.

  33. Dear Stefano,

    I wrote you some days ago, trying to underline that imho there is a problem in the scoring system but probably for some reason I cannot see my comment listed here.
    If you look at the highest scores designs you find that there are many planets of the same size orbiting on the same orbit.
    This is an unfair and impossible condition. It is very easy to hang the mouse firmly on your desk and click the button regularly to achieve many planets in game.
    This is impossible to see in nature and also in this game this condition should be complied.
    The sizes/masses of the planets also should be randomly changed a bit, some small variance (an input interval should be nice) , because the nature never creates the same object twice the same unless you go at the atomic/molecular dimensions.
    This two conditions can contribute to make the game more interesting and avoid the cheap trick to have 8 planets of identical mass/dimension orbiting at the same distance from the star(s) system just to get higher scores.
    These two simple mods imho could add some spice to the game.
    Stay so well.

    Sergio
    Italy

  34. Great game!!! I’ve been looking for a game that simulates planets and gravity and this is the best so far. Obviously things like moons or binary systems would be cool. Maybe even black holes. But i think it would be really cool if the next update had a free play mode. In the free play there would be no barrier. Other suggestions would be also in free play mode like customize mass and speed of planets. At very least it would be cool to be able to continue playing (without barrier or points) after game ends.

  35. I love this game! I am addicted. You could make a mint selling this as a 99 cent app. I would love to have an associated forum for discussing strategies, things to strive for, etc. I have successfully gotten a planet to change to a counter clockwise rotation (http://www.stefanom.org/spc/index.php?view=10339300), but have not yet been able to create a moon, though I have seen examples of that out there. I too would like to see the ability to allow the game to continue even if planets are ejected.

  36. I was on my way to scoring close to a billion points but my time came to an end after just 262.7 years and 486,439,386 points.

    what brought my perfectly balanced trinary star system to an end? somehow… my sun (which was orbited tightly by a dwarf star) was “pulled out of orbit” by a 2nd dwarf star that was being orbited by HD 80606 b.

    guess I am going to have to make a quaternary system soon.

Comments are closed.