I use an ipad app called exoplanet which is cool. The same guy (hanno rein) has put some n-body physics code on GitHub, which he describes as extremely efficient and versatile, supporting collisions, debris fields and so on. Might be worth perusing just to see what approach he took: http://www.astro.utoronto.ca/~rein/research.html#rebound This is the summary page, GitHub link is on there. Cheers
Oh, now that's lovely. The first video reminds me of a spiral galaxy. Something like this would be really useful for planetary rings as well. If an asteroid or a rocket flies through them, it would displace a hole in the ring structure.
Cool, will take a look for my own project, seems he uses some interesting optimisations on the gravity code.