Jump to content

[1.9–⁠1.12] SmartTank v0.5.0


HebaruSan

Recommended Posts

49 minutes ago, HebaruSan said:

Ahh OK, yes, SmartTank disables the ability to edit the fuel levels when it's auto-managing a procedural tank's size. Specifically, it sets PartResource.isTweakable = false and fills the tank (but the resource is still in the tank, just not editable):

https://github.com/HebaruSan/SmartTank/blob/d333376944d859f78b9637f01378f2021abb6d9e/src/SmartTankPart.cs#L348-L363

This is because it needs to be able to increase and decrease the mass of the tank to fit the target TWR, and editing of the fuel levels was messing that up.

What problems is this causing exactly?

Two issues:

  1. At a basic level, being able to create a tank and then empty it can be useful if, for example, you are trying to assemble a large vessel in orbit, and plan on filling up the tanks in orbit because they would be too heavy to lift while full.
  2. The ability to empty a tank in the editor is useful when working on the CoM in the editor, for, among other things, balancing RCS, adjusting the CoM's position vs the CoL, etc

My mod, Fill It Up, is designed to adjust fuel levels in the editor so a player can design an airplane's CoM properly,. It can't work if it it can't adjust the fuel levels

Link to comment
Share on other sites

1 hour ago, HebaruSan said:

This is because it needs to be able to increase and decrease the mass of the tank to fit the target TWR, and editing of the fuel levels was messing that up.

Regarding this, if you only change the mass of the tanks when they are resized, i don't' think it would be a problem to always fill them up if they are resized

1 hour ago, HebaruSan said:

This is because it needs to be able to increase and decrease the mass of the tank to fit the target TWR, and editing of the fuel levels was messing that up.

Regarding this, if you only change the mass of the tanks when they are resized, i don't' think it would be a problem to always fill them up if they are resized.

So really, the simple solution would be to always reset the tanks when a part is added or removed from the vessel

1 hour ago, HebaruSan said:

This is because it needs to be able to increase and decrease the mass of the tank to fit the target TWR, and editing of the fuel levels was messing that up.

Regarding this, if you only change the mass of the tanks when they are resized, i don't' think it would be a problem to always fill them up if they are resized.

So really, the simple solution would be to always reset the tanks when a part is added or removed from the vessel

1 hour ago, HebaruSan said:

This is because it needs to be able to increase and decrease the mass of the tank to fit the target TWR, and editing of the fuel levels was messing that up.

Regarding this, if you only change the mass of the tanks when they are resized, i don't' think it would be a problem to always fill them up if they are resized.

So really, the simple solution would be to always reset the tanks when a part is added or removed from the vessel

Link to comment
Share on other sites

14 minutes ago, linuxgurugamer said:
  1. At a basic level, being able to create a tank and then empty it can be useful if, for example, you are trying to assemble a large vessel in orbit, and plan on filling up the tanks in orbit because they would be too heavy to lift while full.

