Jump to content

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


Raptor831

Recommended Posts

Karbonite/Real Fuels Integration

So you want both Karbonite and Real Fuels? Here's a set of configs to enable the Karbonite converters and distillers to produce proper fuels for you. You'll need Real Fuels and Karbonite installed (obviously) as well as ModuleManager.

Download

GitHub Repository

Installation

Place the FalconTech folder in your GameData folder.

Details

The configs change a few things:

  1. The density of Karbonite is reduced by a fifth to match the other RF fuels.
  2. The amount of karbonite other parts hold is increased by 5. (So the same mass is still in each part)
  3. The converter produces the more volatile fuels (LH2, LOX, Kerosene, etc).
  4. The distillers produce the less volatile fuels (Hydrazine, HTP, Methane, etc)

I "created" a chemical formula for karbonite, which ended up being CH4NO2. I have no idea if this compound exists or even could exists, but since we're talking about a magic substance that produces all manner of fuels, I didn't worry too much. Based on that formula, I did some chemistry to figure out what amounts of various fuels would come out. So, 1 molecule of karbonite after conversion produces 1 molecule of methane (CH4) and 1 molecule of LOX (O2). All of the units/masses should be "correct". And, any fuels that could not come from this (such as He) are not included. Most of my data came from Wikipedia.

Only one fuel comes out at a time. I had previously worked out multiple fuels per conversion, but it seemed overly complicated. Plus, the default RF config for Kethane does one fuel at a time as well, so I figured I'd follow that. Normal Karbonite fuel-flow rules apply, so double check your fuel lines and connections.

License

Configs released under the CC Attribution-ShareAlike 4.0 International License.

Edited by Raptor831
Updated to GitHub repository
Link to comment
Share on other sites

Sounds cool, i'll have to try it out. Been meaning to start a 6.4x save soon. If ever you need help/advice on chemistry, feel free to PM me; aren't day jobs fun? :D

(You almost made nitromethane FWIW. Does realfuel do anything with nitrogen? Hydrazine and the like come to mind. That level of detail might be too 'real' for realfuels though ><)

Link to comment
Share on other sites

Raptor, you should put a license on this.

You might not think so (I didn't) but even a set of configs like this require licenses. I got an infraction from my science configs (signature) that I posted in a manner like you did your Karbonite / RF config.

I'm not sure why it matters since lots of us post tons of config snippets all the time on these boards in our posts to each other, but it apparently does.

Link to comment
Share on other sites

Sounds cool, i'll have to try it out. Been meaning to start a 6.4x save soon. If ever you need help/advice on chemistry, feel free to PM me; aren't day jobs fun? :D

(You almost made nitromethane FWIW. Does realfuel do anything with nitrogen? Hydrazine and the like come to mind. That level of detail might be too 'real' for realfuels though ><)

Anything you can get from that chemical formula I threw in. Nitrogen, LH2, O2, methane, hydrazine, UDMH, MMH, N2O4, Kerosene, Syntin, HTP, and N2O are included, along with Aerozine (which is a blend of hydrazine and UDMH). I debated leaving Aerozine out and requiring the appropriate amounts of each part, but I figured that was a bit too complicated. It's in my development XLS, so if I decide to throw that one in there it's not hard to add. I never liked Chemistry in school, and now I'm doing this for fun...

Nice work!

Thanks. :)

Raptor, you should put a license on this.

