Jump to content

[0.90]Kerbal Isp Difficulty Scaler v1.4.2; 12/16/14


ferram4

Recommended Posts

Kerbal Isp Difficulty Scaler

pvng4d4.png

Tired of being able to reach orbit with tiny rockets?

Annoyed that pressures greater than 1 atm don't decrease your engine's Isp?

Want Isp to control your engine's max thrust, not fuel flow?

Like FAR and realistic aerodynamics, but wish that it didn't unintentionally decrease the size rocket you need to get to orbit?

With Kerbal Isp Difficulty Scaler, you can change that by decreasing / increasing the Isps of all engines in your game, increasing / decreasing the size of the rockets you need to get anywhere.

EXCITING FEATURES!

* Define IspPresets, which allow you to make the following changes:

  • Vac Isp Multiplier - How much the vacuum Isp of the engine is scaled; >1 makes engines more efficient than stock, <1 makes them less efficient than stock
  • Atm Isp Multiplier - Same as above, but at 1 atm (Kerbin Sea Level)
  • Extend Curve to Zero Isp - Choose whether to have Isp bottom out at 1 atm or continue decreasing until it hits 0 (does nothing if Isp increases with atmospheric pressure)

  • Thrust Corrector - Choose whether to have thrust vary with Isp while fuel flow remains constant (as it should) or keep the stock constant thrust with variable fuel flow
  • Thrust Corrector Options - Can have engines rated for vacuum (creates rated thrust in vacuum and less on the pad) or rated for atmosphere (creates rated thrust on pad and more in vacuum) based on Isp and/or thrust
    • Isp Cutoff - Isps above this will be considered "vac-rated" while Isps below this will be considered "atm-rated"†
    • Thrust Cutoff - Rated thrusts below this will be considered "vac-rated" while thrusts above this will be considered "atm-rated"†

* Select a different Preset for each saved game!

* Compatibility with Kerbal Engineer and MechJeb; it still takes 4.5 km/s dV to get to Kerbin orbit in the stock game, and it still takes 3.5 km/s dV to get to Kerbin orbit with FAR installed!

* Automatically works with all simple part-only mods!

* Default Presets, including conversions that require real-life mass ratios and conversions to handle FAR's lower drag!

†If both Isp and thrust cutoffs are set the engine must have an Isp below the Isp Cutoff AND a thrust above the Thrust Cutoff to be "atm-rated"; this means only low-efficiency, high-thrust engines will be "atm-rated" (based on your definitions of "low" efficiency and "high" thrust)

Known Issues:

Isps do not update in the VAB / SPH Parts List; this does not affect Kerbal Engineer or MechJeb calculations and those plugins will produce correct dV / Isp numbers

Note: To avoid possibly exacerbating any of the win64 KSP build's instability inherent issues, this mod will disable itself if run on a win64 build of KSP.

Licensed under GNU GPL v3

FAQ

I'm using the win64 KSP build and KIDS doesn't seem to be functioning. What gives?

Due to the instability of the win64 KSP build, KIDS will disable itself on that build. This is to ensure that any issues caused by the win64 build can be definitively traced back to it. KIDS is not supported on the win64 build, and you are encouraged to use either the win32 build or to switch over to linux, as both of those builds are much more stable.

Edited by ferram4
Link to comment
Share on other sites

Raw reduces Isp so that a rocket that makes 9 km/s with stock will make 4.5 km/s, allowing it to just barely reach orbit. If that was enough to account for the differences between KSP and real life, that would be it. However, there are hidden complications:

There's a ratio that isn't often talked about in KSP, called the structure ratio which is the fraction of the booster (note: no payload here) that is not fuel; this is the tank's dry mass, engine mass, decouplers, fins, separatrons, etc; the higher the number is, the less dV you can get out of the rocket. For math reference, the rocket equation, written in terms of structure ratio and another ratio, the payload ratio, is:

dV = Isp * g0 * ln((1 + p) / (e + p))

p = m_payload / (m_structure + m_fuel) -- payload ratio; ratio of payload mass to mass of entire booster

e = m_structure / (m_structure + m_fuel) -- structure ratio; ratio of structure mass to mass of entire booster

In real life, it's not too difficult to get structure ratio down to 0.1; the best I've found is the Saturn V first stage, which was just under 0.06.

In KSP, the lowest structure ratio possible is 0.1111111... assuming that your rocket is all fuel tanks and the engine weighs nothing; for it to practical it has to at least have a TWR of 1 on Kerbin, and the lowest you can get that is ~0.14666666... which is a Mainsail pushing nothing but fuel tanks, no decouplers on top, no payload (read: totally useless as a booster), which puts a rather high lower limit on the structure ratio in KSP.

So the Adjusted preset tries to finagle away the obvious differences in dV that will result from a booster that has a structure ratio of 0.1 and one that has a structure ratio of 0.146666.... with a payload ratio of 0.05. Of course, this is technically wrong, since it's trying to use a single linear factor to account for a nonlinear difference, but it's close enough for Kerbal engineering.

TL;DR: KSP rockets are less fuel by percent mass than real life rockets, making them less efficient; Raw doesn't try to fix it, Adjusted tries to finagle the difference away.

