-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix payload fairing thickness calculation #46
Conversation
66cd896
to
68f3b69
Compare
updated per comments above |
68f3b69
to
5cc9195
Compare
Looks like there might be some potential issues running this patch in flight scene; note to self to track those down. |
5cc9195
to
6ab53a4
Compare
Okay, hopefully this should make it work without problems in flight as well |
@@ -94,6 +94,8 @@ public enum BaseMode { Payload, Adapter, Plate, Other } | |||
[KSPField] public float decouplerMassMult = 1; // Mass multiplier | |||
[KSPField] public float decouplerMassBase = 0; // Flat additional mass (0.001 = 1kg) | |||
|
|||
[KSPField] public float maxFairingSize = 0; // the "real" maximum width of the fairing, the bulge in the middle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs isPersistant = true
for the field value to get saved into the craft file / sfs.
Any updates on this? |
@FioraAeterna checking in again :) |
When the middle of the payload fairing is wider than the base, fairing thickness was incorrectly calculated. This allowed players to effectively cheese the thickness by making the base arbitrarily small, allowing for arbitrarily thin fairings. Now, the fairing thickness should be based on the maximum width of the fairing instead of the base. A little bit of refactoring was required to make this work, since we need the scan data earlier to determine the correct payload fairing width.
7508457
to
aeaceb5
Compare
@siimav good to go? |
When the middle of the payload fairing is wider than the base, fairing thickness was incorrectly calculated. This allowed players to effectively cheese the thickness by making the base arbitrarily small, allowing for arbitrarily thin fairings.
Now, the fairing thickness should be based on the maximum width of the fairing instead of the base.
A little bit of refactoring was required to make this work, since we need the scan data earlier to determine the correct payload fairing width.
Note to maintainers:
I have not heavily tested this, just confirmed that it seems to do the right thing on a few of my rockets. Please at least look it over to make sure the code passes your smell test. I also only tested payload fairings.
This will make some fairings heavier and more expensive than before. If this effect is too large, it may be worth revisiting the minimum thickness calculations. But do note, I did not actually change the thickness formula; I simply made it apply consistently.
I had to refactor a few things to make this work (e.g. pre-calculating the scan to avoid doing it twice). If you don't like how I did it, please feel free to change the order of things.