Sign in to follow this  
Gaius

[0.23.5] Goodspeed Automatic Fuel Pump v2.14.1

Recommended Posts

Gaius Goodspeed has retired and is now spending his time sitting on the deck of a yacht on Laythe drinking piña coladas. The fuel pump business has been taken over by Geordiepigeonowner and can be found in this thread. Thank you all and have a great life! :cool:

*****

Ever undock from your space station, only to realize you forgot to top off your fuel or RCS tanks? Want to have tanks that automatically pump fuel where it’s needed, without having to bring up windows and manually move fuel around? Want to set up fuel balancing in the SPH or VAB as a “tweakable†and have it saved with your vessel? Simultaneously balance different groups of tanks on the same vessel independently of one-another? Just generally mess around with fuel routing, and have these settings persistent? Then Goodspeed Aerospace has the tool for you!

The Goodspeed Automatic Fuel Pump, once installed in your fuel tanks, allows you to set up a “pump level†for each tank, either as a “tweakable†while building your vehicle, or while in flight. You can set tanks to automatically pump fuel to lower level tanks whenever possible, or balance between tanks at the same level. Uses include refueling tanks at space stations that automatically top off the tanks of any vessels as soon as they dock with the station, refueling vessels with higher level pumps that automatically refuel the space station as soon as they dock, setting up fuel balancing while building a plane and having it saved with the plane and done completely automatically in flight, setting up more complicated fuel flow patterns for asparagus-like situations without fuel lines for fuel types that don’t normally flow that way (e.g. monopropellant and xenon gas), and many other uses!

Get the newest version from this thread!

This plugin requires ModuleManager to automatically add the pump to all tanks. Get ModuleManager here. Otherwise, you can manually add it to tanks by adding the appropriate MODULE section to the tank config.

Right-click a tank while in the assembly building, or while in flight. Set the pump level as desired, and turn on "Auto Pump" and/or "Balance". "Auto Pump" will automatically pump fuel from this tank to any lower level tanks (water flows downhill) when they have room. The "Balance" function will keep the percentage of fuel in this tank identical to any other tanks with the same pump level and "Balance" on. Note that this allows different sets of tanks to be balanced within their own set but independently of the other sets.

And since everyone always wants pictures, even if it's just a tweakable, here's some pics:

Javascript is disabled. View full album

The first pic shows a fuel station that automatically refuels any ship that docks with it. In this setup, the top two tanks remain left/right balanced while draining first, then the next two down, and so on, with the two on the bottom draining last. Why would you want to do this? Because... reasons.

The second pic just shows that the pump settings appear in the assembly building as "tweakables" as well as in-flight. These settings are saved with your craft.

The third pic just shows the pumps keeping three tanks balanced in-flight.

The fourth pic shows the "Pump Options" window that allows you to turn off the pumping of some resources while leaving it enabled for others.

Source code is included in the download in the same directory as the plugin. Licence is GNU GPL.

Version history:

1.24.1: First public release.

1.29.1: Added ability to selectively disable pumping or balancing of one or more resources on parts that have multiple kinds of resources in them, either from the options window or in the config files.

2.14.1: Fixed (hopefully) compatibility issue with Modular Fuels/Real Fuels, or other mods that modify which resources a tank contains after loading, and added a sanity check to prevent pumping of antifuel in impossible circumstances that apparently occasionally happen anyway.

Edited by Gaius
Retired and gone to Laythe...

Share this post


Link to post
Share on other sites

This looks great! I really want to use it, unfortunately, because I have AIES, toroidal/spherical tanks, B9, and KW installed, getting it set up for all those extra tanks will be quite a chore. Is it possible to have the plugin add this functionality to all tanks without needing a module manager config for each of them?

Share this post


Link to post
Share on other sites
This looks great! I really want to use it, unfortunately, because I have AIES, toroidal/spherical tanks, B9, and KW installed, getting it set up for all those extra tanks will be quite a chore. Is it possible to have the plugin add this functionality to all tanks without needing a module manager config for each of them?

Haven't looked at it but you should be able to write 1 cfg that would get them all by using a wildcard.

EDIT just looked at it that's how it's setup it should get them too.

Edited by Mecripp2

Share this post


