-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Planet density #5592
Planet density #5592
Conversation
I still don't fly spacecraft so this hasn't been tested in that regard. |
Offtop: I <3 the planet name <3 |
I had to google that. You're into football? |
@zonkmachine Yep! (Pretty much any sport, tbh) |
Regarding spaceflight, there is a bit of an implicit dependency on planets with landing zones having <= 1.0g surface gravity in the gameplay balance currently. Increasing the mean gravity of planets with spaceports (and thus mission targets) does mean that several ships currently present in the game will be unable to land or complete missions on some worlds when fully laden. Ideally, we'd want to follow-up on this effort by introducing some sort of common information display to the BBS interface which notifies the player when a mission would take place on a high-gravity world, or at the very least warn the player if they're flying a space-only craft and the mission involves landing on any planet. I don't think that's a matter that needs to be solved in this PR however, and I'd definitely prefer to tackle it alongside an attempt to redesign the BBS mission dialog interface to follow some of @nozmajner's concepts. |
As I understand it, since I'm calling rand, the universe now changes. I haven't found a good way around this that isn't hacky beyond what I can stomach. And I can stomach quite a lot. Maybe cheat a bit instead and just modulate the presented gravity for now? Just let the planets size 1 - 200 earth masses stay 1.0 g under the hood but do the computations in system-view-ui.lua and present some variation to the user? |
If we're about to change the universe, then we might as well put in some condition that guarantees any High-G planet to have an orbital. It even makes sense, since colonizing a high-G planet might require supporting also low thrust craft, or some other hand waivey thingy. (we do similar if-conditions, to improve playability, with Hydrogen, no station can have 0.) |
A comment on the 'Escape Velocity' and ̈́Mean Density' values. I put them in there to aid in trouble shooting but I think they're good for immersion. I simply like the bling of it. Gravity is pretty unintuitive and this aids in getting a feeling for the body in front of you. Should the computations maybe go in c++ functions like next to |
This is expected behavior. In the ideal situation, you add new random rolls after all existing rolls to avoid disrupting other existing values, but it's not required (nor feasible in some cases). The only thing that needs to be done is to have this PR marked as a savegame bump, as it will not have galaxy-level compatibility with the game from before this PR. I'm quite happy to bump for this, and if I'm able to land some of my outstanding branches we'll definitely need a savegame bump anyways.
I'd be fine with that, escape velocity at the very least would be useful to have for autopilot-planning code. Regarding station generation - you should only add an orbital around a high-gravity world which has a surface starport. Adding an orbital to every high-gravity world is probably not a good idea. 😄 |
I'm looking at fixing this here but I should probably try and limit the PR as the topic could easily be all over the codebase. Maybe the span of the density can be tweaked a bit but it looks like it's pretty much useful as it is right now. On the low end I've seen planets presented as 'rocky planet' with a mean density of ~2ton/m3 and that is similar to Ganymede and Callisto and probably a good low for a rocky planet. I'm looking at altering the Search and Rescue code to include gravity but not touching any of the other modules right now, for brevity. Only simple dialogue changes this time like: |
That's fine, my original thought was to introduce a "mission parameters" UI element into the chat form which would display "legal disclaimers" e.g. warnings to the player that they should expect combat or high-gravity worlds. This concept however is definitely a task for another PR, and if you can fit the gravity warning in naturally then go for it! |
9b902a4
to
5ffad94
Compare
English help! Which line is best? Time for flight testing? |
OK. I've added some strings on gravity theme to the Search and Rescue module. It's only on flavour four which is a scenario with a landed spacecraft. Flavour one to three are also landed but on a local planet so the pilot should know the gravity already. |
I was thinking a message in the Advice module could be motivated. How about the Jimmy Cliff themed "The harder the g, the harder the fall", "Make sure you know the surface gravity of a planet before you even think of landing on it." ? |
2 or 3. Not 1. Btw, you could look at how "Set as navigation target" is implemented, as it's added to all missions by default, without touching the mission modules, if I remember correctly. |
OK. I settled for 3.
OK, something like "Show object info"? Showing the object info from the 'System Map/System Overview'? |
Edit: This feature has been removed in this PR. May be implemented later. @impaktor Is this something like what you had in mind? (rudimentary implementation) Edit: Where I've used 'Gravity' before I should say 'Surface gravity'. The example above is just a sketch. I don't know what data would be wanted here. |
I wasn't thinking of anything in particular, beyond "avoid adding strings to every module". |
OK, I understand, but In reference to |
No population over 5 g I'm going to await further review now before continuing on this PR. |
I added the info button embryo to the Cargo Run and Deliver Package modules for easier testing. The info is mostly not showing the right body though and the data shown is more or less random planet data. Feedback needed! Maybe drop for a later PR? |
No. With the current model with +/-20% radius I can change Earth surface gravity between 0.69 and 1.56 g. With +/- 30% the surface gravity would be 0.59 - 2.03 g. That would work if the distribution would have a distribution centering more around 1 g. Like the snippet below calling rand twice. Testing it now and it looks promising. sbody->m_radius = fixed::FromDouble(sbody->GetRadiusAsFixed().ToDouble() * ( 1.3 - (0.3 * (
rand.Double() + rand.Double())))); // +/-30% radius |
Ready for review and test. Please note. There are quite a few custom systems in the game and they still have the issue with an overabundance of 1.0 g planets. These needs to be fixed manually and this is out of scoop for this PR. I removed the info button as I deemed it also out of scoop. |
I'm working on a visual editor for custom systems in my available Pioneer time and noticed some issues and inconsistencies with how custom systems are loaded and handled. Unless this branch is a blocker for other efforts of your own, I'll most likely combine efforts and merge this and my branch on similar timeframes to take advantage of the fact that both will require savegame bumps. I'm expecting it to take anywhere between a week to a month to land that branch. |
Sounds good. It blocks nothing on my side. |
Exactly one month later, the editor part of the system editor is finished. I have a few outstanding issues in #5622 before I can merge it, but once those are complete I'll be merging this PR as well. 🎉 |
@zonkmachine if you're able to rebase on master and give this a quick playtest, this PR should be good for merge. |
* Randomize radius to +/- 20% to give the bodies some difference in surface gravity. * Set an absolute limit of 5 g for habitability. * Advice on gravity. * Always build an orbiting station on inhabited worlds with a larger gravity (large currently being defined as over 1.07 g. * New Planet info posts: 'Escape velocity' and 'Mean density'. * Search and Rescue - Flavour 4 has extra text on dialogue when target planet is more than 1.2 g.
OK. Rebased without any problems and I've done a very quick playtest. |
Addresses #5581. A quick way to alleviate the issue with planets between 1 and 200 earth masses all having 1.0g surface gravity.