Jump to content

TAC Fuel Balancer-DISCONTINUED


TaranisElsu

Recommended Posts

One feature that would be nice is to set a group of tanks or a stage to balance among each other or within the stage.

Yeah, this is what I was after. It would be nice if you could just use a few clicks to say "balance all tanks *on the same stage*".

Link to comment
Share on other sites

I'm not sure if this is even remotely possible, but a really nice feature would be the ability to mouse over the button for a tank and press the corresponding key to set a mode (O=Transfer out, L=Lock, I=Transfer in).

Link to comment
Share on other sites

Is it possible to have it transfer LF and Oxidizer in the same ratio? As it is now there is always a tiny time gap between clicking the transfer on one and then the other so they never transfer the exact same ratio of each. Is there any way to tie them together so they transfer the same amounts?

Link to comment
Share on other sites

  • 3 weeks later...
Is it possible to have it transfer LF and Oxidizer in the same ratio? As it is now there is always a tiny time gap between clicking the transfer on one and then the other so they never transfer the exact same ratio of each. Is there any way to tie them together so they transfer the same amounts?

"Lock LF with OX" option was asked for long time, both in stock and mods.

Link to comment
Share on other sites

This may be a bit much, but a single "master switch" would be awesome. Allowing you to transfer the exact same percentage of LF and OX rather then having to try and get the timing right when using the right click menu.

Link to comment
Share on other sites

Been working perfectly for me in 1.0.4. I get a nag message on startup, that's all.

You can get rid of that by changing the KSP version number in the "TacFuelBalancer.version" file.

@TaranisElsu: I know you're busy, and I can't find the conversation now, but I thought I remembered you saying that you hadn't had time to look at the stock App Launcher API yet. I threw together a very short minimalist demo if you want to look at it when you have some time. The API is really straightforward:

https://www.dropbox.com/s/zub7cpq0js7hrgb/AppLauncher%20Demo.zip?dl=0

Link to comment
Share on other sites

  • 1 month later...
Actually, great idea. I wish I could configure transfers first, then execute them. Custom option "pump x liters in/out" would be nice too.

But anyway, great mod to use as is.

I also would welcome being able to transfer either a set percentage of the output or input tanks and to combine LF/Ox or a set amount of fuel, for example 50 units of Mono.

For example, fill this tank up to 50% with Lf/Ox

or empty out 50% of this tanks Lf/Ox

or put 50 units of Lf and the proportional amount of Ox into this tank.

Link to comment
Share on other sites

I'd like to have persistent settings that stick when a ship is switched away from. That would make refueling from tankers much easier. Set everything to flow out and *not* have to ride the tanker all the way to dock to make it work.

Link to comment
Share on other sites

Can someone please tell me the settings I need to make a simple one-stack and one-engine rocket draw the fuel from the tanks using the lowest first and working up as they empty? Or is that not possible?

Edited by Foxster
Link to comment
Share on other sites

Can someone please tell me the settings I need to make a simple one-stack and one-engine rocket draw the fuel from the tanks using the lowest first and working up as they empty? Or is that not possible?
If you have two fuel tanks stacked, set the top to IN and the bottom to OUT. If you have three fuel tanks, set the top tank to IN, the bottom to OUT, and leave the middle alone. If you have four or more, use fuel pumps...
Link to comment
Share on other sites

If you just have two tanks you can either set the bottom one to Out or the top one to In. No need to do both. If you have fewer tanks you want to keep full than tanks you want to empty, set the smaller set to In.

With the changes to how RCS fuel use is done, there's much less need to manage it with this or other pumping mods.

The most beneficial change to TAC Fuel Balancer would be to make its setting persistent instead of all coming unset when you switch ships.

Link to comment
Share on other sites

UPDATE: I added the ability to transfer liquid fuel and oxidizer in correct proportion, added the ability to select all parts in a resource, and reinserted the download link.

This is a good mod, but I found it frustrating to use, so I made some improvements. My biggest frustration was the number of clicks required to do simple tasks. It took about 40 clicks to refuel my lander after docking with the mothership, and refueling the mothership at a space station was even worse. Finding tanks on large ships was also hard, since it takes four clicks per tank to turn highlighting on and off. There was also a bug with electric charge where attempting to use "Transfer Out" or "Balance All" would dump all your energy into a black hole with most engines. I also added experimental support for transferring liquid fuel and oxidizer in correct proportions and for remembering settings when you switch between ships.

Here are the basic features:

