KSP-RO / ProceduralParts

A continuation of StretchySRBs, which is a continuation of StretchyTanks
71 stars 79 forks source link

Drag Cube issue #175

Closed Starwaster closed 8 years ago

Starwaster commented 8 years ago

Drag cubes are not properly being updated properly for Procedural Parts that are the root of their vessel.

Repro steps: (this requires some debugging means of finding drag cube area or radiative area. I put such debugging info into Real Fuels) Make a craft that has a Procedural Part as its root. (either by using a PP part as the first part or by re-rooting. Either works.) The PP part should be sized large enough to make it obvious that surface area as seen by the DragCubeSystem isn't being resized. For default sized PP fuel tank, weighted area is ~4. For a tank resized to 6.6m x 14m it should be ~358 m2. (KSP drag cubes area could go higher, as high as 400m2)

If you want it, I can provide a copy of the RF plugin that has this kind of debugging info.

Workarounds that I've tried are forcing drag cube re-render. Even doing this when going off-rails (which effectively means being able to force re-render at will) hasn't helped so it might be there's no real solution to this problem other than players not making PP parts root. At the very least, if no solution can be found then it should be made a Known Issue, and possibly a pop up warning displayed to players that try to make PP parts root.

OtherBarry commented 8 years ago

A lot of effort, but could we rebuild the entire ship on launch if proc part is the root? Finicky workaround, but the only solution I can think of.

On Tuesday, 17 November 2015, Starwaster notifications@github.com wrote:

Drag cubes are not properly being updated properly for Procedural Parts that are the root of their vessel.

Repro steps: (this requires some debugging means of finding drag cube area or radiative area. I put such debugging info into Real Fuels) Make a craft that has a Procedural Part as its root. (either by using a PP part as the first part or by re-rooting. Either works.) The PP part should be sized large enough to make it obvious that surface area as seen by the DragCubeSystem isn't being resized. For default sized PP fuel tank, weighted area is ~4. For a tank resized to 6.6m x 14m it should be ~358 m2. (KSP drag cubes area could go higher, as high as 400m2)

If you want it, I can provide a copy of the RF plugin that has this kind of debugging info.

Workarounds that I've tried are forcing drag cube re-render. Even doing this when going off-rails (which effectively means being able to force re-render at will) hasn't helped so it might be there's no real solution to this problem other than players not making PP parts root. At the very least, if no solution can be found then it should be made a Known Issue, and possibly a pop up warning displayed to players that try to make PP parts root.

— Reply to this email directly or view it on GitHub https://github.com/Swamp-Ig/ProceduralParts/issues/175.

Sent from my iPhone

ItMustBeACamel commented 8 years ago

Thats odd. O_o PP does nothing special when creating shapes for root parts. Might be a bug in KSP. I will investigate further. All I can see for now is there is a suspicious Log entry when loading a craft on the launchpad:

[Log]: Reloaded override drag cube for zeroed cube root part proceduralTankLiquid on vessel Untitled Space Craft

The message also occurs if the root part is not procedural...

Oh, and I would really appreciate the debug code for the Drag cubes.

ItMustBeACamel commented 8 years ago

I created an issue on squads bugtracker http://bugs.kerbalspaceprogram.com/issues/5987

@NathanKell do you know whether this Is intentional or a bug introduced in 1.0.5? Do you know a good way to work around it?

NathanKell commented 8 years ago

This is (a) written by me, and (b) by design. Override drag cubes get lost on revert / quickload, so on the first physics frame FlightIntegrator resets all root part drag cubes. There's a note in the log. If you are using a custom drag cube but not a procedural one, that will cause problems, yes. (Procedural drag cubes re-render then).

ItMustBeACamel commented 8 years ago

Ah! Thanks a lot. Setting the "Procedural" property to true after creating the dragcube does the trick. I observed the same behaviour on the stock fairings and assumed a bug. Seems like they need to do the same.

NathanKell commented 8 years ago

You actually need a slight workaround: procedural cubes will, AFAIK, continue to rerender. So it's probably better to just force a rerender once?

ItMustBeACamel commented 8 years ago

I'm not sure if I get what you mean. After load I get the log message: "[Log]: DragCubeSystem: Rendering procedural drag for proceduralTankLiquid"

instead of the beforementioned

"[Log]: Reloaded override drag cube for zeroed cube root part proceduralTankLiquid on vessel Untitled Space Craft"

Do they get rerendered on occasions other than after loading?

I guess I could get rid of the drag cube rendering on start and instead just mark the Cubes as procedural since they are going to be rerendered anyway.

NathanKell commented 8 years ago

I don't recall offhand what triggers a re-render (if it's just events, or time-based too), but it will rerender eventually...