Jump to content

[dead] CELSS Greenhouse (TAC Life Support Add-On, Version 0.1, beta)


Cerebrate

Recommended Posts

I'm pretty sure Taranis has mentioned that the current water/oxygen recyclers haven't really been balanced at all. I definitely suspect that if we were aiming for realism they should be using a lot more power than they currently do, and/or weigh a lot more.

ISRU for indefinite colony support is definitely a good way of getting around the "100% recycling is stupidly hard" problem (it is technically possible with sufficient energy input, but the required tech-level is ... high). For this mod we've already assumed we're using TAC-LS, and if we want to do ISRU we either need another mod that handles that, or we need to add it ourselves. The two major ISRU mods that I can think of are Kethane and KSPI, and I'm biased towards KSPI (as you may have noticed). By default, KSPI lets you use the refineries to harvest water from a variety of sources (either oceans, or ice in the soil of various planets and moons) and split it into hydrogen and oxygen (represented as LiquidFuel and Oxidizer, respectively). Using the config I posted earlier for the LqdWater -> Water and Oxidizer <-> Oxygen converter modules, you can already use that to indefinitely supply a colony with Water and Oxygen. It's simple and easy.

Food is the tricky part. You don't just find food lying around on planets the way you do water. Even for acquiring the elements to grow your own food, if you want to be realistic, it needs a fairly long list of substances:

Macronutrients (large quantities): carbon, hydrogen, oxygen, nitrogen, phosphorous, potassium, calcium, magnesium, sulfur

Micronutrients (small quantities): boron, chlorine, copper, iron, manganese, molybdenum, zinc, and nickel

I suspect if we want to maintain both realism and sanity, everything except the primary organic elements (CHON; carbon, hydrogen, oxygen, and nitrogen) should be abstracted away as "minerals", as suggested by Temeriki. Hydrogen and oxygen are already provided by water. Interestingly, KSPI already includes a way of harvesting nitrogen- the refineries are capable of combining atmospheric nitrogen with hydrogen using the Haber Process to form ammonia. This is actually the primary process used to produce nitrogen fertilizer on Earth- sometimes it's changed into other chemical forms first, but raw ammonia works too. It does mean that you would be confined to planets with nitrogen-bearing atmospheres, namely Eve, Duna, Laythe, and Kerbin (the latter not being particularly interesting). Carbon dioxide is trickier; KSPI already models it being present in the atmospheres of the aforesaid planets, but there's no way of harvesting it by default, nor are there tanks for storing it. There are atmospheric scoops for extracting useful gases from planetary atmospheres, however, and with a little config-modding we might be able to convince them to dump CO2 directly into the TAC-LS tanks. That only leaves the "minerals"; there's obviously nothing for that in KSPI by default. You could just abstract them away, as Temeriki suggested, because to gather water you either have to be landed (for water ice) or splashed down (for ocean water), and you could probably gather the minerals while you're getting the water.

I'm going to go mess around with the atmospheric intakes now. Wish me luck!

EDIT: It works. Excellent. Was easier than I was expecting. Method: Go to Game Data/WarpPlugin/PlanetResourceData/atmosphericresourcedefinitions.cfg and add these lines:

@ATMOSPHERIC_RESOURCE_DEFINITION[EveCarbonDioxide]
{
resourceName = CarbonDioxide
}
@ATMOSPHERIC_RESOURCE_DEFINITION[KerbinCarbonDioxide]
{
resourceName = CarbonDioxide
}
@ATMOSPHERIC_RESOURCE_DEFINITION[DunaCarbonDioxide]
{
resourceName = CarbonDioxide
}
@ATMOSPHERIC_RESOURCE_DEFINITION[LaytheCarbonDioxide]
{
resourceName = CarbonDioxide
}

Not sure if there's a way to do this with a ModuleManager config, will have to look into that. You'll need a tank to put the gathered CarbonDioxide in; given that we already have TAC-LS installed, all manned capsules can store a small amount, and any of the oxygen or life support canisters can store quite a lot.

Only catch: the atmospheric scoops were designed for things like extracting and compressing atmospheric oxygen from Kerbin or Laythe into Oxidizer, or hydrogen from Jool into LiquidFuel, so they require a fairly hefty power input- 6 MW for the "small" radial scoop and 24 MW for the large, but it otherwise works with extremely minimal modification. The scoops produce resources faster when moving through the air, but launchpad testing shows they work well enough when sitting still.

EDIT #2: Ohohoho, this just gets better and better. That file was already​ a ModuleManager config; putting these new lines of code in an entirely separate file works perfectly well. With this, my earlier configs, and MM's dependency checking feature, I should be able to create a single .cfg file that adds parts and modifications to allow full ISRU-based indefinite-duration life support if and only if you have both KSPI and TAC-LS installed.

Edited by ArcFurnace
Link to comment
Share on other sites

This is why I think you might benefit from a conversation with TACs author (if you haven't done so already). Get TAC to make it's stuff a bit more realistic in weight and power usage so you can make yours less realistic and meet them halfway.

Link to comment
Share on other sites

Okay, I realized I'd used totally different methods to calculate power usage for the original greenhouse (using data from the NASA document) and the algae greenhouse (using efficiency data on grow lighting from the Internet). If I've run the numbers correctly, we can reduce the lighting power figures for the basic greenhouse from 79.2 kW / Kerbal to ~25 kW/Kerbal by using more efficient lighting fixtures. It's possible that the efficiency figures I got from elsewhere are neglecting some loss factor that the NASA figures aren't, but the NASA document is from 2004; it seems plausible that more-efficient lighting fixtures have been developed in the last 10 years. That drops the total power usage of the original greenhouse with artificial lighting from 90 kW/Kerbal to 40 kW/Kerbal, which is nice.

Link to comment
Share on other sites

I made some greenhouse parts for people (like myself) who use both KSPI and TAC Life Support. They have both a regenerative mode (like stock TAC recyclers, but all 3 resources and 95% efficiency) and an ISRU mode that runs off harvested CarbonDioxide, Ammonia, and LqdWater. Mostly intended for long-to-indefinite duration missions, as they are fairly bulky and heavy. You also need the actual refineries from KSPI to harvest the Ammonia and LqdWater, the greenhouses contain a tiny atmospheric scoop you can use to harvest CarbonDioxide. The greenhouses can't take advantage of natural sunlight, but the power usage for artifical lighting is tiny compared to what the refineries use to harvest resources.

No plugin code included in the mod folder, as the TAC-LS and WarpPlugin .dlls are assumed to already be present, along with ModuleManager (which will be true if you have both TAC-LS and KSPI installed). Uses the greenhouse model zzz made a while ago and put into the public domain.

Download

Questions/comments?

Edited by ArcFurnace
Link to comment
Share on other sites

As it happens, I just pushed my 0.2 testing release out onto github.

Major changes in track: I've come to the conclusion that given power requirements, what's necessary to enable ISRU, etc., etc., that I might as well just bite the bullet and officially take KSPI as a dependency as well as TAC-LS. So it goes.

Given _that_ , and that as I understand it TAC-LS is looking at moving in this direction anyway, I'm also taking as an additional dependency (which may well end up part of the final distribution) that KSPI/TAC-LS compatibility mod that rejigs TAC-LS to use liters rather than kerbal-days as its base unit, and makes Water and LqdWater the same resource. (I had thought about the run-it-through-a-filter-to-get-potable-water approach, but on considering it some more, for most industrial/chemical purposes bar cooling, harvesting LqdWater must purify the hell out of it anyway).

Also, until I can figure out if there _is_ a way to add nodes to the tech tree without replacing the whole thing, I've just put the regular greenhouse under Large Electrics and the CELSS greenhouse under Advanced Science Tech without creating any new nodes for this sort of thing.

I've implemented the mass changes I mentioned above, and the new "base load" - although not the sun-based - power requirements for the greenhouses. I've also let either the regular (90% efficiency) or CELSS (nominal within-delta-of-100% efficiency) greenhouses operate in either standard or ISRU mode, essentially the same way as ArcFurnace's mod above.

However, I've not given the greenhouses the ability to scoop CO2 themselves; when used in space, my reasoning goes, you're not going to want to take a station or a station big enough to use these things into atmosphere to top them up. In short: using a regular KSPI atmospheric scoop, probably on some sort of air-skimmer spacecraft, tickles my sense of realism more. :)

That's about it for 0.2. Apart from more tweaking, 0.3 will contain the extra-extra-large Agricultural Greenhouse and I have some loosely ideas for a mini-greenhouse for earlier in the tree based on spirulina.

And then I can get on with working on the illumination-handling!

(Oh, and currently it's possible to run the greenhouses in both standard and ISRU mode at the same time, despite that this shouldn't be possible because they're using the same space and equipment. I can probably sort this out in the plugin, once written, but does anyone know of a way to define these as mutually exclusive just in the .cfg file?)

-c

Link to comment
Share on other sites

Yeah, I noticed how you could run both modes simultaneously. I don't believe the TACGenericConverter module includes any way of making converters mutually exclusive by default, although you could presumably write your own plugin code to do so.

Hmm... ah, I think I see a way. You could make it so that in the greenhouse module, there's one converter that consumes CarbonDioxide/WasteWater/Waste, and one converter that consumes CarbonDioxide/Ammonia/LqdWater, and they both produce some intermediate resource ("NutrientSolution"?). Then there is a third converter, which runs off the intermediate resource and produces Oxygen/Water/Food. That way you will always have the appropriate maximum production rate of Oxygen/Water/Food, since the TACGenericConverter module allows you to set the conversion rate.

Link to comment
Share on other sites

Yeah, I noticed how you could run both modes simultaneously. I don't believe the TACGenericConverter module includes any way of making converters mutually exclusive by default, although you could presumably write your own plugin code to do so.

Hmm... ah, I think I see a way. You could make it so that in the greenhouse module, there's one converter that consumes CarbonDioxide/WasteWater/Waste, and one converter that consumes CarbonDioxide/Ammonia/LqdWater, and they both produce some intermediate resource ("NutrientSolution"?). Then there is a third converter, which runs off the intermediate resource and produces Oxygen/Water/Food. That way you will always have the appropriate maximum production rate of Oxygen/Water/Food, since the TACGenericConverter module allows you to set the conversion rate.

Yeah, that's about what I figured. Ah, well, since I need to write my own plugin code anyway to support the solar-power handling, I'll just handle it in that anyway. Saves introducing any more user-visible complexity.

- c

Link to comment
Share on other sites

...and since that seemed easy enough, that's what I did.

Version 0.3 on github now, with plugin, which now handles only one of these modes at the same time, automates the opening and closing of the module shutters, includes the promised agricultural-size large greenhouse, etc., and provides a good basis for further expansion into the bargain.

- c

Link to comment
Share on other sites

Thanks for this, it looks great!

I'm having trouble in the VAB with this though.

When I try to select the part to put on one of my crafts I get a bunch of graphical errors. For example the icon of the part expands out, the info window flickers and it does not let me select the part to place on a craft.

I extracted the folder 'LacunaSpaceSystems' to my 'GameData' folder in KSP, not sure what else I would have to do. I have TACLS and the Interstellar mod installed and working correctly.

Any ideas what may be causing this?

thanks for any help.

Link to comment
Share on other sites

I extracted the folder 'LacunaSpaceSystems' to my 'GameData' folder in KSP, not sure what else I would have to do. I have TACLS and the Interstellar mod installed and working correctly.

Any ideas what may be causing this

Well, that should be all you have to do...

It's not an issue I've seen myself, I'm afraid, and offhand I can't think of anything that would cause it, but I'll see if I can reproduce it next time I'm at my dev machine.

One thing you could do to help diagnose - you're using 0.3, right? Can you grab 0.2 from GitHub and tell me if it gives you the same graphical problems?

Thanks,

- c

Link to comment
Share on other sites

Well, that should be all you have to do...

It's not an issue I've seen myself, I'm afraid, and offhand I can't think of anything that would cause it, but I'll see if I can reproduce it next time I'm at my dev machine.

One thing you could do to help diagnose - you're using 0.3, right? Can you grab 0.2 from GitHub and tell me if it gives you the same graphical problems?

Thanks,

- c

I think I found the problem, the 'Modular Kolonization System' and 'CELSS Greenhouse' seem to have some kind of conflict.

When I uninstalled 'Modular Kolonization System' everything worked fine. Not sure why though.

here's a link to the other mod, if you want to take a look to see why it might conflict:

http://forum.kerbalspaceprogram.com/threads/79588-0-23-5-Modular-Kolonization-System-%280-16-4%29-2014-05-17

Link to comment
Share on other sites

I think I found the problem, the 'Modular Kolonization System' and 'CELSS Greenhouse' seem to have some kind of conflict.

When I uninstalled 'Modular Kolonization System' everything worked fine. Not sure why though.

here's a link to the other mod, if you want to take a look to see why it might conflict:

http://forum.kerbalspaceprogram.com/threads/79588-0-23-5-Modular-Kolonization-System-%280-16-4%29-2014-05-17

MKS author here.

The exploding out in the VAB is generally caused by a part cfg bug. Given that I am not using any MM components that add to parts other than Kethane and the EL drills, I'm at a loss as to how my mod could affect the config files of a different one (also likely not a part conflict as I prefix all of mine with MKS).

That being said - both mods kinda land in the same place (i.e. MKS has a greenhouse and is a TAC extender). Should not be an issue related to the VAB issue you are seeing - that points to something off in the source part's config.

(Added) could also be something with an uncaught exception - that exploding is because your debug log is probably spamming the hell out of you right now ;) Probably want to take a look at that and post what it's griping about.