1. Select multiple parts and apply an operation to all of them at once. The selection is done by clicking on the name, and it supports using Ctrl to add or remove parts to/from the selection and Shift to select a range, as well as Ctrl+Shift to add or remove a range to/from the selection. Shift-selection only works within a single resource. (If you have throttle controls bound to left shift and ctrl, you can use the ones on the right side of the keyboard.) You can also click the "Select All" button to select or deselect all parts in a resource. (The screenshots below are not updated to show this feature.) To make parts easier to find, selected parts are automatically highlighted. (You can still highlight parts the normal way, in which case they'll remain highlighted even when not selected.)

select1.png

2. You can select parts by ship, so if you dock a ship with a station or a tanker, you can easily move fuel into or out of all of the ship's tanks at once. You do this by alt-clicking on a part, in which case it'll select all the parts on the same ship. This can combine with Ctrl as well, to add or remove those parts to/from the selection. In the image below, I was able to select all the tanks on my lander with a single click.

select2.png

Note: The mod determines where ships start and end by looking for docking bays. Parts of the current vessel separated by a docking bay are considered a separate "ship" for the purposes of selecting parts. This works well when you have a mothership and a lander, for instance, or a ship and a space station. However, a space station comprising three modules separated by docking bays will show as three "ships". If you dock a ship with the station, it'll show as a fourth ship. You can still easily transfer resources to/from the station by selecting all the parts in the docked ship and using "Transfer Out" or "Transfer In".

3. You can select all parts of the same type, for instance all FL-T200 tanks. You can do this by alt-shift-clicking on a part. As usual, this combines with Ctrl to modify rather than replace the current selection. In the image below, I was able to select all the fuel tanks in my main engine nacelles with a single click. You can also combine it with alt-clicking to select all tanks of a particular type on a particular ship. For instance, shift-alt-click to select all FL-T200 tanks and then ctrl-alt-click to unselect ships you don't want.

select3.png

4. Miscellaneous features: 1) You can now sort and group the part list. This may combine well with range selection (i.e. click, shift-click) to choose the biggest, smallest, emptiest, or fullest tanks, etc. 2) I added an option (off by default) to make the resource selector behave like a normal tab control, where clicking one tab "closes" the others, so only one resource is shown at once. 3) I made parts with Highlight active show "H" in the box so they're easier to find and unhighlight. 4) I added shorter and friendlier names for the resource types, to allow smaller windows and/or reduce the need for horizontal scrolling on ships with many resources.

misc.png

Note: Although it appears you can only sort by one column, the sort control actually allows sorting by multiple columns (i.e grouping and sorting). For instance, if you want to group by ship and sort by name within each group, you first sort by name and then sort by ship. (Basically, if you want to sort by columns X and then Y, choose them in reverse order, i.e. Y and then X, from the menu.)

5. I added experimental support for remembering settings when you switch between ships. It doesn't remember after you quit the game, only in the same session. Also, changes (e.g. balancing) will only be processed for the current ship, though it might be possible to process them for other ships as well if enough people want that.

6. I added support for transferring liquid fuel and oxidizer in the correct 9:11 proportions. This is implemented as a pseudo-fuel type called "Rocket" fuel, which only shows parts that support both liquid fuel and oxidizer. It should work as expected as long as the liquid fuel and oxidizer are roughly balanced in those fuel tanks, but if they're unbalanced it may behave unintuitively. For instance, if one tank has only liquid fuel and another has only oxidizer, both will show as being empty (because neither has any rocket fuel), and attempting to balance them will achieve nothing because both are "empty". To correct this, just balance your liquid fuel and oxidizer individually, and from then on you can use the "rocket" fuel tab as you'd expect. (Implementing this required rewriting all the balancing code, so it was a risky change, but I think I did it correctly.)

7. Finally, I fixed the bug that caused electricity to be dumped into engines and wasted.

nomoalts.png

The image above shows the bug I'm talking about. The engines, in red, will never fill up and will just absorb all your energy if you use "Balance All" or "Transfer Out". I fixed this by removing the engines from the ElectricCharge list, since they're not actually storing electrical charge. (Internally they have an electric charge resource due to the alternator, but it doesn't work like a battery.)

The changes have now been incorporated into the official build. See here.

Edited by AdamMil
Link to comment
Share on other sites

if anybody is interested. Let me know if you find any problems!

While the ability to select more than one tank at a time, I did run into an issue. When I crashed a ship into the ground and it gets completely obliberated, I get spammed with this error:

Edit: Actually, when the core part or maybe the command module gets destroyed.


ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index
at System.Collections.Generic.List`1[Part].get_Item (Int32 index) [0x00000] in <filename unknown>:0

at Tac.FuelBalanceController.ComputeShipIds (.Vessel vessel) [0x00000] in <filename unknown>:0

at Tac.FuelBalanceController.RebuildLists (.Vessel vessel) [0x00000] in <filename unknown>:0

at Tac.FuelBalanceController.FixedUpdate () [0x00000] in <filename unknown>:0

Edited by smjjames
Link to comment
Share on other sites

I did run into an issue. When I crashed a ship into the ground and it gets completely obliberated, I get spammed with this error...
Hi smjjames, Thank you for reporting that. The error occurs when a ship has no parts in it (which I didn't think was possible), which matches your description of it occurring when a ship is completely destroyed. Anyway, that should be fixed now. I also made it stop highlighting selected parts after the window is closed.
Mate, thank you for sharing this.
No problem. I hope it helps! Edited by AdamMil
Link to comment
Share on other sites

  • 2 weeks later...
Hi smjjames, Thank you for reporting that. The error occurs when a ship has no parts in it (which I didn't think was possible), which matches your description of it occurring when a ship is completely destroyed. Anyway, that should be fixed now. I also made it stop highlighting selected parts after the window is closed.

No problem. I hope it helps!

Were your changes ever incorporated? It doesn't look like it.

Link to comment
Share on other sites

Were your changes ever incorporated? It doesn't look like it.
TaranisElsu seems to have disappeared. :-P He hasn't been in the forums for a long time, and he didn't reply to my message either. EDIT: I just checked and he posted recently to say "I am still around. Been busy with other things though..."
Link to comment
Share on other sites

... Anyway, that should be fixed now...
Were your changes ever incorporated? It doesn't look like it.
On the other hand, if you're referring to the thing I said "should be fixed now", then that should have been incorporated into my own version, just not the official version. (The download link for my version is in the big post a few comments back.) If see any problems in my version, let me know! :-)
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...