Link to post
Share on other sites
This looks great! I really want to use it, unfortunately, because I have AIES, toroidal/spherical tanks, B9, and KW installed, getting it set up for all those extra tanks will be quite a chore. Is it possible to have the plugin add this functionality to all tanks without needing a module manager config for each of them?

Yup, by default it should automatically add it to any tanks, not just stock ones. You'll have to go edit the configs if you don't want it added to some tanks.

Share this post


Link to post
Share on other sites

I already use TAC Fuel Balancer, what's the upside to this one compared to that?

Share this post


Link to post
Share on other sites

Read the post. This is automatic and can balance in multiple ways automatically. Note the word automatically.

Share this post


Link to post
Share on other sites

Handy, there's other mods that do these things of course but the persistence will be the killer. You get sick of setting balancers again and again

Share this post


Link to post
Share on other sites

Nice thing!

It would be just nicer, if i can set the "balance" and "autopump"-options per fuel and if this plugin would be able to punp other pumpable ressources, like food and water and so on.(TAC-Life support).

A other thing where the possibility to set a "left xx% back"-option on each fuel.

Share this post


Link to post
Share on other sites

I haven't been able to fiddle with this much, but is there a way to set it up to pump from one specific tank to another in an asparagus style (like you can do with fuel lines)?

Share this post


Link to post
Share on other sites

Wow this is great. Very helpful for those many-tanks-space-stations and those hypersonic birds that need fuel balancing :)

Share this post


Link to post
Share on other sites

Thanks for all the kind words! :)

Nice thing!

It would be just nicer, if i can set the "balance" and "autopump"-options per fuel and if this plugin would be able to punp other pumpable ressources, like food and water and so on.(TAC-Life support).

A other thing where the possibility to set a "left xx% back"-option on each fuel.

Check the "GoodspeedPump.cfg" file comments, it's pretty easy to set it to use other resource tanks like food and water too.

The balance and pump settings are per tank at the moment, and yeah, there's no way to set it individually for different resources when a tank has multiple resource types in it. That's kind of hard to do with a simple tweakable, but it's on my radar for options to add if there's some way to do it that isn't overly complicated. Trying to keep this sweet and simple. If it ends up cluttering the right-click menus too much, I might just spawn it off as a different mod for "advanced" needs. No promises here, but I'll definitely keep it in mind.

For the "left xx% back" option, I assume this means you'd want it to say, pump out fuel down to 5%, but stop pumping at that point, maintaining 5% as a minimum? That's a pretty good idea, actually. I used to often want to offload most of my fuel, but keep enough left to deorbit the vehicle afterwards. Although lately I've stopped deorbiting vehicles; now I send the Recycler after them for the RocketParts (thanks Extraplanetary Launchpads).

I haven't been able to fiddle with this much, but is there a way to set it up to pump from one specific tank to another in an asparagus style (like you can do with fuel lines)?

You can do asparagus-style staging by setting tanks at different levels. Say, set a pair of tanks to level 4, another pair to 3, another to 2, etc, having them all auto-pump. The level 4 tanks and drain completely before any of the lower level tanks lose a drop, they can then be jettisoned, and so on down the line. One of the reasons I made this mod was because I was doing this with a xenon gas powered craft, and fuel lines don't work with xenon, and to add insult to injury, xenon tanks have a very high dry mass to full mass ratio, making ditching them that much more attractive.

great mod ... if you add to electric charge parts i deinstall tac fuel balancer and use your mod.

Again, check "GoodspeedPump.cfg" if you would like to add ElectricCharge to the resources it will pump around... I've never seen the need to pump it around myself, but it's certainly possible.

I should note that, even with my own mod, I still have TAC Fuel Balancer installed. This takes over some functions of that mod, and does a few things that one can't do, but TAC is still quite useful for those times when you want to manually shunt fuel around, and it's still the best way I know of to bring up a window showing the individual status of every tank on a vessel all in one place. I think the two compliment one another nicely.

Edited by Gaius

Share this post


Link to post
Share on other sites

This part almost solves the annoying monopropellant management I have to do with my current fleet.