Edited by RoverDude
Link to comment
Share on other sites

FYI - just added this mod along side MKS - no zooming in the VAB for me.

Yeah, I just tried the opposite experiment, installing MKS alongside this mod on my dev machine, and I'm not getting any problems, VAB or otherwise, either.

Sorry, bojangles9999 - looks like it's something else. If it happens again, can you try the v0.2 thing, just to eliminate the plugin part of the mod? Apart from that, not sure what else I can do by way of debugging since I can't repro the problem, alas.

- c

Link to comment
Share on other sites

Hi, some questions from using it right now:

One of my space stations has room for 37 kerbals, meaning there are a lot of different capsules, each with their share of food, oxygen and so on. But right now there are only 2 kerbals on board. Now it seems that every capsule on the station consumes its share of ressources, not only these two kerbals. Is this right? I have no experience with taclife so its possible that i misunderstand something.

Additionally i see no difference in the rates of consumed goods and the display of remaining time in the taclife info, with or without the greenhouse. How can i check if the greenhouse works as intended? Shouldnt the ressources stay more or less the same?

Sorry for the dumb questions, but the concept of potential starving kerbals is also new to me :)

Link to comment
Share on other sites

All the life-support resources from TAC-LS have ALL_VESSEL flow, so they can be taken from everywhere on the ship- is that what's happening, you're seeing the amount of resources in every capsule go down? The rate at which they're being consumed should be proportional to the number of kerbals actually on board the ship, however.

The TAC-LS life support information window just tells you how long the resources you currently have in stock will last with the current crew. It doesn't really take into account anything that generates more of said resources (solar panels for electricity, recyclers such as the greenhouse for other resources). What should happen is that if you're using the recycling greenhouse, the amount of resources onboard should decrease at a dramatically lower rate than the actual rate shown in the window, due to extra resources being generated by the recycler. As an example, say you have the 90% efficient recycling greenhouse and the life support window says you have 20 days of life support in stock. If you wait 10 days, the life support window should say you now have 19 days of life support in stock, because additional resources were put back in by the recycler.

It's a little confusing, but if you know how efficient the recycler is it's easy enough to calculate your actual life support time remaining (if the recycler is running, multiply by 1/(1-e), where e is the efficiency of the recycler- in the example given, e would be 0.9, so you multiply by 10x).

Edited by ArcFurnace
Link to comment
Share on other sites

  • 2 weeks later...
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...