You might not think so (I didn't) but even a set of configs like this require licenses. I got an infraction from my science configs (signature) that I posted in a manner like you did your Karbonite / RF config.

I'm not sure why it matters since lots of us post tons of config snippets all the time on these boards in our posts to each other, but it apparently does.

I realized I missed that after I posted originally, was going to add one to be safe. Thanks for noticing. I understand enough of licensing stuff to know that it's better (especially for Squad) if we post it. Stinks, but there are worse things.

Link to comment
Share on other sites

I feel like I'm messing something up.

I have RealFuels (with stockalike engine configs), ModuleManager2.2.2, and Karbonite installed, and your config files appear to be doing nothing.

Engines and fuel tanks work just fine, I have all the Karbonite parts and they work just like stock, and the config files are located in /[KSP]/Gamedata/FalconTech/Karbonite.

Any ideas on why ModuleManager is not overwriting the information for the Karbonite parts?

Edit: by inserting another change into your config file, I've confirmed that MM is loading the .cfg, but for some reason your changes aren't taking. Perhaps the changes to the latest version of Karbonite borked it?

Edited by lordkrike
Link to comment
Share on other sites

There's also something wrong with the tank configs. The volume adjustment is missing an "@" symbol just before RESOURCE, and for some reason the density adjustment isn't taking either (unless 4000L of Karbonite is supposed to weigh 50 metric tons :)), but I'm not sure why.

I can't say for sure whether or not the intake air adjustment is taking. I'm not sure how to test it.

Edit: You should also adjust the unit cost of Karbonite while you're at it.

Edited by lordkrike
Link to comment
Share on other sites

Thanks lordkrike for the heads up. I haven't tested this out fully, but the configs match what's currently on GitHub for Karbonite. They should work.

Costs are also adjusted, and the volume edits should take as well. Karbonite is really heavy, which is why I adjusted everything to keep the same mass per part. If you look, stock Karbonite is the same density almost as the nuclearFuel resource in Real Fuels. :0.0:

Also, a license.txt has been added to the download, to be in line with the new mod rules.

Link to comment
Share on other sites

Edit: resource configs are working just fine, you saw nothing here.

I reconfigured some stuff for my own use. I hope you use it.

I went through and, using the densities from RealFuels, adjusted the production rates. Assuming the converters contain SpaceChem-level technology, the production rate for Kerosene was far too low.

I also decided that the distillery should be used for anything that involves a carbon atom -- this way we actually can distill alcohol from it, and it makes a certain kind of sense to me to group all the hydrocarbon-type fuels in one machine. The refinery is used for everything else.

