-
Notifications
You must be signed in to change notification settings - Fork 20
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
Bounds calculation should consider the default or active variant given by a part config for parts with varying sizes #208
Comments
Gave a quick look at this, and first for clarity, this is a problem introduced by mesh switcher plugins, things are fine in a stock environment. Part bounds used in the engineer report and for cargo bay occlusion are obtained by a call to Ideally, non stock mesh switchers could be populating The KSPCF solution would be to re-implement Given that this is used in many code paths exposing the results in various public ways, it could potentially have some unwanted side effects, but in this specific case I feel this is relatively safe to do, and would definitely fix many issues where non-stock switchers are causing incorrect bounds to be used. Edit : Patching I guess the best KSPCF can do here would be to implement a modding API allowing mesh switchers to easily specify a list a of disabled GameObjects/Transforms. Calling a specific method signature through reflection feels like a viable option here in terms of performance (we could cache an open delegate and a type list), and would avoid the need of a middleman redistributed assembly. Could be something like But this introduce a (soft) dependency on KSPCF and would still require work on the switchers side, as well as introducing a performance hit as KSPCF would have to iterate over every PartModule on every call to |
So... actually, after thinking about it, it might be possible to directly patch Also, for reference : blowfishpro/B9PartSwitch#245 |
Patch seems to be working, very little testing done. |
Released in 1.35.0 |
Concerning a conversation with @JonnyOThan and AlphaMensae on the subject of parts with mesh switch configs and various sizes it was highlighted that KSP doesn't adjust the bounds of a part depending on its variant and the related change of size. KSP always assumes the maximum size and this is reflected in the Engineer Report in the ship editors. Parts that animate do not suffer this issue so maybe a cue can be taken from how those are handled.
I figured and confirmed that this issue means that parts with variants will not agree with the cargo shielding module if any variant exceeds a given cargo bay's shielding radius. In this test craft a ruler set to its shortest size but still produces drag. Its greatest size is also shown for reference.
To reproduce this issue, place a part with varying sizes in a cargo bay, set it to its smallest that can fit (this part must have a size that's clearly longer than the cargo bay is), launch it, turn on aero info in PAWs, get the craft moving and watch the drag value in the part's PAW.
Required mods:
Craft file
The text was updated successfully, but these errors were encountered: