Hmm...
You chose probably the most difficult thing to model - well there are more diffucult things, but this is quite difficult as it is.
I guess you know the law of gravity:
The gravitational force between two object is the following.
F=G*m
1*m
2/R(2)
Note that this can only be used for two objects to truly descript their movement.
Where G is a constant it's value is aproximatly 6.67E-11 N/m(2) so it's a really small value. So the force is very weak - but we're talking about planets, so this mean planets have a huge mass.
Strictly the law above is about centres of mass so when simulating you can calculate with the planet centre as their position.
However we're still not out of the woods yet.
Do you plan to model the motion of planets inside the solar system?
If yes continue, if you plan to model moons continue and replace sun with planet the planet with moon. If not skip this part.
----------------------------------
Planets are orbiting a sun - leave multi star systems for now, this is gona be very complicated even without that -, so they have a velocity and gravitation provides the centripetal force to keep them on track .
*no it's not circular motion, did you know that Kopernicus' model was mainly not accepted because, his model devised planets going on perfect circles - he simply couldn't predict the astronimic events as good as the Ptolemaian astronomers, who used really complex, but very accurate models to show the stars and planets path around the skyglobe*
You could use Kepler's laws.
[list=1]
[1]A planet's path is an elipse, where the sun is in one of the focuses. The planet goes around following the elipse.
[2]During equal times the tangets *between the sun and the planet* cover equal suraces.
[3]There is a correlation between the elipse's big axis:
a(3)/T(2) is a constant for every system.
[/list=1]
The easiest way to model the whole whing would be to make the planet go around a path already created, so you won't have to deal with the varying forces only acceleration.
The path should be a null object, that you can spin around its focus if you want more realism. The planet's speed along the path will have to calculated form Kepler's second law *sorry I haven't taken the effort to do it right now*
---------------------------------
If you want to model the way ships go around a planet, then you should consider that each and every ship would accelerate towards a planet with the same acceleration. (F=m*a and F=m*M*g/R(2) divide with m and you see that that a does not depend on the smaller objects mass)
The tricky part is determining how they would move.
If you have a newtonian physics than it's simply adding an accceleration toward the planets centre.
----------------------------------
In FS terms you're in BIG trouble.
Forget planet movement - that's still way too big.
If you use smaller models and pretend they're really far, you may end up.....
Hmm, maybe there's something that can be done like that, but definitly not the active gravity simulation you're looking for.
If the ship're far enough to do that, gravity wouldn't be an issue either.
If they're close the model's not going to be enough.
Unless you plan to use the good 'ol background images, their data can be calculated accourding to the thigns above.
With such accelerations and speeds your ship's going to leave the spacebox in no time.
So I suggest moving the backround instead the ships, to simulate the speeds. A big planet won't change that much if you go 12.000 ahead and 5000 down.
What needs to be created is an active background, so you can create change background elements during a mission.
A spacesphere wouldn't hurt either. Placing a planet in a box could be a real pain.
You have to ask the source code team for those, I'm not a coder.