I also included every fuel in RealFuels except for amines, TEA-TEB, and helium. The first, because it's pretty ill defined, the second because it's not really a rocket fuel (it's for ignition systems), and the third because helium isn't in the nitromethane-like molecule.

You can see my working spreadsheet here and you can get the config file here.

You should consider setting up a GitHub repository for this. Easier to manage IMO.

Edited by lordkrike
herped the derp
Link to comment
Share on other sites

Edit: resource configs are working just fine, you saw nothing here.

I reconfigured some stuff for my own use. I hope you use it.

I went through and, using the densities from RealFuels, adjusted the production rates. Assuming the converters contain SpaceChem-level technology, the production rate for Kerosene was far too low.

I also decided that the distillery should be used for anything that involves a carbon atom -- this way we actually can distill alcohol from it, and it makes a certain kind of sense to me to group all the hydrocarbon-type fuels in one machine. The refinery is used for everything else.

I also included every fuel in RealFuels except for amines, TEA-TEB, and helium. The first, because it's pretty ill defined, the second because it's not really a rocket fuel (it's for ignition systems), and the third because helium isn't in the nitromethane-like molecule.

You can see my working spreadsheet here and you can get the config file here.

You should consider setting up a GitHub repository for this. Easier to manage IMO.

I'm not at home, so I can't check out the config yet. Will do later though.

As for the production rates, you probably could just simply increase the conversionRate property. The ratios were balanced using chemical formulas, so I won't be messing with those. Unless, of course, I've made an error with the math/chemistry, which is entirely possible. You do end up with some waste. Well, a lot. I could set it up so that you get multiple fuels out per process, which is a bit more realistic. But a bit more complicated as you need to have the specific tanks set up.

In the Karbonite mod (somewhere) it says the Distillery is for less volatile fuels, which I tried to follow. They're all rocket fuels, so that's like saying TNT is less powerful than C4 or something. They both do some damage. But, hey, since it's called the Distillery, we might as well go with it.

As for GitHub, I thought about putting it up there. I didn't think it'd be useful, but it's not going to hurt anything I guess.

Link to comment
Share on other sites

As for the production rates, you probably could just simply increase the conversionRate property. The ratios were balanced using chemical formulas, so I won't be messing with those. Unless, of course, I've made an error with the math/chemistry, which is entirely possible. You do end up with some waste. Well, a lot. I could set it up so that you get multiple fuels out per process, which is a bit more realistic. But a bit more complicated as you need to have the specific tanks set up.

Sorry, I said conversion rate, but meant conversion ratio.

How did you derive the conversion ratio for kerosene? 1L of CH4NO2 at the density given (2500g/L) should produce a lot more kerosene. What the exact ratio is depends on what you call kerosene, but I went with pure dodecane for higher conversion efficiency, while separating it from syntin (which is decane). Even if you went with pure hexadecane, it would still be a lot higher than .11 liters of kerosene per liter of kethane.

The rest of the conversion ratios only differed by a few to tenish percent. Check my spreadsheet to see how we differ. I tried to be as precise as possible with the chemistry... of course, assuming we have a SpaceChem reactor than can move atoms and bonds around all willy-nilly.

Link to comment
Share on other sites

I tried to be as precise as possible with the chemistry... of course, assuming we have a SpaceChem reactor than can move atoms and bonds around all willy-nilly.

Ok, that comment wins the internet for the day. :)

Well, I see I had the atomic weight of kerosene off by a factor of about 6. Whoops. I guessed at kerosene's molecular formula before I had something to look at. Which was like C2H8 or something. Once I found dodecane (C12H26), I used that for my formula balancing, but forgot to update the atomic mass. This is why I'm not a chemist.

Everything else is the same mathematically (though you got there quicker than I), but I added in an efficiency factor of 90%, since nothing is 100% efficient. Even SpaceChemTM, says me. But with that taken out, the numbers are almost exact. I pulled atomic mass from Wikipedia where they had it (as opposed to deriving it), so there's the last tiny difference.

So, a few questions then: if I may, I'd like to integrate your calcs for the fuels I missed or have poor information on, that ok?

Also, what would you think about generating multiple fuels from each process? So say, you produce both LOX and LH2, or say methane and N2O4? Less wasteful. I think I can set it up so that you'd only care about the primary (so say you want to make LOX, but you get a bonus of methane and nitrogen if you have those tanks). I've already got my XLS set up for that, so it's just a matter of copy/paste.

Edited by Raptor831
Link to comment
Share on other sites

So, a few questions then: if I may, I'd like to integrate your calcs for the fuels I missed or have poor information on, that ok?

Also, what would you think about generating multiple fuels from each process? So say, you produce both LOX and LH2, or say methane and N2O4? Less wasteful. I think I can set it up so that you'd only care about the primary (so say you want to make LOX, but you get a bonus of methane and nitrogen if you have those tanks). I've already got my XLS set up for that, so it's just a matter of copy/paste.

90% efficiency is good to go, in my opinion.

As far as using the information there, of course! It's dangerous to go alone. Take it. :)

For producing multiple fuel types... I have a couple thoughts.

I think the most complicating factor is, for each fuel, what are you going to make with the leftovers? For the hydrocarbons, it's pretty obvious you want O2, and you may as well make H2 with any leftover hydrogen and N2 with any leftover nitrogen. But for Aerozine? You're going to make something like HTP or O2, both of which are pretty useless to you in 99.99% of cases.

On the other hand, there's no downside if you do set up the configs to produce something out of the leftovers -- they'll just bleed off and the player will never see them if he doesn't have a tank to store them (and if he doesn't have a tank to store them he likely doesn't care). Ultimately, we're limited by the UI. There is only so much space for buttons to turn the refinery/distiller on and off, so we can only have so many choices available.

Extra thoughts: the reactions that produce H2, N2, and O2 should definitely all be the same reaction. You're just splitting the entire molecule apart and recombining everything diatomically. i.e make N2, get H2 and O2, make O2, get H2 and N2, etc. I say, save the making methane for the methane reaction, and let the methane reaction give you extra O2. Also, splitting Karbonite into methane, oxygen, and nitrogen as a one-stop shop for fuel, oxidizer, and monoprop is pretty damn cool.

tl;dr for bipropellants, yes when possible, otherwise, maybe where it makes sense.

Edited by lordkrike
Link to comment
Share on other sites

Had 30 more minutes to think about it and wanted to rephrase a little.

When making bipropellant fuels, you should definitely get the oxidier if possible. If you can make a monopropellant out of anything left over, even better (i.e. methane + O2 + N2 and kerosene + O2 + hydrazine).

If making straight oxidizer, you run into the issue of "which fuel do I get, and is it useful for my engine?". So for making oxidizers and monopropellants, make extra things if they're useful and make sense, but I wouldn't worry about making fuel byproducts. Rocket fuel molecules are relatively more complicated than oxidizers anyway -- they're not really going to be byproducts.

This also is a convenient way to split the distillery/refinery production lines: bipropellant fuels could be made in the refinery, everything else in the distillery.

Edited by lordkrike
Link to comment
Share on other sites

Had 30 more minutes to think about it and wanted to rephrase a little.

When making bipropellant fuels, you should definitely get the oxidier if possible. If you can make a monopropellant out of anything left over, even better (i.e. methane + O2 + N2 and kerosene + O2 + hydrazine).

If making straight oxidizer, you run into the issue of "which fuel do I get, and is it useful for my engine?". So for making oxidizers and monopropellants, make extra things if they're useful and make sense, but I wouldn't worry about making fuel byproducts. Rocket fuel molecules are relatively more complicated than oxidizers anyway -- they're not really going to be byproducts.

This also is a convenient way to split the distillery/refinery production lines: bipropellant fuels could be made in the refinery, everything else in the distillery.

I'll be adding your calculations to my XLS generator, thanks! Also, the project is on GitHub now (link's in the OP) so you can see what's up. The master XLS still isn't online anywhere, but I'll probably post that as a separate link once it becomes easy enough to use (similar to the RF Stockalike config one).