Link to comment
Share on other sites

In short... It's too easy to get a rocket to orbit in KSP compared to RL. Comparative dvs are less, even adjusting for lower planet diameter making gravity fall off faster as you go up compared to earth. At least I think that's what he's talking about.

Link to comment
Share on other sites

Right, in stock KSP it's so absurdly easy to reach orbit. If your payload is the stock 1-kerbal capsule, you don't need to think about staging or boosters at all. Just one engine and a few fuel tanks will do it with no problem. That's just plain wrong.

This mod fixes that problem.

Link to comment
Share on other sites

It tries to fix the fact that KSP rockets to LKO average 15% payload, whereas you'd be lucky to break 1% in real life. The Ariane V is amazing at 2%. It's because Kerbin requires less than half the deltaV to reach orbit that Earth does, and deltaV has an exponential relationship with rocket mass (Tsiolkovsky's rocket equation).

KIDS? You know, the little folks who'll carry on the human race? ^_^

Link to comment
Share on other sites

Yeah, the factor I was talking about (one of several that make it easier to reach orbit in KSP) is that gravity is the same on the surface of Kerbin as it is on Earth, but the diameter is 1/10th of Earth's. Since gravity forces are quartered if you double your distance from the center of gravity (center of the planet) it's proportional. IE the gravity 10KM above Kerbin is the same as 100km above earth! So it's one more reduction in how much force is needed to get up there. You know, like the odd ISP values compared to RL, the variances in scale of engines' output, the simplified drag factors, the atmosphere being lower.... etc etc

Edited by Patupi
Link to comment
Share on other sites

Does this fix the stock fuel consumption changing with Isp thing in favour of the more realistic thrust changing with Isp, or is that not something you plan on?

Either way, looks interesting. Another one of the realism / hard-mode plugins.

Link to comment
Share on other sites

Supernovy, nope, this just scales Isp. You need either Modular Fuels (sig) or Arcturus Thrust Corrector for that.

Ampsterman, nope, all it does is scale Isp (sea level and vacuum) to values you set. Well, and it also lets pressure go above 1.0 and scales Isp to match.

What's also provided are some presets to match real-world conditions, for both stock KSP (4.5km/s to orbit) and FAR (3-3.5km/s to orbit).

Link to comment
Share on other sites

@Supernovy: As NathanKell already said, the Arcturus Thrust Corrector already does that. I might add that as a feature if it's desired enough, but lacking any info about conflicts with Arcturus, I don't see a pressing need to add that.

@AmpsterMan: Doesn't modify thrust values or engine mass, only the Isps of the engines.

@NathanKell: Looking at the Modular Fuels System source code, I don't think this will work with it as is; I can look into providing support for it in a later version though.

Link to comment
Share on other sites

Ooh, that'd be right kind of you if you would; I'd be happy to write an interface on my end if that would help.

Yeah, actually, makes way more sense if I write a hook on my end. I'll add a receiving function (as I've already done so my Stretchy mod can change thrust in configs) that takes the two floats of yours. You sendmessage, and from that I'll read in the two floats and scale all my Isps by that.

Not quite sure of a quick and easy way to handle the scaling at >1 pressure other than just copying your code and having you sendmessage a bool...

Link to comment
Share on other sites

So, I was writing this up, the long process I go through, and I realized I already have exactly the values you need (partly). I already _have_ IspV and IspSL multipliers per config.

In each ModuleEngineConfigs there's a List<ConfigNode> configs. In that are multiple CONFIG nodes, and in each you should find IspV and IspSL. Multiply them by your appropriate scalar, if you haven't already already. When MFS nexts calls SetConfiguration, Isps will be updated.

However, for engines that don't yet use the new TechLevel system (or use hybrid engines) it's a bit more complicated. New hybrid engines (ModuleHybridEngine) are easy: they use the same CONFIG system as modular engines. If you don't find IspV and IspL, you look in each CONFIG for an atmosphereCurve and change it.

Old hybrid engines (ModuleHybridEngines) are basically identical to B9's HydraEngineController (which, I might point out, I think this also fails on). They have primaryEngine and secondaryEngine nodes under their module node, and atmosphereCurves in those.

The real issue is how do you extend down the curve for TL-enabled engines, and here's the rub. I recreate the floatcurves on the fly whenever I call SetConfiguration, by examining some stored float curves and grabbing only their pressure(0) and pressure(1) nodes. So if you want to go above pressure(1) you'd have to run your change directly on the part, after each time I run SetConfiguration, I think, unless I add a handler?

Link to comment
Share on other sites

Yeah, looking more closely I think a handler might make more sense (at least for the TechLevel-enabled engines), especially since the alternative will have KIDS doing a lot more work than it needs to. The method I use to extend the Isp curve can be found if you just search for "extendToZero" and look for the math-intensive code.

Now, looking at the old hybrid engines (and assuming that the B9 HydraEngineController functions the same way) this should handle it already... Correct me if I'm wrong, but do those modules function by adding a ModuleEngines PartModule each time the engine mode switches? Because if they do, then KIDS should handle it perfectly fine and it's only the newer engines that will be a problem.

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