Jump to content

Karbonite/Real Fuels Integration Configs [1/18/15]


Raptor831

Recommended Posts

Someone's been busy. :) The only thing is that Karbonite does have some atmospheric definitions already included, and it does have atmospheric scoops out of the box. Judging from the part config of the scoop, I think it'll work with any resource. The atmospheric definitions are in the CommunityResourcePack folder. See here: https://github.com/BobPalmer/Karbonite/blob/master/GameData/CommunityResourcePack/Karbonite/atmosphericresourcedefinitions.cfg

So with the exclusion of those, looks good to me.

I woke up at 6 AM and couldn't sleep.

For the default configs: right. I forgot the syntax to overwrite those, but it was intentional. Those are unrealistically high amounts of Karbonite in the atmosphere. Jool's atmosphere would be less of an atmosphere and more of an ocean, and you could definitely fly indefinitely on Jool and Eve, possibly Laythe.

The only other note I can think of is that I included the CarbonDioxide, Neon, and Argon resources in there, which are not stock for RealFuels, I think. They can be safely commented out until they are needed.

Link to comment
Share on other sites

Another benefit of this that I kind of just thought of is that when you combine it with TAC, you could do something like extract CO2 from the atmosphere and use a carbon extractor to produce pure, breatheable O2 from Duna's atmosphere.

Of course, that would be down the road after it's working for Karbonite.

I do really like the idea of capturing resources from the air.

Link to comment
Share on other sites

Another benefit of this that I kind of just thought of is that when you combine it with TAC, you could do something like extract CO2 from the atmosphere and use a carbon extractor to produce pure, breatheable O2 from Duna's atmosphere.

Of course, that would be down the road after it's working for Karbonite.

I do really like the idea of capturing resources from the air.

RE: Karbonite in the atmo: ah, ok, good call. And for reference, you can either use @MODULE... or %MODULE... to change the resource via MM. @ grabs it only if it is already there, but % changes if it is there and creates it if it is not already there. MM thread is a great resource. Also, we probably should scale the atmospheric amounts to reflect the changes made in density.

Argon is already in the CRP as ArgonGas, so that's a simple find-and-replace. Neon is not, so that might need to be commented out. And extracting O2 from CO2 pulled from the atmosphere is exactly the kind of stuff I'd like to do. Really, I'd love for Karbonite to be a drop-in replacement for Kethane and/or KSPI (at least resource-wise). Even down to the heat management. But that's for later, I guess.

Link to comment
Share on other sites

Ok, I've put up some changes on the repo. I haven't gotten to test these, since the B9 v5 "prerelease" hit, I've been setting up RF with that all afternoon. Hence, these are not a "release" yet, but if you feel inclined you can download the latest files and test them.

But, the atmospheric stuff is in there, minus Neon. Also, the conversion ratios are fixed, so you should be getting proper amounts out. The other big change is that the refineries will produce your fuels plus some byproducts, and your distilleries will produce oxidizers and monopropellants without byproducts. Stuff like N2O4 you'll need to bring a distillery for. The primary compound will never be wasted, but any byproducts will be dumped if you don't have the space.

I haven't fixed the GUI names yet, so those might be a bit long now.

Link to comment
Share on other sites

Can you post your conversion ratio spreadsheet? I want to get on the same page regarding that. I think you're using slightly different densities (I'm using the ones from RealFuels).

You have some strangeness in your leftover conversions. For example, with methane: CH4NO2 = CH4 + O2 + N2, not CH4 + O2 + H2. If you post your conversion spreadsheet I'll fix it for you. Your numbers are slightly different from mine, so I don't want to fix it until our numbers agree.

I also submitted some small changes.

Some thoughts: it may be overcomplicating things, but I think that the air scoop should pull oxygen and hydrogen, and not liquidoxygen and liquidhydrogen, from the air. It really doesn't make sense to pull atmospheric oxygen and then convert it into a cryogenic liquid. This also goes for the converters -- should there be a separate process to liquify the (likely hot) gas you're creating?

Edited by lordkrike
Link to comment
Share on other sites

Can you post your conversion ratio spreadsheet? I want to get on the same page regarding that. I think you're using slightly different densities (I'm using the ones from RealFuels).

You have some strangeness in your leftover conversions. For example, with methane: CH4NO2 = CH4 + O2 + N2, not CH4 + O2 + H2. If you post your conversion spreadsheet I'll fix it for you. Your numbers are slightly different from mine, so I don't want to fix it until our numbers agree.

I also submitted some small changes.

Some thoughts: it may be overcomplicating things, but I think that the air scoop should pull oxygen and hydrogen, and not liquidoxygen and liquidhydrogen, from the air. It really doesn't make sense to pull atmospheric oxygen and then convert it into a cryogenic liquid. This also goes for the converters -- should there be a separate process to liquify the (likely hot) gas you're creating?