I figured getting a fuel and oxidizer at once would be useful, but didn't know if I could make it work well. I think I've got the dump everything but the primary reaction in the config (needs testing) so I'd like to go with that.

I think the distillery/refinery split is perfect for this also. Refinery for the fuels and their byproducts and distillery for the oxidizers/monopropellants. Actually gives those parts some distinction too, and gives a reason why the refinery doesn't have a small version.

I'll work on some updates and post them on GitHub once they're working.

Link to comment
Share on other sites

Adding it to github is nice because if you were to disappear it's not all lost.

By the way, you can remove the liquidfuel and oxidizer modules by adding

!MODULE,1 {}

!MODULE,0 {}

to the refinery and distilleries. Should free up some space in the right-click menu. May I also suggest removing the "Karbonite to" from each module? I feel like it makes extra clutter. Your call.

Carbon-based fuels have no issues with having leftovers for oxidizer. It's the nitrogen-based fuels that are an issue, since they use up all their nitrogens for the fuel and the oxidizer is usually N2O4. You're stuck lugging around the distiller, too, if you want to use aerozine, MMH, or UDMH. I actually rather like that, since you actually have to think for a second before you just slam on a refinery and call it a day.

Finally, for your stockalike realfuels mod, you should totally have a version with the fuels you don't use in any of your engines commented out. Though, personally, I'd like to see more alcohol/O2 and HTP engines. :-)

Link to comment
Share on other sites

Adding it to github is nice because if you were to disappear it's not all lost.

By the way, you can remove the liquidfuel and oxidizer modules by adding

!MODULE,1 {}

!MODULE,0 {}

to the refinery and distilleries. Should free up some space in the right-click menu. May I also suggest removing the "Karbonite to" from each module? I feel like it makes extra clutter. Your call.

