allista

[1.4.5] Configurable Containers

Recommended Posts

@allista I need help in creating a compatiblity patch for Kerbalism.
https://github.com/Gordon-Dry/Kerbalism/blob/Support-for-ConfigurableContainers/GameData/Kerbalism/Support/ConfigurableContainers.cfg

I don't see a documentation for CC and trying by error already was a waste of time last night.

How do I calculate the values for
PossibleResources in TankType
and
Volume in TANKCONF\TANK ?

Each time I changed values after comparing them in VAB and rebooting KSP the result was counter-productive.

Share this post


Link to post
Share on other sites

This is really weird....

Is "Volume" a relative percentage to the whole tank contents? Like "LFO" says LiquidFuel: 45, Oxizizer: 55 - which sums up to 100.
But other configs, like "TAC Life Support", say Food: 0.5255531 - Water: 0.2639998 - Oxygen: 0.2104471

This makes it not easy to understand the approach of CC, how does it work?

Compare the "duration" in the Kerbalism readouts posted below.
 

Assuming that the TANKCONF volume percentages are liters, this config is used:

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
	name = KerbalismSupplies
	TANK
	{
		TankType = Food
		CurrentResource = Food
		InitialAmount = 1
		// 6.29 Litres/day - 1.7676727863247874 kg/day
		Volume = 72.2158438576349
	}
	TANK
	{
		TankType = Water
		CurrentResource = Water
		InitialAmount = 1
		// 2.42 Litres/day - 2.42 kg/day
		Volume = 27.7841561423651
	}
	// total 8.71 Liters/day = 100%
}

which results in
TNd7dyk.pngAOtHZZD.png

Assuming it's kg, this config is used:

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
	name = KerbalismSupplies
	TANK
	{
		TankType = Food
		CurrentResource = Food
		InitialAmount = 1
		// 6.29 Litres/day - 1.7676727863247874 kg/day
		Volume = 42.2113397230385
	}
	TANK
	{
		TankType = Water
		CurrentResource = Water
		InitialAmount = 1
		// 2.42 Litres/day - 2.42 kg/day
		Volume = 57.7886602769615
	}
	// total 4.1876727863247874 kg/day = 100%
}

which results in
0DTaNRw.pngwuvh6V8.png

Do you see what the problem is?
It's confirmed that the consumption ratios are correct, so why can't I manage it to have the duration for Food And Water balanced out?

Share this post


Link to post
Share on other sites

@Gordon Dry I can see one relationship in those numbers, water storage in the planner seems to 3.75 times the value of the volume in both your configs ??

Share this post


Link to post
Share on other sites

@PiezPiedPy You're right, this is really weird - and not my fault. When I enter value X I assume to see value X ...

Share this post


Link to post
Share on other sites

I did a little comparision of ThunderAerospace\TacLifeSupport\LifeSupport.cfg

TACLSGlobalSettings
{
	...
    
	FoodConsumptionRate = 1.6927083333E-05
	WaterConsumptionRate = 1.1188078704E-05
	OxygenConsumptionRate = 0.001713537562385
	
    ...
    }

with ConfigurableContainers\TankConfigs.cfg

...

TANKCONF:NEEDS[TacLifeSupport]
{
    name = TAC Life Support
    TANK
    {
        TankType = Food
        CurrentResource = Food
        InitialAmount = 1
        Volume = 0.5255531
    }
    TANK
    {
        TankType = Water
        CurrentResource = Water
        InitialAmount = 1
        Volume = 0.2639998
    }
    TANK
    {
        TankType = Gases
        CurrentResource = Oxygen
        InitialAmount = 1
        Volume = 0.2104471
    }
}

...

and made a little spreadsheet out of it:

  liters % liters density kg % kg
Food 0.000016927083333 0.971897732288598 0.00028102905982906 0.00000475700231472114 25.9079491042561
Water 0.000011188078704 0.642382866981302 0.001 0.000011188078704 60.9333682139768
Oxygen 0.001713537562385 98.3857194007301 0.00000141 0.00000241608796296285 13.1586826817671
  0.001741652724422 100.0   0.000018361168981684 100.0
           
           
  kg % kg density liters % liters
Food 0.000016927083333 0.971897732288598 0.00028102905982906 0.0000602325017323694 0.00495599504033295
Water 0.000011188078704 0.642382866981302 0.001 0.000011188078704 0.000920567151838565
Oxygen 0.001713537562385 98.3857194007301 0.00000141 1.21527486693972 99.9941234378079
  0.001741652724422 100.0   1.21534628752015 100.0

 

It doesn't matter if I assume liters and make kg out of it or vice versa, the result does not fit the tank config.

  • Like 1

Share this post


Link to post
Share on other sites

@allista so I managed it to create a working config.

What confused me is that I have to take densities into account, though these are defined in either CRP and also inside the TANKTYPES.

Also I have to assume a pressure / utilization of a gas and put this into my calculation.
(this one should be integral part of CRP itself, not just a "common interpretation")

I mean, all these values exist, but I have to put them into my calculation manually... this is what I don't understand.
And finally I stumbled upon the fact that MonoPropellant has a stock density of 0.004, but CC makes it 0.00368.

  • Like 1

Share this post


Link to post
Share on other sites

@Beetlecatyes my post was off the top of my head and not tested at all.  However with that said. I believe I did get a working copy made.  I will have to go back and dig into my old installs and see if I can get it for you.

Edited by Bit Fiddler
  • Like 1

Share this post


Link to post
Share on other sites
On 7/18/2018 at 3:30 PM, Gordon Dry said:

@allista I need help in creating a compatiblity patch for Kerbalism.
https://github.com/Gordon-Dry/Kerbalism/blob/Support-for-ConfigurableContainers/GameData/Kerbalism/Support/ConfigurableContainers.cfg

I don't see a documentation for CC and trying by error already was a waste of time last night.

How do I calculate the values for
PossibleResources in TankType
and
Volume in TANKCONF\TANK ?

Each time I changed values after comparing them in VAB and rebooting KSP the result was counter-productive.

I had a similar discussion when I wanted to add compatibility for another mod to CC. If you screen back aways you might detect the frustration I had.

Share this post


Link to post
Share on other sites

Version 2.4.3.2 for Kerbal Space Program 1.4.5

Released on 2018-08-31

  • Recompiled against KSP-1.4.5
  • Added Machinery to Components tank type when Ground Construction is installed.

 Download 

  • Like 1

Share this post


Link to post
Share on other sites
On 7/19/2018 at 5:23 PM, Gordon Dry said:

@allista so I managed it to create a working config.

What confused me is that I have to take densities into account, though these are defined in either CRP and also inside the TANKTYPES.

Also I have to assume a pressure / utilization of a gas and put this into my calculation.
(this one should be integral part of CRP itself, not just a "common interpretation")

I mean, all these values exist, but I have to put them into my calculation manually... this is what I don't understand.
And finally I stumbled upon the fact that MonoPropellant has a stock density of 0.004, but CC makes it 0.00368.

Fair point.

The thing is, back when I was making the whole CC system, the PartResourceDefinition (the stock representation of a resource) did not have all these fancy attributes; only the mass-per-unit and cost-per-unit were available. Thus I was forced to recalculate everything using real-life volumes of the containers and densities of the resources.

It was never easy to calculate proper values. Parts are (still) configured to have particular amounts of resources, not to have useful volume; so even now, when a resource formally have a volume-per-unit attribute, it's not taken into account. The mono-propellant problem? Try to calculate MP density from sock part volumes and corresponding MP amounts stored there and you'll see that they don't agree by a ton. So I also had to spent much of the time to balance things together; even to write a whole python library and a dedicated script to do the calculations en masse.

I would consider reimplementing the core system, if not for the fact that 1) it works as it is and 2) I have too little time for KSP these days (and won't have much more, I'm afraid, in foreseeable future), and too many new things to do. So the priority of remaking something that works (and is more-or-less easy to maintain) is obviously low.

On 7/19/2018 at 1:40 AM, Gordon Dry said:

I did a little comparision of ThunderAerospace\TacLifeSupport\LifeSupport.cfg

with ConfigurableContainers\TankConfigs.cfg


It doesn't matter if I assume liters and make kg out of it or vice versa, the result does not fit the tank config.

This tank config is a community's contribution that I have included into CC.

It would seems that TAC-LC balance/configs have changed since.

You're free to make corrections and contribute them as well.

I'm sure everyone'll appreciate it!

  • Like 1

Share this post


Link to post
Share on other sites

Don't work there no 'Edit Tanks' button on procedural parts & stock fuel tanks, I think not worked on RealFuels mod or outdated, I removed RealFuels mod back normal & edit tanks on stock fuel tanks worked fine.

Share this post


Link to post
Share on other sites
On 9/1/2018 at 3:53 AM, Darks :v said:

Hi, i want to know if there are a way to install Interstellar fuel switch with this mod

I've recently answered this (pretty frequent question, as you can guess), but can't find it, so:

IFS and CC both manage part resources dynamically, but do it differently, and cannot be made to cooperate (or even be aware of each other).

So if you have one part with IFS and another with CC, it's alright. The problem is when MM adds both IFS and CC to the same part. And that's exactly what happens, because both mods included MM patches to modify stock fuel tanks (and many other as well).

So you can use IFS/CC dlls to add their functionality to dedicate parts. But you can't install both complete mods.

Share this post


Link to post
Share on other sites

Hei @allista, KSP 1.5.1, symmetry bigger then x2 cannot be applied to parts, affected by Configurable Containers , parts will be displayed as symmetry x1 and cannot be placed. 

Edited by siderr
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, siderr said:

Hei @allista, KSP 1.5.1, symmetry bigger then x2 cannot be applied to parts, affected by Configurable Containers , parts will be displayed as symmetry x1 and cannot be placed. 

Thanks for the report.

Although 1.5.1 is not officially supported yet, I'll test this when I'll be upgrading everything.

  • Like 2

Share this post


Link to post
Share on other sites

@allista I believe you already noticed #PR 30 (aka Update SnacksLS support), but without pushing I wanted to ask the community about feedback. I just noticed the way we implented the Snacks support is only fitting CC but not correct because Snacks and Soil have the same cost and weight.
The numbers might just not be exact but I was guessing from the other life support systems to align with so this is "ok" for now.

I hope @Angel-125 doesn't mind I work on this implention for CC which makes using more reliable (e.g. lesser parts in KSP lesser problems in KSP).

Regards

  • Like 1

Share this post


Link to post
Share on other sites

@allista, I've encountered the same bug @siderr reported back in October. Here's some additional information (sadly, my output_log.txt got overwritten in the meantime).

Quote

Occasionally when trying to radially attach a part in the VAB, it simply stops working beyond 2x symmetry. That is, no symmetry, mirror and 2x radial work properly but at 3x radial and above, the ghosted preview of the parts does not appear, no parts get placed when clicking and the framerate chugs down. It happens both when the part itself is being radially attached and when the part is being attached via node to a radially attached part.

