Skip to content

Commit

Permalink
Support for ConfigurableContainers (#149)
Browse files Browse the repository at this point in the history
* ConfigurableContainers support

Needs further testing.
Goal:
Have proper balanced amounts of Kerbalism resources as tank type and tank config presets in ConfigurableContainers.

* yeah, ofc

* Still fiddling

* Typo and fiddling

* And just more fiddling

* CHANGELOG

* fiddling ...

* fiddling ...

The logic of CC is so weird, I should ask Allista about that ...

* New day, new approach

* Added tank config for LH/O2 fuel cell

* Let that go

* forgot those

* Kilograms!

* tab intend

* Now it's this and stil ...

https://forum.kerbalspaceprogram.com/index.php?/topic/150104-143-configurable-containers/&do=findComment&comment=3417870

* A max. of 14 decimal places?

wonky wonky

* Another try in the weirdness

* Because nothing better to do

* Coming nearer, Food and Water are balanced

* Bring this back

* Monoprop is heavier

That value is not the stock resource value of 0.004 because CC decided to change the density.
I just use that density.

* some tab intend

* balance out water to food
  • Loading branch information
Gordon-Dry authored and steamport committed Jul 19, 2018
1 parent 68a93b9 commit 0aa592b
Show file tree
Hide file tree
Showing 2 changed files with 175 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

### Changes since the last release

* Added support for ConfigurableContainers, they now have 6 additional tank configs:
KerbalismSupplies (Food, Water) - KerbalismBreathing (Oxygen, Nitrogen)
KerbalismWaste (Waste, WasteWater) - KerbalismGreenhouse (CarbonDioxide, Ammonia, Water)
KerbalismFuelcellH2 (Oxygen, Hydrogen) - KerbalismFuelcellMP (Oxygen, MonoPropellant) (Gordon Dry)
* Containers have had their volume and mass calculated with a calculator (PiezPiedPy)
* Science labs can now reset experiments (PiezPiedPy)
* CryoTanks are now simulated in the background also fuel boiloff is simulated in the planner (PiezPiedPy)
Expand Down
171 changes: 171 additions & 0 deletions GameData/Kerbalism/Support/ConfigurableContainers.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
@TANKTYPE[Gases]:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]:FOR[Kerbalism]
{ @PossibleResources ^= :$: Oxygen 282; CarbonDioxide 390.2; Nitrogen 250.2; Ammonia 153.8; Hydrogen 17.98;: } //cfd; same pressure as Xenon

// Uraninite and EnrichedUranium??

TANKTYPE:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = Waste
UsefulVolumeRatio = 1
TankCostPerSurface = 2 //pressurized
PossibleResources = Waste 0.75; WasteWater 1.005; //1t/m3
}

TANKTYPE:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = Food
UsefulVolumeRatio = 0.95 //cargo needs additional fixation and compartmetalization
TankCostPerSurface = 2 //pressurized
AddMassPerVolume = 0.003
PossibleResources = Food 0.28102905982906;
}

TANKTYPE:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = Water
UsefulVolumeRatio = 0.95 //to balance out with Food
TankCostPerSurface = 2 //pressurized
AddMassPerVolume = 0.003
PossibleResources = Water 1; //cfd
}

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = KerbalismSupplies
TANK
{
TankType = Food
CurrentResource = Food
InitialAmount = 1
// 6.29 Litres/day /0.28102905982906 = 22.38202698264010025302187160734
Volume = 90.2427329762448
}
TANK
{
TankType = Water
CurrentResource = Water
InitialAmount = 1
// 2.42 Litres/day /1 = 2.42
Volume = 9.75726702375516
}
// total 24.80202698264010025302187160734 = 100%
}

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = KerbalismBreathing
TANK
{
TankType = Gases
CurrentResource = Oxygen
InitialAmount = 1
// 595.728 Litres/day /282 = 2112.51063829787
Volume = 87.486554702392983298549317968189
}
TANK
{
TankType = Gases
CurrentResource = Nitrogen
InitialAmount = 1
// (assuming constant usage to have a relative value, then divided by ) 7560 Litres/(day) /250.2 = 30215.8273381295
// divided by 100 because that much is not needed = 302.158273381295
Volume = 12.51344529760701670145068203182
}
// total 2414.668911679165 = 100%
}

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = KerbalismWaste
TANK
{
TankType = Waste
CurrentResource = Waste
InitialAmount = 0
// 2.360016 Litres/day /0.75 = 3.146688
Volume = 56.7675965575375
}
TANK
{
TankType = Waste
CurrentResource = WasteWater
InitialAmount = 0
// 2.4084 Litres/day /1.005 = 2.39641791044776
Volume = 43.2324034424625
}
// total 5.54310591044776 = 100%
}

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = KerbalismGH
TANK
{
TankType = Gases
CurrentResource = CarbonDioxide
InitialAmount = 1
// 109.0854 Litres/day /390.2 = 279.562788313685 (one unit of crop)
Volume = 46.3754075966202
}
TANK
{
TankType = Gases
CurrentResource = Ammonia
InitialAmount = 1
// 49.464 Litres/day /153.8 = 321.612483745123 (one unit of crop)
Volume = 53.3508415472882
}
TANK
{
TankType = Water
CurrentResource = Water
InitialAmount = 1
// 1.65024 Litres/day /1 = 1.65024 (one unit of crop)
Volume = 0.273750856091673
}
// total 602.825512058809 = 100%
}

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = KerbalismFuelcellH
TANK
{
TankType = Gases
CurrentResource = Oxygen
InitialAmount = 1
// 10942.48961208 Litres/day /282 = 38803.1546527659
Volume = 3.1255707580113
}
TANK
{
TankType = Gases
CurrentResource = Hydrogen
InitialAmount = 1
// 21624.02544672 Litres/day /17.98 = 1202671.04820467
Volume = 96.8744292419887
}
// total 1241474.20285744 = 100%
}

TANKCONF:NEEDS[Kerbalism,ProfileDefault,ConfigurableContainers]
{
name = KerbalismFuelcellM
TANK
{
TankType = Gases
CurrentResource = Oxygen
InitialAmount = 1
// 11029.37361678 Litres/day /282 = 39111.2539602128
Volume = 99.9864761473628
}
TANK
{
TankType = LiquidChemicals
CurrentResource = MonoPropellant
InitialAmount = 1
// 19.4674346757 Litres/day /3.68 = 5.29006377057065
Volume = 0.0135238526372043
}
// total 39116.5440239833 = 100%
}

0 comments on commit 0aa592b

Please sign in to comment.