The one improvement I'd like: I'd like to be able to specify which resources this plugin manages (per-part, ideally). Here's my use case: I'm flying FASA Gemini capsules, and they have several parts with monopropellant tanks. One of these also contains LF/O. I don't want it pumping LF/O, only monopropellant. Currently, I have to set the priorities of all of the parts with tanks (LF/O or mono) to make sure the monopropellant flows where I want, and liquid fuel doesn't. It also means I have to add this module to all fuel tank parts - I discovered this morning that if I comment out adding the module to LF/O tanks in the cfg, and only have it on monopropellant tanks, this plugin still pumps LF/O out of the service module - in this case, apparently pumping it into booster stages, even though they don't have the pump module installed. The ideal configuration would let me opt-in per part by having a config along the lines of


MODULE
{
name = GoodspeedPump
resource = Monopropellant
}

To indicate that on this particular part, GoodspeedPump will only pump monopropellant, and it will leave the LF/O (or whatever other resources) alone. Yeah, I know, I'm not asking much. :)

Share this post


Link to post
Share on other sites
Yeah, I know, I'm not asking much. :)

:) It's a very good idea. Now I just need to figure out how to do it... (this being my first KSP mod, and the API is not exactly well documented... :P ) But yes, definitely, being able to specify which resources you want managed, rather than just which tanks, is definitely on my own wish list as well.

Share this post


Link to post
Share on other sites

I've taken a liking to this mod. I'm using it in conjunction with my TAC Fuel balancer.

Share this post


Link to post
Share on other sites

One issue I have with TAC is that if you've docked two identical ships in a setup with lots of small tanks. It becomes impossible to discern which tank belongs to which ship the highlighter helps but is very clunky. Goodspeed would solve that problem because you transfer the fuel by clicking in the scene and not in some window. So kudo's for that! You say TAC works well in tandem with this mod. I personally don't see why I'd still want TAC after installing this mod ;) Don't get me wrong... Tac does a great job I could not live without it at this stage. But it's interface is hopelessly clunky and simplistic.

In the VAB you can add tanks via symmetry groups. Would it be possible to select and modify all tanks for a symmetry group? Or failing that... Would it be possible to select all similar tanks?

And an idea just off the top of my head, would it be possible to auto assign the stage level as a priority to the tank? That would imply auto asparagus or onion staging depending on how you set up your staging. And it would help in the rare instances where you want a particularly heavy upper stage to drain into a lower stage before ejecting those extra powerfull engines. (If your upper stage happens to be a heavy low TWR inter planetary ship)

Share this post


Link to post
Share on other sites

I love this mod. Instead of having to pump fuel manually from one tank to another on my landers (because my fuel lines always seem to break), I can simply just sit back and let this mod do its work! AND IT SAVES YOUR SETTINGS! So good.

Share this post


Link to post
Share on other sites

Really nice, I use several orbital tugs to continuously move a lot of things from place to place and it's very neat how they now automatically replenish monopropellant every time when dock with station. Thanks.

Share this post


Link to post
Share on other sites

Thanks again for all the kind words! :)

NEW VERSION RELEASED! Spaceport has been updated to v1.29.1. New in this version: you can now disable the pumping or balancing of certain resources while leaving it enabled for others, as requested above. Right-click the part, select "Pump Options", and enable/disable to your heart's content.

"Pics or it didn't happen!" Right, right...

G1kAfqy.png

Here we see The Forge orbital construction space station showing off the lovely Pump Options window.

You can also have tanks start with certain resources disabled by default by messing with the default options in the MODULE section in the config. By default, tanks pump all resources they actually contain. To disable a particular resource, add lines to the MODULE section that read something like:

LiquidFuelFlags = 0

...replacing "LiquidFuel" as appropriate, of course. This will make the pump ignore LiquidFuel entirely. Setting the flags to 1 pumps the resource but excludes it from balancing, 2 balances the resource by excludes it from pumping, and 3 is the default: both pump and balance the resource.

Enjoy! :)

In the VAB you can add tanks via symmetry groups. Would it be possible to select and modify all tanks for a symmetry group? Or failing that... Would it be possible to select all similar tanks?

In the VAB, setting options on any tank in a symmetry group sets the option for all tanks in the group. Once in flight, however, each tank needs to be set individually. I'll add the ability to link the options of tanks in-flight to the wish list, but no promises. I'm not sure how easy it is to detect that parts were part of a symmetry group once you leave the VAB.

