-
-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.0g way too common #5581
Comments
Since the surface gravity for our solar system seem to work well, and it's fed real and good data, it should be the automatically generated planets that gets suboptimal values for either mass or radius (or both). The planet mass seem to be generated first (I haven't found where). The line controlling the surface radius is: pioneer/src/galaxy/StarSystemGenerator.cpp Line 703 in 3fed83c
Simplified: radius = pow(mass, 0.5)); Surface gravity is computed in SystemBody::CalcSurfaceGravity(), the responsible line is: pioneer/src/galaxy/SystemBody.cpp Line 597 in 3fed83c
Now we add the radius equation into the gravity equation. The surface gravity code above, I trace to commit 5286161 A quick fix could perhaps be to lower the exponent a bit from 0.5 to something like 0.4- 0.45 just to get some variation in there. A more advanced fix would include some randomised mean density. If I'm right above that is. |
pioneer/src/galaxy/StarSystemGenerator.cpp Line 694 in 3fed83c
It looks like this file has been moved. I think it's this one: |
I have been summoned! 😂 Yeah, that was from when I knew things and was smart, so much time has passed since 2014 (omfg) |
That is some great detective work and yeah I never thought of that before 🤔 I guess that we don't take into account the possible variations in density due to the being Rocky->Ocean->etc type worlds that 1->200 Earth masses can be. Even 1 Earth mass world might have very different radius due to it's composition. |
Here's a oneliner that randomizes volume to achieve varying density. I'm also testing adding diff --git a/src/galaxy/StarSystemGenerator.cpp b/src/galaxy/StarSystemGenerator.cpp
index f97387cd3..ab057ecb3 100644
--- a/src/galaxy/StarSystemGenerator.cpp
+++ b/src/galaxy/StarSystemGenerator.cpp
@@ -703,8 +703,11 @@ void StarSystemRandomGenerator::PickPlanetType(SystemBody *sbody, Random &rand)
sbody->m_radius = fixed::FromDouble(pow(sbody->GetMassAsFixed().ToDouble(), 0.5));
} else {
// Anything bigger than 200 EU masses is a Gas Giant or bigger but the density changes to decrease from here on up...
sbody->m_radius = fixed::FromDouble(22.6 * (1.0 / pow(sbody->GetMassAsFixed().ToDouble(), double(0.0886))));
}
+ // randomize radius
+ sbody->m_radius = fixed::FromDouble(sbody->GetRadiusAsFixed().ToDouble() * (1.2 - (0.4 * rand.Double()))); // +/-20% radius
+
// enforce minimum size of 10km
sbody->m_radius = std::max(sbody->GetRadiusAsFixed(), fixed(1, 630));
|
|
Closing as fixed by #5592 - future improvements can be tracked via a feature request post in the forums or additional defect reports. |
Observed behaviour
Too many planets have exactly 1.0g of gravity
Expected behaviour
Should be more variation, and not exactly 1.0g
Steps to reproduce
Check out Zarelium (-12, -1, -2). All 5 main planets have exactly 1.0g
My pioneer version (and OS):
v20230203 (e77da96) Windows
The text was updated successfully, but these errors were encountered: