Jump to content

Uneven fuel ducting when feeding from one tank


Recommended Posts

This *might* be a mini bug but I'm assuming my naivety of gameplay mechanics for now.

Imagine an asparagus setup as shown (excellently I might add) in the wiki:

100px-Asparagus-staging.svg.png

S1 is a Rockomax X200-32 (1440 capacity) fuel tank with a mainsail engine beneath it.

S2-S4 are all Rockomax Jumbo (orange) fuel tanks with skipper engines beneath them.

Fuel ducting exactly as described in the above image and everything works just fine.

Works fine

Now add directly above S1 a payload, comprising of:

Wide stack decoupler (not fuel crossfeed capable)

Rockomax Jumbo (orange) fuel tank

Probe core of your choice.

This also works exactly as expected, with the payload jumbo fuel tank left unmolested by virtue of the non-crossfeed capable stack decoupler.

Works wonky

Now assume you're happy to use that payload fuel to achieve orbit, you want to get a fuel can into space but you're happy if it's an empty fuel can. (first discovered this issue when launching a space station fuel depot module - have simplified the model to test the issue).

So you run a pair of fuel ducts from the payload jumbo tank to the two jumbo tanks in S4.

I expected fuel to first drain from the payload can evenly into the pair of S4 tanks, then when the payload can was empty the S4 pair would start to empty.

In reality what happens is that fuel does indeed drain from the payload can, and one of the S4 pair remains full whilst the payload can is draining. The other can in the S4 pair however slowly drains from launch.

Net result is that one of the S4 pair runs out of fuel a few seconds before the other one - resulting in a rocket fuelled acrobatic ballet which, if adopted by the Bolshoi, would encourage a lot more people to see Swan Lake.

Maybe solution

Curiously, feeding the pair of fuel ducts into the S3 pair rather than the S4 pair seems to work ok (though still perhaps slightly out as a twitch upon running dry suggests a minor imbalance). In this setup fuel drains apparently evenly from the payload tank and both the S4 pair such that all three appear to run out at almost exactly the same time; the S3 pair remain topped up and untouched until the S4 pair runs dry (and are subsequently jettisoned).

In terms of absolute efficiency this solution might not be optimal as the payload mass is at it's lightest just as you jettison two engines (and 1300kn of thrust) rather than before, but it's probably good enough for Kerbal rocket science.

Edited by MiniMatt
'twas a bug/issue/feature
Link to comment
Share on other sites

Hiyas,

Unfortunately doesn't appear to be the case as tested through numerous iterations. Have just simplified the test further and there is some definite weirdness when ducting a single tank into dual tanks which ultimately duct back into a single tank.

EDIT: sorted screenshot (hopefully below)

SlkzyM6l.jpg

click to enbiggen, useful for seeing direction of fuel lines

Above link should show the simplest rocket I can devise to illustrate the problem. Take any probe core/control can; beneath that place any fuel tank and beneath that a stack decoupler. Beneath the stack decoupler place another fuel can and beneath that any engine. Either side of this lower fuel can place a pair of fuel cans on radial decouplers and beneath each of those cans a pair of engines. Take fuel lines from the pair of radial cans into the lower centre can. Take another pair of fuel lines from the upper centre can feeding into the radial cans.

Net result is that one of the radial cans will remain topped up whilst the upper can drains whilst the other radial can will drain at maybe a quarter the speed one would normally expect were it not being (partially) fed from the upper can. The radial pair therefore run out of fuel at different times.

Edited by MiniMatt
screenshotified
Link to comment
Share on other sites

Yep a little more testing has revealed the key problem.

The centre engine has two equal cost paths available to it to reach it's furthest fuel tank.

If you remove the two radial engines from the above screenshotted craft, leaving only the centre engine, then the problem is still apparent. However if you remove only the centre engine, leaving only the two radial engines then fuel flow is exactly as expected - ie. the uppermost payload tank drains first with the two radial tanks staying completely topped up until this upper tank is dry. These radial engines have only one path available to them to reach their furthest fuel source whereas the central engine can take either the left or the right path to reach it's furthest fuel source and both paths are equal cost.