In that case the user can indicate that intention by disabling the auto-scaling for that tank (wouldn't make sense not to), so I'd consider this already accounted for. Turning on (/leaving on) auto-scaling is asking SmartTank to manage the size of the tank for you, which doesn't make sense for a big empty tank to be filled later (how could it possibly guess how much empty space you want?).

14 minutes ago, linuxgurugamer said:
  1. The ability to empty a tank in the editor is useful when working on the CoM in the editor, for, among other things, balancing RCS, adjusting the CoM's position vs the CoL, etc

My mod, Fill It Up, is designed to adjust fuel levels in the editor so a player can design an airplane's CoM properly,. It can't work if it it can't adjust the fuel levels

Doesn't RCSBuildAid manage to do that without actually emptying the tanks?

Link to comment
Share on other sites

1 hour ago, HebaruSan said:

This is because it needs to be able to increase and decrease the mass of the tank to fit the target TWR, and editing of the fuel levels was messing that up.

Regarding this, if you only change the mass of the tanks when they are resized, i don't' think it would be a problem to always fill them up if they are resized.

So really, the simple solution would be to always reset the tanks when a part is added or removed from the vessel

6 minutes ago, HebaruSan said:

In that case the user can indicate that intention by disabling the auto-scaling for that tank (wouldn't make sense not to), so I'd consider this already accounted for. Turning on (/leaving on) auto-scaling is asking SmartTank to manage the size of the tank for you, which doesn't make sense for a big empty tank to be filled later (how could it possibly guess how much empty space you want?).

If I want to assemble a vessel in space with a specific TWR, I'd want to use the mod to create the tank, but then to be able to empty it for the launch (the tank being launched by other tanks, rockets, etc)  Adding the ability to lock a tank in it's current configuration would really be all that's necessary, once locked, the fuel could then be adjusted without affecting the mod

 

Link to comment
Share on other sites

9 minutes ago, linuxgurugamer said:

Regarding this, if you only change the mass of the tanks when they are resized, i don't' think it would be a problem to always fill them up if they are resized.

So really, the simple solution would be to always reset the tanks when a part is added or removed from the vessel

But if the user has requested SmartTank to ensure a TWR of 1.5 for a procedural tank's stage, then they inherently need to be resized/filled anytime the TWR diverges from 1.5. Which happens when you change the fuel levels, since removing fuel reduces mass and increases TWR. I think that was the original problem that led to this approach, trying to auto-size a partially filled tank is just an incoherent concept, so disabling isTweakable gives the user a clue that they shouldn't attempt it.

Link to comment
Share on other sites

12 minutes ago, HebaruSan said:

But if the user has requested SmartTank to ensure a TWR of 1.5 for a procedural tank's stage, then they inherently need to be resized/filled anytime the TWR diverges from 1.5. Which happens when you change the fuel levels, since removing fuel reduces mass and increases TWR. I think that was the original problem that led to this approach, trying to auto-size a partially filled tank is just an incoherent concept, so disabling isTweakable gives the user a clue that they shouldn't attempt it.

Not arguing with that.  I'm suggesting one of two solutions:

Have the ability to lock a tank to the current setting, this might already be there using the current buttons

Have ST always fill the tanks when doing the calculations.  I believe you only do the calculations when something is changed,  and that is fine by me.  

I saw that you can change the tank setting from the automatch to a simple match, which then makes all the fuel available.  The problem I see is that if someone has multiple tanks on a vessel, then they would have to modify each tank in order to do the balance, would be nice if there was a way to simply disable the autosizing functionality from the ST dialog

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

The problem I see is that if someone has multiple tanks on a vessel, then they would have to modify each tank in order to do the balance, would be nice if there was a way to simply disable the autosizing functionality from the ST dialog

Yeah, that makes sense. Let me think about that for a while.

I'm guessing you'd also want something programmatic that mods could invoke, so your users wouldn't have to click two different buttons in two dialogs?

Link to comment
Share on other sites

31 minutes ago, HebaruSan said:

Yeah, that makes sense. Let me think about that for a while.

I'm guessing you'd also want something programmatic that mods could invoke, so your users wouldn't have to click two different buttons in two dialogs?

That would be a nice addition, but it doesn't have to be anything special  Just have a public function which can enable/disable the functionality for all the tanks, I'll either use reflection to get a reference to it or just make it a compile-time dependency, which is easier than the Reflection

Link to comment
Share on other sites

Having taken a look at the screenshot from the FillItUp thread, it looks like the complaint is something else:

nz9vBZc.png

The user has "Auto fit to TWR" turned off and the fuel amounts are visible, so SmartTank isn't interfering with the fuel resources in the way we've been assuming up to this point. I can still look into adding a global toggle at some point, but I don't think that will address the issue that Craze is having.

EDIT: Never mind, clarified by video posted on the other thread. Thanks.

Edited by HebaruSan
Link to comment
Share on other sites

SmartTank v0.2.1 is released!

The above bug report turned out to be about something else, but during @linuxgurugamer's stream I saw him attach a 1.875m engine and get a 2.5m tank diameter. Now we work around the broken data model behind this to figure out when a size=2 attach node is actually 1.875m.

https://github.com/HebaruSan/SmartTank/releases/tag/v0.2.1

Link to comment
Share on other sites

Just now, Craze said:

And you did not think to make adjustment of a tank not only under TWR but also for Delta-V ?

That has been suggested:

I have thought about ways to implement it, but have not found any that are workable. While it is common to have a particular target delta V for a given part of a mission, just adding more fuel to get more delta V isn't a good idea, as it can result in an impractically low TWR, and the logarithm in the rocket equation would result in extremely large tanks in some cases. By contrast, adding and removing fuel is quite effective in producing a desired TWR.

DStaal's protest aside, building to TWR just makes more sense. TWR determines whether you can lift off the pad, TWR determines whether you can get to orbit before you start falling back, TWR determines whether your transfer burn is 1 minute or 100 minutes. If your ship lacks delta V, you can add stages; if it lacks TWR, you're not going anywhere. So for the foreseeable future, this mod will continue to treat TWR as the independent variable and delta V as the dependent variable.

Link to comment
Share on other sites

10 minutes ago, HebaruSan said:

That has been suggested: 

I have thought about ways to implement it, but have not found any that are workable. While it is common to have a particular target delta V for a given part of a mission, just adding more fuel to get more delta V isn't a good idea, as it can result in an impractically low TWR, and the logarithm in the rocket equation would result in extremely large tanks in some cases. By contrast, adding and removing fuel is quite effective in producing a desired TWR.

DStaal's protest aside, building to TWR just makes more sense. TWR determines whether you can lift off the pad, TWR determines whether you can get to orbit before you start falling back, TWR determines whether your transfer burn is 1 minute or 100 minutes. If your ship lacks delta V, you can add stages; if it lacks TWR, you're not going anywhere. So for the foreseeable future, this mod will continue to treat TWR as the independent variable and delta V as the dependent variable. 

Understood. In interplanetary flights, it is often necessary to have a stage with a certain amount of Delta-V. I just thought about it.

Link to comment
Share on other sites

5 hours ago, HebaruSan said:

SmartTank v0.2.1 is released!

The above bug report turned out to be about something else, but during @linuxgurugamer's stream I saw him attach a 1.875m engine and get a 2.5m tank diameter. Now we work around the broken data model behind this to figure out when a size=2 attach node is actually 1.875m.

https://github.com/HebaruSan/SmartTank/releases/tag/v0.2.1

I thought that the 1.875 was shown as a size1p5 tank?  At least, that's what I'm seeing in al the 1.875 tanks in the expansion

Also, what about the other thing we discussed, being able to temporarily lock all the procedural tanks sizes while adjusting balance, etc.

Link to comment
Share on other sites

3 hours ago, linuxgurugamer said:

I thought that the 1.875 was shown as a size1p5 tank?  At least, that's what I'm seeing in al the 1.875 tanks in the expansion

If you click the above link for the broken data model, it might shed some light on this.

3 hours ago, linuxgurugamer said:

Also, what about the other thing we discussed, being able to temporarily lock all the procedural tanks sizes while adjusting balance, etc.

Not done yet, obviously.

Link to comment
Share on other sites

1 hour ago, HebaruSan said:

If you click the above link for the broken data model, it might shed some light on this.

Oh, I see.   

1 hour ago, HebaruSan said:

Not done yet, obviously

Sorry, I said it badly.  Are you planning on doing that change?

Also, on a different note, while I understand your reasoning regarding having the problem solved for TWR,  I think that most people look more at the dV available in a stage rather than TWR, especially if it isn't the first stage.  Now, I'm not saying that TWR isn't important, but it is only important when launching or landing on a planet.  When in space, as long as the TWR is somewhat reasonable, I build for dV.

Link to comment
Share on other sites

27 minutes ago, linuxgurugamer said:

Also, on a different note, while I understand your reasoning regarding having the problem solved for TWR,  I think that most people look more at the dV available in a stage rather than TWR, especially if it isn't the first stage.  Now, I'm not saying that TWR isn't important, but it is only important when launching or landing on a planet.  When in space, as long as the TWR is somewhat reasonable, I build for dV.

Honestly, even when taking off/landing, as long as the TWR is somewhat reasonable I build for dV.  ('Somewhat reasonable' here usually being 'greater than 1.05' or something similar.)  And in space... Well, a 2-hour burn is can be somewhat reasonable at max physics timewarp.

Link to comment
Share on other sites

34 minutes ago, linuxgurugamer said:

Sorry, I said it badly.  Are you planning on doing that change?

Yes, I agree that it's a good idea. I wanted to do a quick bug fix release for the 1.875m issue first because it didn't require making design decisions.

Quote

as long as the TWR is somewhat reasonable

15 minutes ago, DStaal said:

as long as the TWR is somewhat reasonable

Exactly. That's what this mod is for.

Link to comment
Share on other sites

  • 2 weeks later...

SmartTank v0.3.0 is released!

There are no visible changes when used by itself, but a new API is provided that allows other mods to pause SmartTank's automatic resizing of tanks, as per @linuxgurugamer's suggestion. When this happens, a depressed pause button appears near the SmartTank icon, which you can click to unpause:

HUfTTJd.png

https://github.com/HebaruSan/SmartTank/releases/tag/v0.3.0

Link to comment
Share on other sites

35 minutes ago, HebaruSan said:

SmartTank v0.3.0 is released!

There are no visible changes when used by itself, but a new API is provided that allows other mods to pause SmartTank's automatic resizing of tanks, as per @linuxgurugamer's suggestion. When this happens, a depressed pause button appears near the SmartTank icon, which you can click to unpause:

HUfTTJd.png

https://github.com/HebaruSan/SmartTank/releases/tag/v0.3.0

The mod Fill It Up: 

will have this implemented in the next release (probably this evening)

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...