Carbon-based fuels have no issues with having leftovers for oxidizer. It's the nitrogen-based fuels that are an issue, since they use up all their nitrogens for the fuel and the oxidizer is usually N2O4. You're stuck lugging around the distiller, too, if you want to use aerozine, MMH, or UDMH. I actually rather like that, since you actually have to think for a second before you just slam on a refinery and call it a day.

Finally, for your stockalike realfuels mod, you should totally have a version with the fuels you don't use in any of your engines commented out. Though, personally, I'd like to see more alcohol/O2 and HTP engines. :-)

Yeah, been thinking about removing the stock fuel options, and I think it'd save space. The "Karbonite to..." part was intended to be there because I have a few lines for configs like LOX + LH2 making HTP. Or even LOX + LH2 into water (for TAC or KSPI). In those cases you'd need a label like that. Heck, even making Aerozine 50 or the MON mixtures. Not sure how often they'd be used, or if they'd be better served as a different part entirely.

And as for the Stockalike configs (which are on GitHub now too) I'd love to have some more fuel types in the mix. I just have a hard time deciding which mixtures should go with what. HTP mixtures are in the RCS config as monopropellant and it is used heavily in RLA_Stockalike parts. Alcohol, well, I'm adding that into some parts. If you have suggestions for mixtures and/or engines, leave some notes on the Stockalike Engines thread. :)

Link to comment
Share on other sites

Yeah, been thinking about removing the stock fuel options, and I think it'd save space. The "Karbonite to..." part was intended to be there because I have a few lines for configs like LOX + LH2 making HTP. Or even LOX + LH2 into water (for TAC or KSPI). In those cases you'd need a label like that. Heck, even making Aerozine 50 or the MON mixtures. Not sure how often they'd be used, or if they'd be better served as a different part entirely.

If you're going to incorporate configs for KSP Interstellar and TAC (which I am personally in favor of because I use both), you should still make them optional files for those that don't use them.

I also vote for fuel mixing being a separate part if it becomes necessary. It complicates things logistically due to requiring multiple input tanks. As it stands, MON should probably be made straight from Karbonite (because making 1 part of NO2 to 99 parts N2O4 will basically be impossible with any accuracy). That basically leaves Aerozine-50 and Hydyne, and we don't currently have a use for DETA other than for use in Hydyne.

Funny story, the lady who invented hydyne wanted to call it Bagel. So we could have Bagel and Lox.

If you want any help with any of this stuff, let me know. My time is available. And free. Hooray unemployment!

Edited by lordkrike
Link to comment
Share on other sites

So I was thinking about it, and was vaguely concerned that this config removes all ways to make helium and xenon (and potentially other noble gas fuels).

I thought of two solutions to get them in RealFuels:

IRL, helium is usually fractionally distilled from natural gas. Since karbonite is our analogue to any and all hydrocarbon fuels in the real world, it would make sense for helium to be captured while mining karbonite. I'm not sure if the ORSModuleRailsExtraction would support this, but it would be neat.

The other option is to fractionally distill it from the atmospheres (IRL, xenon is captured this way). This would require setting up atmospheric resource definitions and configuring a part to actually capture it from IntakeAir at the correct ratios for each planet's atmosphere. However, Karbonite doesn't seem to support atmospheric resource gathering at the moment, and so in the meantime if we were to create a fractional distiller part to make xenon and helium from IntakeAir, it would be at fixed ratios in all atmospheres (unless you can think of a clever way to make it happen).

I'm going to write up some configs for atmospheric resource definitions to add to the pack. They can't hurt, and they'll probably be useful in the future. I'll submit a pull request when I'm done finding realistic values for the different atmospheres.

Link to comment
Share on other sites

I submitted a pull request.

Due to the high ratios of organic compounds in Jupiter's and Venus' atmospheres, it may be possible to sustain indefinite flight using Karbonite-fueled engines on Eve and Jool... :)

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.

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