pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.63k stars 377 forks source link

Gas giants are too small #2959

Closed corundscale closed 10 years ago

corundscale commented 10 years ago

Gas giants in generated systems have too small diameters for their masses (by a factor of about 1.5-2) and correspondingly too high surface gravities.

It seems to be a result of assuming the same density (Earth's density, around 5.5g/cm^3) for all planets in StarSystem.cpp:1844:

m_radius = fixed::CubeRootOf(m_mass);

A function choosing relationship between mass and radius based on planet type (or at the very least on mass itself as it's strongly correlated with planet type, as per http://phl.upr.edu/library/notes/standardmass-radiusrelationforexoplanets ) would be a better replacement - maybe postponing radius calculation until after planet's type and composition is determined?

As a welcome side effect it would make gas giants much more picturesque when viewed from their moons (due to being much larger).

fluffyfreak commented 10 years ago

I don't know how to describe that as a function, maths has never been my strong point. If you can describe it in a bit more detail then I can code it up no problem.

fluffyfreak commented 10 years ago

Actually I'm trying to work something out now, will see how I get on.

corundscale commented 10 years ago

I think that (as long as we don't make it something better, with radius being determined only after we already have the planet's type) we can make it a crude, stitched-together function as per article:

rJ = Jupiter's radius in Earth's radii (about 11)

if(m_mass<=1) m_radius = fixed::CubeRootOf(m_mass); else if(m_mass<= 200) m_radius = sqrt(m_mass); else m_radius = rJ;

The last part would be because of an awful, awful exponent of -0.0886 that won't really make a perceptible difference, especially given that RL data are already noised-up.

Speaking of noise, it would be nice to apply some pseudorandom, but constant for any particular body noise to calculated radius value, to reflect spread of RL data and hide our crude function.

Article link would be nice as a comment.

fluffyfreak commented 10 years ago

I went ahead and used the awful exponent anyway, had to do some mathematical jiggery-pokery but it seems to be giving the answers I'd expect, confirmed via pen and paper!.

We can apply some noise to the results of course but I haven't done yet.

fluffyfreak commented 10 years ago

I made it a PR, I don't brain so good this evening!

impaktor commented 10 years ago

@fluffyfreak / @corundscale Fixed by #2969?

impaktor commented 10 years ago

@fluffyfreak / @corundscale Silence means yes.

Although it looks odd to me that we have two commits in master that are almost the same. 460f369cc36b3b71250b749cb4700107530c3ef1 and 528616103eb06aefcebc8e003221a97484010098

fluffyfreak commented 10 years ago

Yeah it came in via two PR's I think :/ Not very clean but the end results works ok.