The methane example couldn't have H2 as a byproduct, since it'd all be going into methane. 2 CH4NO2 --> 2 CH4 + 2 O2 + N2

I accepted your pull request, so those are in there. We'll have to figure out about the atmospheric stuff. MM could pull the proper nodes if we set it up, even if Karbonite keeps the non-unique names. :wink:

I would agree about the liquid vs gaseous part, but that'd then require TACLS or something for those elements. Although, I think the CommunityResourcePack has those in there... That could work.

Last, I'll post my XLS up when I get home this evening. It's not all that intuitive and it's bit messy, but it works. I pulled the densities from my stockalike calcs sheet, which originated with NathanKell, so I assume the densities are right. They might have changed though, since that data is not really used for the engines much. That's all in a data table so it's easy to change.

Link to comment
Share on other sites

The methane example couldn't have H2 as a byproduct, since it'd all be going into methane. 2 CH4NO2 --> 2 CH4 + 2 O2 + N2

I was unclear. That is also what I am saying. The config has:

@PART[KA_Converter_250_01]:AFTER[Karbonite]:NEEDS[RealFuels]

{

MODULE

{

name = USI_Converter

converterName = Karbonite to Methane, LOX, LH2

conversionRate = 1

inputResources = ElectricCharge, 1.5, Karbonite, 1

outputResources = LqdMethane, 1.37629910872491, False, LiquidOxygen, 1.01694086625459, True, LiquidH2, 0.515885517744275, True

}

}

So it needs to be fixed. It's not the only one like that. I can do it for you once you put up your spreadsheet if you like -- I know you have the stockalike realfuels to work on.

Link to comment
Share on other sites

I was unclear. That is also what I am saying. The config has:

@PART[KA_Converter_250_01]:AFTER[Karbonite]:NEEDS[RealFuels]

{

MODULE

{

name = USI_Converter

converterName = Karbonite to Methane, LOX, LH2

conversionRate = 1

inputResources = ElectricCharge, 1.5, Karbonite, 1

outputResources = LqdMethane, 1.37629910872491, False, LiquidOxygen, 1.01694086625459, True, LiquidH2, 0.515885517744275, True

}

}

So it needs to be fixed. It's not the only one like that. I can do it for you once you put up your spreadsheet if you like -- I know you have the stockalike realfuels to work on.

Well, sheesh, I apparently suck at chemistry. :blush: That's twice now you've corrected my mistakes.

In any case, here's an updated (and hopefully fixed) source XLS for this: download. I fixed the Methane one and a few others that I found, but it seems a good idea to let someone else check my chemistry/math. Might stick this up on the repository too, if we need to keep an up-to-date copy around.

Link to comment
Share on other sites

...

Your spreadsheet-fu is greater than mine. I am humbled, oh master.

I'll look it over tomorrow for any mistakes.

Well, sheesh, I apparently suck at chemistry. :blush: That's twice now you've corrected my mistakes. ... I fixed the Methane one and a few others that I found, but it seems a good idea to let someone else check my chemistry/math.

That is why open-source is a thing! :)

Link to comment
Share on other sites

...

Your spreadsheet-fu is greater than mine. I am humbled, oh master.

I'll look it over tomorrow for any mistakes.

It's called: I find stuff that works and use that. The Calcs.xls from NathanKell's RftS engines is where I got most of the guts from, especially the MM output. I'm still not sure I've got the chemistry parts right!

Link to comment
Share on other sites

I increased the precision of the molecular masses, and replaced the hand-jammed ones with calculated ones for slightly better precision. We have the same densities.

I'm checking your chemical formulae at the moment - looks like a few fat finger mistakes. That said, I want to make a change and won't do it without your input first.

I think that hydrazine should be the preferred monopropellant byproduct where possible. There's no reason for liquid hydrogen and gaseous nitrogen to be a byproduct of kerosene synthesis. Instead, that hydrogen should be combined with the nitrogen to produce hydrazine (N2H4), which is much more powerful than nitrogen and a rather "standard" monopropellant -- in fact, it comes stock in realfuels on all command capsules.

... Nevermind. I see that you already have that as an additional option. :)

Link to comment
Share on other sites

I fixed it up and submitted a pull request.

The only thing that I think needs reviewing/discussion is the distiller. Do we want it to produce byproducts at all? I added in simple gaseous byproducts (H2, O2, N2) where appropriate.

I think we should remove them and leave byproducts as a thing for the refinery.

Link to comment
Share on other sites

I fixed it up and submitted a pull request.

The only thing that I think needs reviewing/discussion is the distiller. Do we want it to produce byproducts at all? I added in simple gaseous byproducts (H2, O2, N2) where appropriate.

I think we should remove them and leave byproducts as a thing for the refinery.

