Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Advice - Procedural Solar Systems  (Read 1544 times)

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Advice - Procedural Solar Systems
« on: December 13, 2014, 03:30:56 pm »

Basically I've wanted to create a program that procedurally generates solar systems. To briefly summarize, I want to make something that;

-Tracks all bodies >X square kilometers in size (I haven't decided what would be reasonable yet)
-Has plausible, stable orbits (stops genning when the system is locked into a stable patter for x% of bodies, deletes all bodies that will subsuquently be ejected or collide)
-Has accurate chemistry (tracks the chemical composition of all bodies and generates a likely geology based on it + factors like mass, gravity and temperature).

It's a huge project, and this is in no way helped by the fact that I know literally nothing about anything relevant to it (No astronomy, chemistry, programming of high-level math in my background).
So, what do you think I can do to start making progress towards making this something that's actually feasible to attempt? I'm hoping to take an astronomy course next year, but chemistry's still out and I have no programming knowledge... do you think I should try to recruit other people to assist?
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Advice - Procedural Solar Systems
« Reply #1 on: December 13, 2014, 10:21:34 pm »

Step one, learn how geavity works and all that stuff.

Step two, find out how people simulate planets in real life.

Step three, pick a language--any language--and do it!
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Re: Advice - Procedural Solar Systems
« Reply #2 on: December 14, 2014, 10:07:54 am »

Step one, learn how geavity works and all that stuff.

Step two, find out how people simulate planets in real life.

Step three, pick a language--any language--and do it!

I've been looking into mathematical models of the solar system as it currently exists - that stuff's useful. The problem is how that translates to how a solar system evolves.

For example; the Kuiper Belt (currently 1 Earth mass or less) originally was located much closer to the sun (by about 10 AU) and had a whopping 50 Earth Masses worth of material. That is an absolute boatload of objects. And almost all of it gets ejected into the oort cloud (where I'd say its fair to stop simulating it, since it's too far for anyone to feasibly visit it without the tech required to just bugger off to another star) because of migrating gas giants. Heck, they even think that at one point there was a 5th gas giant in our system that got ejected into interstellar space!

The sheer scale of accurately modeling a solar system of mass equivalent to ours from its formation to its present state is mind-boggling. Perhaps it'd be better to just randomly generate star systems until I hit one with a stable orbit configuration and just add checks as I go along to reject systems that aren't likely to be stable outright.
Logged

Dumbestdorf

  • Bay Watcher
  • Silly small person
    • View Profile
Re: Advice - Procedural Solar Systems
« Reply #3 on: December 19, 2014, 03:36:56 am »

Perhaps it'd be better to just randomly generate star systems until I hit one with a stable orbit configuration and just add checks as I go along to reject systems that aren't likely to be stable outright.

If you try that you will be generating for a very, very long time before you hit a stable configuration. You will need to add constraints to your generator, e.g. generate a random elliptical orbit, deduce mass and speed from that, use that as constraints for generating the next orbit in the system.

Also testing whether a configuration is stable puts you up against the n-body problem and that... hurts.

Finally, define "stable" - for example, Pluto's orbit itself is stable but the oh-wait-it's-no-longer-a-planet's position on the orbit is chaotic.
Logged

lemmily

  • Bay Watcher
    • View Profile
    • BatFinchBears
Re: Advice - Procedural Solar Systems
« Reply #4 on: December 19, 2014, 07:14:42 am »

I'm not sure it'll be helpful or not, but maybe have a look at universe sandbox? Might help you think/test out a particular problem :)
Logged
I make furry things - BatFinch Bears

Il Palazzo

  • Bay Watcher
  • And lo, the Dude did abide. And it was good.
    • View Profile
Re: Advice - Procedural Solar Systems
« Reply #5 on: December 19, 2014, 07:50:29 am »

do you think I should try to recruit other people to assist?
I'm sorry to be blunt, but what exactly do you plan to contribute to the project if you don't know anything relevant?

Best put it off for a while and take that astronomy course, maybe learn a programming language in the meantime. On the plus side, I don't think chemistry as they teach it on typical courses will be necessary. The basics, but relevant basics, from astro should be enough.

For a shortcut, you could go the java script way, and then base your simulation on this one:
https://www.khanacademy.org/computer-programming/challenge-modeling-accretion-disks/1180451277
All it does is to let a number of particles move under gravity and merge if close enough.

By the way, you should see on the above example how resource-intensive n-body simulations are - if it doesn't lag on your machine, increase the number of particles by a few hundred and realise that it's just a dip in the sea of planetesimals you'd need to accurately simulate planetary accretion. Which means that you'll have to cut corners, cheat a bit, and limit your scope.
Logged

Dumbestdorf

  • Bay Watcher
  • Silly small person
    • View Profile
Re: Advice - Procedural Solar Systems
« Reply #6 on: December 19, 2014, 07:59:49 am »

For a shortcut, you could go the java script way, and then base your simulation on this one:
https://www.khanacademy.org/computer-programming/challenge-modeling-accretion-disks/1180451277
All it does is to let a number of particles move under gravity and merge if close enough.

Or you could try to learn and use Processing (based on Java, but lets you write graphical / interaction stuff rather easily). It also includes examples similar to the one listed above.

Also, I agree w/ Il Palazzo, you'll need to cheat. A lot.
Logged

HavingPhun

  • Bay Watcher
    • View Profile
Re: Advice - Procedural Solar Systems
« Reply #7 on: December 23, 2014, 11:14:28 pm »

http://www.artcompsci.org/index.html

Though this is extremely in depth, possibly more than what you want or need, this should give you a very deep understanding of how to simulate systems. I believe it is focused on creating simulations for a lab, and would be easier to understand with some background knowledge. Both "Project Maya" and "Moving Stars Around" discuss these things, from what I can tell "Project Maya" is more in depth, and I could understand it better than the other. Though they discuss it using ruby, there is c/c++ source code included in the source code download.

I found this because I am also interested in creating something similar. It would mainly just be as a hobby. I have a fairly mediocre knownledge of c++.
« Last Edit: December 23, 2014, 11:17:39 pm by HavingPhun »
Logged