Doesn't quite explain why the partial workaround in the original post seems to work but it may come in useful should anyone else stumble across the same problem.

Will mark as answered and file a bug report as you suggest.

Link to comment
Share on other sites

This is a well known issue, you've basically broken the fuel logic going from center stack out to radials, then back into the center stack, creating a loop. Loops tend to break the logic and should be avoided. Once you go out from the centerstack you shouldn't go back in, if you want to empty that tank you can bleed off the fuel with engines before launch. Alternatively just create a fuel connection straight down, instead of going out to the radials.

No need for a bug report I think, it's been reported (and discussed) plenty of times.

Link to comment
Share on other sites

the problem is in the fuel algorithm

basically speaking (i hope) the fuel drain (rocket) asks the attached fuel tank for fuel. the tank then checks if it can get fuel, if it can it asks the next tank "up" the chain, if it cant it delivers it. this continues all the way up the chain. however, it is blocked if the fuel source has already been asked by this fuel drain - this is specifically there to prevent looping calculations.

this explains one to one behaviour.

when there are two potential sources they are both querried for equal proportions. IE, they drain at the same rate. the querries are handled in series. so the A branch will continue til conclusion and then the B branch will run. in completely seperate systems (the asparagus staging you show) this works absolutely fine, because each side branch is independent of the other branches.

The problem comes when you want ONE tank to be source to MANY tanks that feed to ONE drain. (one to many to one).

In this case the drain querries the inital tank (one) who splits the drain between the 2 (many) side tanks. this then progresses to the payload (one) tank. this is querried by branch A and provides the requested fuel. B branch then runs, but when it reaches the payload tank it requests from the payload tank - the payload tank denies the request as it has already had this discussion regarding the fuel drain with branch A. Branch B gets offended, but pressure from the fuel drain means it reluctantly supplies fuel from its highest tank up the chain.

This leads to the payload tank draining AND the next highest tank in branch B.

This isnt a "bug" so much as a side effect of a feature. one the Devs are aware of and no satisfactory solution is currently available.

I hope this helps your understanding of the fuel flow :) to get the desired effect i would suggest EITHER splitting the payload tank in half (and routing the fuel from each to one branch only) OR routing the payload tank to the central tank.

Key rules of KSP fuel:

ONE to MANY : Good

MANY to ONE : Good

ONE to ONE: lovely

ONE to MANY to ONE: BAD

MANY to ONE to MANY: BAD.

PS: the inital solution of moving the payload tank further down the chain works because it halfs the draw on it, that halfs the disbalance - hopefully if you followed the above it will make sense why that is so :)

Link to comment
Share on other sites

Yep a bit of searching (*cough* what I should have done first *cough*) suggests at least one official bug report at http://bugs.kerbalspaceprogram.com/issues/991 so I won't duplicate.

Shand your explanation makes perfect sense, I figured late in the day that the problem must lie in parsing in series on each update.

As a network tech by trade I'd suggest the problem might be tackled by calculating fuel paths on initialisation rather than each update via something like a spanning-tree algorithm, but my programming skills leave something to be desired and my knowledge of their KSP code is non-existent so I'm certainly not about to suggest there may be some easy fix.

The workarounds you suggest work perfectly, and more importantly I now understand why they work perfectly :)

Link to comment
Share on other sites

There is a mod that will let you do something you wouldnt be able to do by hand (that fast and evenly).

http://forum.kerbalspaceprogram.com/showthread.php/25823-0-21-1-TAC-Fuel-Balancer-25Jul

You can set the payload tank to "balance out" so it refuels ANY tank of the craft - like you could do by yourself with ALT-right-click, but not in the required perfect manner - it is one of the rare occasions I might concur to saying a certain mod does at least have a slightly cheaty game-simplifying option/possibility - but in this case it would be more like a workaround I think.

It can also be used to refuel all cans and tanks of a multipart ship at a refueling station - which would just save time and lots of clicking and rotating.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...