Pull request merged. I tried to make the byproducts useful in all cases, but I seem to only ever get trace N2 and O2! :)

I was thinking of leaving byproducts out of the distillers. Just think it adds some interesting play options, and differentiates the two even more.

Link to comment
Share on other sites

I mean, it works, but we may want to work on this... If you want to keep all of the options, we will have to split the refineries/converters into separate machines - for example, one refinery does hydrocarbon bipropellants, and a second copy does nitrated bipropellants. I'm not even really sure how to split the menu for the distillery.

If we're removing some, there are a few less useful candidates there. Hydrocarbons + N2O4 are top of that list (not matched to their oxidizers), followed closely by the O2 + hydrocarbon options (if you're topping off your tank with fuel you won't care when you move to top off your oxidizer that it gives you yet more fuel that you can't store anyway). The H2 + O2 = H2O2 and hydrolysis modules aren't terribly useful at the moment and at present nothing uses MON.

A combo we may want to consider adding is kerosene + HTP. There is at least one engine in your pack that uses that combination.

Also, the fancy modulemanager config for removing oxidizer and liquidfuel and monopropellant doesn't work. I switched back to just removing the 1st and 0th index modules from anything with a USI_Converter.

Link to comment
Share on other sites

I mean, it works, but we may want to work on this... If you want to keep all of the options, we will have to split the refineries/converters into separate machines - for example, one refinery does hydrocarbon bipropellants, and a second copy does nitrated bipropellants. I'm not even really sure how to split the menu for the distillery.

If we're removing some, there are a few less useful candidates there. Hydrocarbons + N2O4 are top of that list (not matched to their oxidizers), followed closely by the O2 + hydrocarbon options (if you're topping off your tank with fuel you won't care when you move to top off your oxidizer that it gives you yet more fuel that you can't store anyway). The H2 + O2 = H2O2 and hydrolysis modules aren't terribly useful at the moment and at present nothing uses MON.

A combo we may want to consider adding is kerosene + HTP. There is at least one engine in your pack that uses that combination.

Also, the fancy modulemanager config for removing oxidizer and liquidfuel and monopropellant doesn't work. I switched back to just removing the 1st and 0th index modules from anything with a USI_Converter.

Haha! Wow, uh, needs more options. :) It's kind of a RealFuels curse. It's nice to have all of those options but it gets crowded fast.

I think the better option is to have multiple kinds of refineries. But, I'm no modeler/texturer/part maker. (I'm a web developer when I'm not playing KSP) We can certainly clone the parts and give them appropriate names and such, so if we're ok with that, then lets go that way. The first section in that XLS was my initial tests. The second section was the actual stuff that I put in. I forgot to mention that also. :rolleyes: 0 for 3 so far.

So, the question becomes: how do we split up the fuels into separate parts?

Needs a bigger list imo. Literally laughed out loud when I opened that picture krike. Reminds me of some of the early biomass modules.

Or maybe the DragonRider capsule by ccbp. That one gave me fits...

Link to comment
Share on other sites

Lol it's always fun when you have to manually tilt the camera to get at all the options :P

EDIT: To get back on topic; maybe separate the cryogenic fuels and storable fuels? Not sure if that'll give you enough separation though(since you'd only have HydroLOX // KeroLOX // MethaLOX and their remnants).

Edited by Shad0wCatcher
Link to comment
Share on other sites

Lol it's always fun when you have to manually tilt the camera to get at all the options :P

EDIT: To get back on topic; maybe separate the cryogenic fuels and storable fuels? Not sure if that'll give you enough separation though(since you'd only have HydroLOX // KeroLOX // MethaLOX and their remnants).

That's not a bad idea either. lordkrike mentioned something about cryogenic fuels needing to be cooled, so maybe a bit higher EC usage for them to simulate some kind of refrigeration going on. Also, there are a few duplicated conversions (ex: HTP is in there twice for the converters and once in the distiller). We can probably prune those, at least.

@lordkrike I updated the XLS in the repo with some highlights on the ones I thought of removing entirely. My intention was to make 1 reaction for each fuel, to keep it as simple as we can. It seems that N2O4 though never comes out as a byproduct for fuels that actually use it though. MMH, UDMH, etc., never have nitrogen left over! Only LOX comes out reliably.

On another note, I think I figured out how to get atmospheric scoops working, but again, need to clone parts. Since Karbonite/ORS/KSPI updated, I had a look at the source and there's a few modules we might use, depending on how it could be used. I think you could add an atmospheric ISRU module to the converters, or clone an intake and just pull the atmospheric resource in. We'll see once I can test those.

Link to comment
Share on other sites

Thoughts:

