Jump to content

[1.8+] Real Fuels


NathanKell

Recommended Posts

Czerky: Make a *large* tank (like, 5m x 10m, say). Show the RF GUI, and add a LH2 tank. Now tell me again that it costs 0. :wink:

All right. I went ahead and did exactly as you said. Results for 5x10m (d x h) cryogenic tank:

Tank "dry cost" = 1.879065 <---- what I'm getting at

169 kL LH2 cost = 31.1

Right, so not zero. I just didn't expect such low values for the fuel tanks themselves. Is ~2 credits the correct (working as designed) value for an empty 5x10m fuel tank?

Edited by Czerky
Link to comment
Share on other sites

All right. I went ahead and did exactly as you said. Results for 5x10m (d x h) cryogenic tank:

Tank "dry cost" = 1.879065 <---- what I'm getting at

169 kL LH2 cost = 31.1

Right, so not zero. I just didn't expect such low values for the fuel tanks themselves. Is ~2 credits the correct (working as designed) value for an empty 5x10m fuel tank?

I don't think that sounds right either.

I went even higher (8.75m x 50m) to simulate a space shuttle EFT which was supposed to have a cost of something like $50M.

The dry cost in KSP was 29 or $29,000 in 1965 dollars. ($217,947.43 in today's dollars as calculated here:)

Edit:

As an additional test I decided to try scaling a Jumbo 64 up to 8m using TweakScale and stacked two of those on top. That gives the approximate size of an EFT. The cost was 561,600 ($561,600,000 c.1965) which is way too expensive. That could be TweakScale's fault though. Have to check and see how it scales cost. Edit

Also need to find out some reliable real world tank prices for various sizes of tanks, then and now.

Edit #2:

I think it was a mistake to involve tweak scale in any kind of comparison with what we get with Procedural Parts tanks. Its behavior is a little screwy and the numbers aren't always consistent on subsequent attempts. Also getting wildly different costs on the EFT when going to different sources. Some of that could be because of inflation differences but I'm just not sure. Need to go with something simpler like maybe Atlas. (shuttle tank was probably needlessly expensive and a bad example)

Edited by Starwaster
Link to comment
Share on other sites

Some price changes have been made in RP-0. If you're not using that in career, then things will be very strange. If you are, then please post logs etc because you should not be getting those prices.

Maybe some changes in RF's prices are in order then because not everyone uses RP-0

What sort of pricing scheme does RP-0 use?

Link to comment
Share on other sites

Yeah. I was just about to ask if Career mode isn't supported by Real Fuels outside of Realism Overhaul plus RP-0. If it isn't, I think that'd be important information for users to know.

It's actually possible to assign costs to RF tanks via their configs based on volume. It's just a question of knowing how much and that's the bit I'm unsure of. I've seen shuttle eft quoted as having a cost of... $250 per pound? (IIRC) which seems higher than I'd expect. Whereas atlas rockets were listed at $25. A really big difference....

Link to comment
Share on other sites

The problem is that cost and price are different things. Especially in the case of the Shuttle.

I'm perfectly happy for Raptor831 and anyone else who uses RF in a non-RO context to suggest appropriate pricing. RF by default has our best guess at 1965 fuel prices (where 1 fund = $1000USD), but the cost of tanks is...hard. RO will then go ahead and assign real prices, but if you don't have RO (say, playing stock career with RF Stockalike on 6.4x) you can have nonreal ~~~balance~~~ prices.

Link to comment
Share on other sites

Well, I can't say I have any genius ideas for cost, but for the Stockalike pack, I did the following (code in Javascript, for those who like to know):


$scope.doCost = function(engine) {
var baseCost, finalCost;
var costMultiplier = 1.5;
// =((J302*0.8+I302*0.2)-200)^2*M302/1000*(1+ABS(AH302)*0.2)*IF(H302="J",0.05,1)*IF(H302="N",4,1)*IF(AA302>0,0.5,1)
baseCost = (engine.meta.ksprfs.resultIspV * 0.8 + engine.meta.ksprfs.resultIspSL * 0.2) - 200;
baseCost = Math.pow(baseCost, 2) * engine.meta.ksprfs.ksprfs_engine_thrust / 1000 * (1 + Math.abs(engine.meta.ksprfs.ksprfs_engine_vectoring) * 0.2);
if ( engine.meta.ksprfs.ksprfs_type === 'jet' ) { baseCost *= 0.05; }
if ( engine.meta.ksprfs.ksprfs_type === 'nuclear-thermal' ) { baseCost *= 4; }
if ( engine.meta.ksprfs.ksprfs_engine_ffsc ) { baseCost *= 0.5; }

// =IF(AI302>0,AI302*((AI302/E302/4000)^0.25)*0.5+50+0.1*700*E302,"")
if (baseCost > 0) {
finalCost = baseCost * ( Math.pow(baseCost / engine.meta.ksprfs.ksprfs_engine_mass / 4000), 0.25) * 0.5 + 50 + 0.1 * 700 * engine.meta.ksprfs.ksprfs_engine_mass;
} else {
finalCost = 0;
}
engine.meta.ksprfs.engineCost = Math.round(finalCost * costMultiplier);

var entryFactor = engine.meta.ksprfs.ksprfs_engine_ffsc ? 10 : 5;
engine.meta.ksprfs.engineEntryCost = engine.meta.ksprfs.engineCost * entryFactor;
};

The commented lines are from the original XLS (which I based my web app off of) that I was comparing to when writing out the JS mathematics.

In short:

- higher Isp = higher cost (moreso for IspV)

- more thrust = higher cost

- more vectoring = higher cost

- more massive = higher cost

- if FFSC type engine, halve cost and double entry cost

- entry cost is 5x of per-use cost

This was scaled so that the Mainsail engine ended up being about the same in RF/Stockalike and stock. But the rest don't care. Honestly, it wasn't that far off. I had to increase costs only by 1.5x to make it work. As for the actual formula, I can't take credit since that's NathanKell's work.

I haven't messed with fuel/oxidizer/propellant costs, because when I'm in career, funds are in the most short supply, so frankly I take any help I can get. And really, since we're mucking about with realistic fuels, I tend to think let's at least use realistic fuel costs.

Link to comment
Share on other sites

Hey guys, so I'm planning a mission to Mars. I have my first and second stages set up and they're using either Kerosene/LOx or Hydrogen/LOx (along with SRBs) as the booster stage because I don't have to worry about boiloff. I need a little help though. I'm having trouble coming up with a lander design that has enough TWR and dV to get back to Martian Low Orbit and thus return to Earth. I can't very efficiently use Kero/LOx or Hyro/LOx because of fuel boiloff and radiator assemblies are electrically expensive. At first I though hypergolics would be it, but none of the motors have the thrust to do it with just 2 engines (my whole Martian lander assembly is IIRC somewhere around 80 tonnes). I'm wondering if I should use an SRB assembly to get above the atmosphere, and then a mix of SRB and hypergolic motors to circularize and then further plot the return home. Any advice is appreciated, thanks in advance.

Link to comment
Share on other sites

Uh, why the limit of two? Use as many engines as you need...also, your two-stage method sounds good, but once you get above the atmosphere you won't need more than like .2 Earth TWR to circularize and kick home--especially once you achieve orbit, TWR is nearly meaningless, you can always do your TEI in multiple passes.

Link to comment
Share on other sites

Uh, why the limit of two? Use as many engines as you need...also, your two-stage method sounds good, but once you get above the atmosphere you won't need more than like .2 Earth TWR to circularize and kick home--especially once you achieve orbit, TWR is nearly meaningless, you can always do your TEI in multiple passes.
Yeah, that makes sense... Don't know why I hadn't thought about that myself. Late night and KSP RO is not a good combo for thinking logically.

Edit: The limit of two comes from the motors being mounted radially, and thus I need to be careful how much the parts extrude from the side of my lander assembly, otherwise they won't be shielded by the heat shield.

Edited by Lightfeather
Link to comment
Share on other sites

Nathan, how RealSettings.cfg TechLevel parameters affects on engines?

For example, part of my engine config (0.64x scaled RD-111):


@PART[liquidEngineconstelacion]:FOR[RealFuels_StockEngines] //AIES Constellation-C6
{
@mass = 0.390
@cost = 325
@maxTemp = 1740

@MODULE[ModuleEngines]
{
@maxThrust = 666.5
@heatProduction = 155
@atmosphereCurve
{
@key,0 = 0 317
@key,1 = 1 275
}

!PROPELLANT[LiquidFuel] {}
!PROPELLANT[Oxidizer] {}
!PROPELLANT[MonoPropellant] {}

PROPELLANT
{
name = Kerosene
ratio = 27.39
DrawGauge = True
}

PROPELLANT
{
name = LqdOxygen
ratio = 72.61
}
}

MODULE
{
name = ModuleEngineConfigs
type = ModuleEngines
techLevel = 2
origTechLevel = 2
engineType = L+
origMass = 0.390
configuration = Kerosene+LqdOxygen
modded = false

...and so on

And slightly changed RealSettings (I think what TLISP defines MINIMAL edge values for engines):


TLISP2
{
key = 0 357
key = 1 304
}
TLTWR2 = 57.3
TLTECH2 = generalRocketry
TLTHROTTLE2 = 0.8

But ingame I saw correct max thrust value (666.5), but strange ISP ranges (304 - 357).

What's happen?

Link to comment
Share on other sites

@Lexx Thai:

The Isp you set within a ModuleEngines (or ModuleEnginesFX) node doesn't matter, but you can set them within each CONFIG node within a ModuleEngineConfigs module.

There are two ways to do this. First, you can set Isp manually, like so:


CONFIG
{
name = RL-10A-4
minThrust = 185
maxThrust = 185
heatProduction = 100
PROPELLANT
{
name = LqdHydrogen
ratio = 0.745
DrawGauge = True
}
PROPELLANT
{
name = LqdOxygen
ratio = 0.255
}
atmosphereCurve
{
key = 0 449
key = 1 255
}
massMult = 1.006
}

(from RealismOverhaul: https://github.com/KSP-RO/RealismOverhaul/blob/master/RealismOverhaul/RO_SuggestedMods/KWRocketry/RO_KWRocketry_Engines.cfg)

Alternatively, you can set multipliers which adjust from the base engine Isp stats, dictated in the RealFuels settings. Like so:


CONFIG
{
name = LqdHydrogen+LqdOxygen
maxThrust = 263
heatProduction = 133
PROPELLANT
{
name = LqdHydrogen
ratio = 72.85613945469638
DrawGauge = True
}
PROPELLANT
{
name = LqdOxygen
ratio = 27.143860545303625
}
IspSL = 1.3000
IspV = 1.2700
throttle = 0
// other stuff
}

(from RFStockalike: https://github.com/Raptor831/RFStockalike/blob/master/GameData/RealFuels/Stockalike_KWRocketry.cfg)

Hope that helps a bit.

Link to comment
Share on other sites

It's alive! ALIVE!

Thanks, Raptor. Variant A is better, but in that case I can't vary ISP by TechLevel. In variant B it's possible, but ISP values for engine replaced by values from RealSettings.cfg:confused: (Nathan, what are you overcoded there? :P Latest sources is difficult as hell! :))

Link to comment
Share on other sites

It's alive! ALIVE!

Thanks, Raptor. Variant A is better, but in that case I can't vary ISP by TechLevel. In variant B it's possible, but ISP values for engine replaced by values from RealSettings.cfg:confused: (Nathan, what are you overcoded there? :P Latest sources is difficult as hell! :))

Getting the multiplier should be easy. Take target Isp divided by the base TL Isp for your engine type. So:

317 / 304 = 1.043

275 / 250 = 1.1

So, in your CONFIG node you should have:


IspSL = 1.1
IspV = 1.043

That way, at the base TL you'll have the correct Isp, and as you increase TL it'll scale properly.

Link to comment
Share on other sites

I've been trying to fiddle around with modulemanager configs to adjust prices, but I'm afraid I don't know enough about how Real Fuels and Procedural Parts manage prices to accomplish want I want to do. I can set the price for stock tanks individually, but I don't know how to set the prices on procedural tanks by their capacity without also affecting everything with ModuleFuelTanks like said stock fuel tanks, solid rocket motors, TAC-LS tanks, et cetera.

My goals for adjusting price are:

1. Fuel tank prices must be more expensive than the equivalent worth of their weight in scrap metal.

2. Fuel tank prices should be within an order of magnitude of a reasonably-priced equivalent sized non-tank structural or aerodynamic part.

4. Fuel tank prices must be less expensive than a reasonably-priced engine they'd be expected to feed.

I've been assuming that propellant prices are negligibly cheap, and thus aren't a factor.

Currently, Procedural fuel tanks violate #1 and #2, as they have no price at all except for their propellant.

Most stock fuel tanks violate #3, as they are expensive -- the Mainsail is half the price of the Jumbo-64 orange fuel tank!

I think the importance of the first goal is self-evident, and the second goal is to provide a bit of plausible fidelity and remove the incentive to make the entire craft out of empty fuel tanks.

The third point is the real important one. Without it, dense fuels like kerolox become the only economical option, as the financial cost of adding extra tanks more than outweighs any possible savings gained by increased efficiency. It also makes makes Nuclear Thermal rockets pretty much worthless when attempting to use Liquid Hydrogen, as the equivalent delta-v in kerolox or hypergolics costs much less in funds despite the huge mass penalty.

Any advice?

Link to comment
Share on other sites

Getting the multiplier should be easy. Take target Isp divided by the base TL Isp for your engine type. So:

317 / 304 = 1.043

275 / 250 = 1.1

So, in your CONFIG node you should have:


IspSL = 1.1
IspV = 1.043

That way, at the base TL you'll have the correct Isp, and as you increase TL it'll scale properly.

Ah, so that's how it works! Thanks alot.

But what about TLTWR?

Edited by Lexx Thai
Link to comment
Share on other sites

Here's some ideas:

https://github.com/KSP-RO/RP-0/blob/master/GameData/RP-0/CostHacks.cfg#L38

(Start there, read down).

I suggest you set the price of all fuel tanks (PP and non-PP) to 0.1 and let RF handle the cost.

Yeah, I've been trying to follow the RP-0 configs. Thank you for pointing me to them. Is there any explanation of what the individual variables do, aside from digging into the code itself on GitHub? I think I've got "cost" and "baseCostPV' figured out, but "costPerkL" and "baseCost" still leave me baffled, and I'm not sure in what contexts ModuleManager will use "volume" properly.

Is there a way to get RF to increase the cost of tanks based on their dry mass? Because, so far, I'm still getting the situation where tanks are pretty much free, aside from the piddly little amount of propellant I have to pay for. It feels pretty cheaty.

Edited by Psawhn
Link to comment
Share on other sites

What I am really missing on the FAQ posts on the first page is a description of the different tank types. Using Procedural Parts and EngineIgnitor you get a lot of different tank types and needs for your engines.

Some of them I found out by try and error but it would be great if there was some resource on this somewhere.

I found out that monopropellants only work in ServiceModule tanks, or that insulated (Cryo) tanks stop Liquids to boil off too quick.

But when it comes to things like balloon tanks I still don't quite get the differences I think.

Sorry if this is the wrong thread for this.

Link to comment
Share on other sites

what i am really missing on the faq posts on the first page is a description of the different tank types. Using procedural parts and engineignitor you get a lot of different tank types and needs for your engines.

Some of them i found out by try and error but it would be great if there was some resource on this somewhere.

I found out that monopropellants only work in servicemodule tanks, or that insulated (cryo) tanks stop liquids to boil off too quick.

But when it comes to things like balloon tanks i still don't quite get the differences i think.

Sorry if this is the wrong thread for this.

this is also what i want :)

Link to comment
Share on other sites

Yeah, I've been trying to follow the RP-0 configs. Thank you for pointing me to them. Is there any explanation of what the individual variables do, aside from digging into the code itself on GitHub? I think I've got "cost" and "baseCostPV' figured out, but "costPerkL" and "baseCost" still leave me baffled, and I'm not sure in what contexts ModuleManager will use "volume" properly.

Is there a way to get RF to increase the cost of tanks based on their dry mass? Because, so far, I'm still getting the situation where tanks are pretty much free, aside from the piddly little amount of propellant I have to pay for. It feels pretty cheaty.

If you mean what does MM do if it encounters

%baseCost = 0.01 * volume

Nothing. It just changes baseCost equal the text 0.01 * volume

Link to comment
Share on other sites

If you mean what does MM do if it encounters

%baseCost = 0.01 * volume

Nothing. It just changes baseCost equal the text 0.01 * volume

If you want MM to access the value of a "volume" field somewhere else in the config file, MM can do cross-references at the cost of making your patch look like line noise.

For instance, assuming "baseCost" and "volume" are both fields of the same module, that cross-reference would look like:


%baseCost = #$volume$
@baseCost *= 0.01

Link to comment
Share on other sites

If you want MM to access the value of a "volume" field somewhere else in the config file, MM can do cross-references at the cost of making your patch look like line noise.

For instance, assuming "baseCost" and "volume" are both fields of the same module, that cross-reference would look like:


%baseCost = #$volume$
@baseCost *= 0.01

No that's not it.

Volume has special meaning to MFT/RF

baseCost = 0.1 * volume is parsed by real fuels to set the baseCost to the tank volume in liters times 0.1

Link to comment
Share on other sites

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