And an idea just off the top of my head, would it be possible to auto assign the stage level as a priority to the tank? That would imply auto asparagus or onion staging depending on how you set up your staging. And it would help in the rare instances where you want a particularly heavy upper stage to drain into a lower stage before ejecting those extra powerfull engines. (If your upper stage happens to be a heavy low TWR inter planetary ship)

Hmm. Yeah, I can see how that could be quite useful too. The wishlist grows...

Edited by Gaius

Share this post


Link to post
Share on other sites
You can also have tanks start with certain resources disabled by default by messing with the default options in the MODULE section in the config. By default, tanks pump all resources they actually contain. To disable a particular resource, add lines to the MODULE section that read something like:

Awesome! That makes flying FASA Gemini capsules drastically easier. I can't remember how many times I started re-entry, dropped the service modules, and realized I had no monopropellant for adjusting the reentry trajectory.

One "feature" to report: parts that do not have the pump module installed still receive resources as if they are priority zero, if they contain a resource that is pumped. The particular case I have is the FASA Gemini orbital parts (one engine with LF/O/mono, the command pod with mono, and the nose RCS block with mono). Only the engine and the RCS block have the GoodSpeed pump, configured to pump mono only. The RCS block is set at 0, the LF/O/mono part is set at 1, and has pump enabled. The command pod does not have the module, since it's excluded by the ModuleManager configuration. However, when I separate parts, both the RCS and the command pod have full tanks. In my case, that's a Good Thing.

I don't know if you intend parts that aren't configured with the module to behave like that, or to be excluded entirely from the pumping/balancing scheme. If it's intentional, you might want to make that clear; otherwise, you might adjust the pumping logic so it'll only consider pumping into parts that have the pump installed. I don't know if balancing behaves the same way (I don't have any good test candidates right now).

Share this post


Link to post
Share on other sites

Great mod. Really helps with lots of fuel tanks.

I usually click the arrow next to the mono tanks on the pods during preflight to keep fuel from coming from them. Then on re-entry I turn them back on.

Share this post


Link to post
Share on other sites
Great mod. Really helps with lots of fuel tanks.

I usually click the arrow next to the mono tanks on the pods during preflight to keep fuel from coming from them. Then on re-entry I turn them back on.

That's hard to do from IVA, though. If I can find a good way to toggle that setting from within RasterPropMonitor, I'll add that feature. :)

Share this post


Link to post
Share on other sites

Cool, glad you like it! :)

Yes, the pumps treat tanks without the pump module installed as level 0 tanks. This is by design, and as you note, this is usually a Good Thing. However, now that I've figured out how to make things configurable in the config files or options window, I will add a flag to disable that behavior, just in case its not desired in some situations, but the current behavior will be the default.

This isn't an issue for balancing, since balancing only ever occurs between tanks that have the "Balance" option ticked as well as being on the same level, and you can't tick it on for tanks without the module installed.

Share this post


Link to post
Share on other sites
Cool, glad you like it! :)

Yes, the pumps treat tanks without the pump module installed as level 0 tanks. This is by design, and as you note, this is usually a Good Thing. However, now that I've figured out how to make things configurable in the config files or options window, I will add a flag to disable that behavior, just in case its not desired in some situations, but the current behavior will be the default.

This isn't an issue for balancing, since balancing only ever occurs between tanks that have the "Balance" option ticked as well as being on the same level, and you can't tick it on for tanks without the module installed.

Okay. I can live with expected behavior, now that I expect it. :)

Share this post


Link to post
Share on other sites
Great mod. Really helps with lots of fuel tanks.

I usually click the arrow next to the mono tanks on the pods during preflight to keep fuel from coming from them. Then on re-entry I turn them back on.

That's hard to do from IVA, though. If I can find a good way to toggle that setting from within RasterPropMonitor, I'll add that feature. :)

It might be a tad hard to do from IVA, but with tweakables you can disable fuel flow before you ever leave VAB/SPH. That's a feture I found to be very helpful with somethings well, until you forgot that you made the change and you didn't want it that way and you remember well into a long atmospheric flight

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this