About half an hour ago, it happened again, but only to fuel tanks. Landing legs worked fine even at 12x radial, but whenever I picked up a fuel tank and hovered it near another part for radial attachment, no ghost, no placement and framerate tanked. Alt-clicking to copy a placed part also stopped working. Yet if I mount said fuel tank on a radial decoupler, grab the decoupler and increase symmetry level, it works just fine! Console window showed ArgumentOutOfRangeException spam sandwiched between rapid-fire "ship changed, auto-updating my stuff" log entries from ShipSections and BetterCrewAssignment, which also appears in output_log.txt with the following stack trace:

  Quote

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[PartResource].get_Item (Int32 index) [0x00000] in <filename unknown>:0 
  at DictionaryValueList`2[System.Int32,PartResource].At (Int32 index) [0x00000] in <filename unknown>:0 
  at PartResourceList.get_Item (Int32 index) [0x00000] in <filename unknown>:0 
  at Part.OnCopy (.Part original, Boolean asSymCounterpart) [0x00000] in <filename unknown>:0 
  at EditorLogic.createSymmetry (Int32 mode, .Attachment attach) [0x00000] in <filename unknown>:0 
  at EditorLogic.<SetupFSM>m__D () [0x00000] in <filename unknown>:0 
  at (wrapper delegate-invoke) Callback:invoke_void__this__ ()
  at (wrapper delegate-invoke) Callback:invoke_void__this__ ()
  at (wrapper delegate-invoke) Callback:invoke_void__this__ ()
  at KerbalFSM.UpdateFSM () [0x00000] in <filename unknown>:0 
  at EditorLogic.Update () [0x00000] in <filename unknown>:0 

Exiting and reentering the VAB didn't fix it.

Hope this helps in splatting this bug down the line. Uninstalling the addon fixed it and since @siderr reported the exact same issue and I didn't have any other addons installed that mess with part resources, I'm guessing Configurable Containers is the culprit.

Share this post


Link to post
Share on other sites

Hey @allista, I know its not supported yet but just wanted to report that the symmetry bug is still present in 1.6. Cheers, hope you had a good holiday!

  • Like 1

Share this post


Link to post
Share on other sites

hello, thanks for the job

can you try too had cryotanks by Nertea???

Share this post


Link to post
Share on other sites

hey @allista i found some minor issues in your part patches

Quote

[WRN 2019-01-30 00:01:23.666] 44 warnings related to GameData/ConfigurableContainers/Parts/FuelTanksPlus_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 33 warnings related to GameData/ConfigurableContainers/Parts/KWRocketry_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 10 warnings related to GameData/ConfigurableContainers/Parts/Mk2Expansion_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 24 warnings related to GameData/ConfigurableContainers/Parts/Mk3Expansion_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 14 warnings related to GameData/ConfigurableContainers/Parts/ModRocketSys_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 52 warnings related to GameData/ConfigurableContainers/Parts/MunarIndustries_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 18 warnings related to GameData/ConfigurableContainers/Parts/NearFuturePropulsion_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 10 warnings related to GameData/ConfigurableContainers/Parts/RaginCaucasian_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 12 warnings related to GameData/ConfigurableContainers/Parts/SpaceY-Expanded_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 9 warnings related to GameData/ConfigurableContainers/Parts/SpaceY-Lifters_Patch.cfg
[WRN 2019-01-30 00:01:23.666] 36 warnings related to GameData/ConfigurableContainers/Parts/SPS_Patch.cfg

Quote

[WRN 2019-59-29 23:59:13.861] more than one :NEEDS tag detected, ignoring all but the first: ConfigurableContainers/Parts/KWRocketry_Patch/@PART[KW2mtankPancake]:HAS[!MODULE[InterstellarFuelSwitch],!MODULE[FSfuelSwitch],!MODULE[ModuleB9PartSwitch]]:NEEDS[!modularFuelTanks&!RealFuels]:NEEDS[KWRocketry]:AFTER[KWRocketry]

 

Share this post


Link to post
Share on other sites

I just discovered another fault...I know this mod is not supported/released for it, I'm running ksp 1.6.1...I love the configurable containers mod, and I too have seen the symmetry isse (note when I try greater than 2x, the mirrored parts seem to be offset in the wrong direction,,,they appear "in the floor of the VAB") it also breaks the per stage delta-v information, and the burn time calcs as well (the burn "bar" next to the nav ball is always red, even with full tanks and a short burn).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now