The distiller should not be able to produce any cryogenic chemicals (liquid oxygen, liquid hydrogen, and liquid methane -- note that liquid ammonia, while technically moderately cryogenic, has a pretty reasonably high boiling point). The thought process is that it could potentially capture the gas, but has no means to cool it enough to change it to a liquid state. As far as splitting the distiller's menu, we could have one distiller version that produces specifically MON. I like that split because MON isn't terribly useful except for niche realfuels settings and it could also be justified by having the equipment to get precise mixtures of nitrogen oxides.

For the refineries, we can't do a cryogenic/non-cryogenic split, or you end up with a somewhat useless refinery that can produce kerosene but no LOx. If it can produce LOx, it can produce at least liquid methane (though potentially not hydrogen). I think a better way to split them is into nitrogen and carbon based fuels. So, one refinery would produce:

Aerozine

Hydyne

MMH

UDMH

Liquid Ammonia

Of course, this still runs in to the issue that you would need a distillery to produce N2O4, so we could also allow that to be produced here.

The other refinery version would produce:

Kerosene

Syntin

Alcohol

Liquid Methane

LOx

With liquid hydrogen being the man out. It can either have its own, special refinery (to illustrate the difficulty of cooling hydrogen to cryogenic temperatures) and not be allowed as a byproduct at all, or just be tacked on to both other types of refinery. Personally, I prefer the idea of having it be its own thing.

Also, sorry, with the new release of interstellar I'm taking a break from RealFuels. I'll keep working on this because I find it fun, but I won't be doing much testing.

I won't change anything until there has been some discussion, obviously. :)

Edit: You can see an example spreadsheet here. I don't want to do a pull request until I'm sure we're on the same page. Reverting is a PITA in my opinion.

Edited by lordkrike
Link to comment
Share on other sites

That spreadsheet looks good to me. Go with that. That ends up with a maximum of 6 options per part, which I feel is reasonable. The EC for the highly cryogenic fuels should probably be bumped up a bit, since that would be an intensive process. It also would pay for you to haul around karbonite and then convert to LH2 as you need, to avoid boiloff.

And that compound is interesting. :)

I'll be moving this weekend, so I'll probably be off the forums until maybe Sunday or Monday. Might give me some time to actually play the game for a bit instead of work and test. And if you need a break, do take one. Burning out on this stuff is never good!

Link to comment
Share on other sites

Again, your one step ahead of me. :) I'm working on a realistic set of minerals for Duna so I can colonize it using Real Fuels and Karbonite. (Duna data based off mars with some liberties for "play-ability") It'll be it's own mod with dependency checks for other mods and may include models for the drills, mine or acquired elsewhere, and of course use Open Resource System. If it works well for Duna I'll go on to other planets and release it. I'm not looking forward to the conversions though. lol. Your solution is nice and clean, I doubt mine will be. So good on ya. Care to help with the chem/converters?

Link to comment
Share on other sites

Care to help with the chem/converters?

Fair warning: I'm a mathematician, not a chemist. But sure!

@Raptor: Unfortunately, LibreOffice Calc is just not as good as Excel. It won't let me leave line breaks inside cells that I edit (but the ones you did in Excel work just fine -- thanks, Obama). Everything just ends up looking like a giant one line mess. It should end up looking like this:

=IF(ISBLANK($Outputs.E2),"",IF($Outputs.A2="Distiller","@PART[KA_Distiller_250_01]:AFTER[Karbonite]:NEEDS[RealFuels]",(IF($Outputs.A2="DistillerM","@PART[KA_Distiller_250_01M]:AFTER[Karbonite]:NEEDS[RealFuels]",(IF($Outputs.A2="ConverterC","@PART[KA_Converter_250_01]:AFTER[Karbonite]:NEEDS[RealFuels]",(IF($Outputs.A2="ConverterN","@PART[KA_Converter_250_01N]:AFTER[Karbonite]:NEEDS[RealFuels]",(IF($Outputs.A2="ConverterH","@PART[KA_Converter_250_01H]:AFTER[Karbonite]:NEEDS[RealFuels]","ERROR!")))))&"

{

MODULE

{

name = USI_Converter

converterName = "&$E2&"

ConversionRate = 1

inputResources = "&$G2&H2&L2&P2&"

outputResources = "&T2&X2&AB2&AF2&"

}

}

")

(I added a tiny bit of error checking)

I wrote up a file to add the necessary cloned parts. Didn't take long. I'll push it along with the new spreadsheet, but if I change the recipes themselves it will look like hot garbage. Hopefully you can just copy and paste what's above. That same first line should also work for column C if you change the 250s to 125s.

Oh, and I also quadrupled the energy cost for making liquid hydrogen. As always, it can be adjusted as needed.

Edit: I'm not sure why it's adding a space in the word "distiller". I swear it's not here in the raw.

Dobbel Edit: Thoughts on changing the shortname of Kerosene from Kero to RP-1?

Edited by lordkrike
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...