Jump to content

Fuel transfers through decoupler with crossfeed disabled


FuelX

Recommended Posts

I have had limited success in attaching landing legs to i-beams and other structures, but this is not the complete scope of the problem

  • KSP Version 0.1.0.0.20892
  • Operating System and version  (Windows 10, Windows 11) Windows 10
  • CPU and GPU models, any other system information which could be relevant  Ryzen 2920X - GTX1080Ti
  • Description of the bug.  
    • Expected Behavior If a tank has one or more fuel lines leading into it, the tank should not drain until the source of all fuels lines leading into it are empty.
    • Observed Behavior The game prefers to drain tanks which are furthest away from the command pod/drone with some exceptions I don't quite understand yet.
  • Steps to Replicate Create a craft with a few separate tanks which are separated from one another and connect them with fuel lines. Include a command pod/drone and rocket engine also
  • Fixes / Workarounds (if known..) Manually transfer fuel, use i-beams to mount wheels away from the main craft.
  • A list of ALL mods.  If the list is long, please consider using a spoiler window. None
  • Other Notes / Screenshots / Log Files (if possible..)
    Here is a video example where I have 3 tanks. Tank A on the left, Tank B in the middle with a drone attached to it, and Tank C with an engine on it.
    Fuel lines are running from Tank A to Tank B to Tank C. It is expected that Tank A will drain first, then Tank B, then Tank C.
    However on launch both Tank A and C drain equally at the same time. Once Tank A is disconnected from the craft Tank C will stop draining and Tank B will drain. After Tank B drains then Tank C resumes draining.
    In a practical example here is a large rocket with two pairs of drop tanks. It is expected that the mast-starboard (closest to the camera) and deck-port pair drain first, then the deck-starboard and mast-port. However they drain equally until I attempt a manual transfer. (wasn't totally successful because of another but, but I'll explain that elsewhere :P)
Link to comment
Share on other sites

I tried investigating this a bit, with some code that reads the flow graph used for the resource flow calculations.

Tested by loading the Kerbal-K2, and adding Wombat landing legs to the upper stage's X200-16 with 4x symmetry. Flow graph before launching:

ORz3Fyo.png

This looks fine. (Each box is one part of the vessel, and the arrows show attachments between parts. Resources flow across those edges, except where crossfeed is disabled etc.)

Flow graph after launching and staging:

kLwbtHa.png

That clearly shows a problem: the landing legs are now attached to two different fuel tanks, in two different stages. That means fuel can flow between the tanks via the legs.

Digging a bit deeper, the landing legs actually acquire the second attachment shortly after the vessel is created, but (I assume) the flow graph is not dirtied so the new attachment doesn't affect resource flow until staging forces a graph recalculation. (I suspect this is why launch clamps matter in some people's tests: they trigger the recalculation at an earlier stage.)

Those attachments come from Module_ReinforcedConnection, which looks like a kind of autostrut. A few parts (landingleg_0v, landingleg_2v, wheel_0v_rover, wheel_3v_rover) are configured with ConnectionTarget=Heaviest, so they're typically going to strut to a first stage fuel tank and trigger this issue. Most other parts with this module will strut to their grandparent part instead.

So, I suspect the cause of this bug is that the flow graph is unaware that resources can't flow over these reinforced strut attachments. (Arguably there's also a bug where the flow graph doesn't get dirtied when these attachments are added, so the effect is not felt until staging.)

If my understanding is correct, the workaround is:

  •  Don't use the ConnectionTarget=Heaviest parts: Bandicoot (XS) and Wombat (MD) legs, RoveMax S2 (XS) and RoveMax XL3 (LG) wheels, unless you're putting them on the stage that already has the heaviest part.
  •  If you must use them, make sure there's a non-crossfeeding connection between them and any fuel tanks. The legs will still be connected to your heaviest tank, so you need to isolate them from any later-stage tanks.
  • For any other landing legs, landing gear, wheels, wings, stabilizers, control surfaces: They will still create an unwanted flow connection between their parent and grandparent parts, but I can't currently think of any situations where that would matter, so you're probably fine. (Either the parent and grandparent will be in the same stage, or one will be a decoupler, and I think all of those cases end up working okay.)
Link to comment
Share on other sites

4 hours ago, Excors said:

For any other landing legs, landing gear, wheels, wings, stabilizers, control surfaces: They will still create an unwanted flow connection between their parent and grandparent parts, but I can't currently think of any situations where that would matter, so you're probably fine. (Either the parent and grandparent will be in the same stage, or one will be a decoupler, and I think all of those cases end up working okay.)

I can't check, but I think landing gears are also cause this bug. I tried to beat air launch challenge, and when I decoupled rocket, some amount of methan was lost. After staging upper stages didn't have any fuel. My vehicle looks like this, as rocket decoupler I used TD-12, TD-06 and AD-25. Landing gears are LY-60, LY-99

ba2KerbalSpaceProgram20.png

Link to comment
Share on other sites

On 3/4/2023 at 7:13 PM, Vortygont said:

I can't check, but I think landing gears are also cause this bug. I tried to beat air launch challenge, and when I decoupled rocket, some amount of methan was lost. After staging upper stages didn't have any fuel. My vehicle looks like this, as rocket decoupler I used TD-12, TD-06 and AD-25. Landing gears are LY-60, LY-99

I suspect this may have a different cause: MethaneAir engines will consume methane from anywhere in the vessel, regardless of crossfeed.

That's because they're configured with an 'ingredientOverrides' that tells them to consume IntakeAir from 'ALL_VESSEL' and Methane from 'STAGE_STACK_FLOW_BALANCE', but because of the way the ingredient overrides are implemented, it ends up applying ALL_VESSEL to the Methane too. I'm not certain but I think that will consume from all tanks with equal priority.

Link to comment
Share on other sites

×
×
  • Create New...