Jump to content

[1.8.1 - 1.12.3] Realistic Atmospheres


OhioBob

Recommended Posts

  • 3 months later...
3 hours ago, y2kcobrar said:

How does this mod interact with rescales? i.e. I'm playing with a 10x stock system and outer planets

It interacts perfectly fine with rescales.  But how well the rescaled atmospheres behave in game is a function of how good your rescale settings are.  For 10x I would recommend something like,

        @Atmosphere = 1.25
        @atmoTopLayer = 1.6

 

Link to comment
Share on other sites

14 hours ago, OhioBob said:

It interacts perfectly fine with rescales.  But how well the rescaled atmospheres behave in game is a function of how good your rescale settings are.  For 10x I would recommend something like,

        @Atmosphere = 1.25
        @atmoTopLayer = 1.6

 

I am not seeing these values in the config file for Kerbin.  It looks like this:

@Kopernicus:FOR[RealisticAtmospheres]
{
    @Body[Kerbin]
    {
        @Properties
        {
            timewarpAltitudeLimits = 0 70000 70000 70000 120000 240000 480000 600000
            @ScienceValues
            {
                flyingAltitudeThreshold = 18000
            }
        }
        @Atmosphere
        {
            enabled = True
            oxygen = True
            maxAltitude = 70000
            // Constants
            adiabaticIndex = 1.4
            atmosphereMolarMass = 0.0289644    // dry air
            // Atmosphere Pressure
            staticPressureASL = 101.325
            pressureCurve
            {

 

Link to comment
Share on other sites

20 minutes ago, y2kcobrar said:

I am not seeing these values in the config file for Kerbin.  It looks like this:

Those are SigmaDimension/Rescale settings.  You don't need to change anything in RealisticAtmospheres.
 

Edited by OhioBob
Link to comment
Share on other sites

  • 1 year later...

Hi, sorry to bring up an old post with (yet another) rescale question.

I'm setting up a new save with a rescaled atmosphere of 140k.  I have set up a MM patch for SigmaDimensions using the values below.

On 3/31/2021 at 8:28 AM, OhioBob said:

It interacts perfectly fine with rescales.  But how well the rescaled atmospheres behave in game is a function of how good your rescale settings are.  For 10x I would recommend something like,

        @Atmosphere = 1.25
        @atmoTopLayer = 1.6

 

This patch produces the following values, taken from the MM.ConfigCache:

  • pressureCurve keys have been multiplied by 1.25x.
  • PressureCurve values remain unchanged.
  • MaxAltitude is 87,500m.
  • In the tracking station the atmosphere height correctly reports 140km.
  • Barometer readings above 87.5k altitude all show "minimal". 

What I'm not sure of is whether there has been any extrapolation of your pressure curve - your last key is "70-0-0-0" so it made me wonder whether extrapolation is not possible because your curve isn't an asymptote, it has a hard 0 value at altitude 70km.

I came across one of your posts from waaay back that talked specifically about extending/extrapolating the curve for a 140km atmosphere:

On 6/10/2016 at 1:59 PM, OhioBob said:

Rescaling RA's atmospheres to something like 140 km will make them deeper and more massive than the real-life equivalent.  RA atmospheres are modeled using a life-size analog, and then they have their heights factored by 0.8.  Therefore, reversing the 0.8 factor by multiplying them by 1.25 will produce the most lifelike atmosphere over the range that now exists.  If you want to extend the atmospheres beyond that, then I would recommend editing the configs to extrapolate the curves beyond their current heights.

For example, Kerbin's atmosphere now goes to 70 km.  Factoring this by 1.25, we get 70*1.25 = 87.5 km.  This will give you a very realistic atmosphere over the 0-87.5 km range.  If you want to go to 140 km, then you should open Kerbin.cfg and extrapolate the curves out to 112 km.  Therefore, applying the 1.25 factor, we get 112*1.25 = 140 km.

The curves that have to be extended are pressureCurve, temperatureCurve, and temperatureSunMultCurve.  You also must change maxAltitude.

 

I had a go at multiplying the key values of these curves by 1.6x (giving me a final key of 112km) which was then picked up by the Sigma patch and left me a curve out to 140km, but turns out the curve wasn't extrapolated, only the keys were multipled (first by me 1.6x, then by Sigma another 1.25x).  In the tracking station I wound up with an atmosphere of 224km, so clearly not working right.  I was hoping to get your guidance on how best to handle this, I'd like there to be "some" atmosphere in the 100-140km range, even if it is only very light.  I suspect the solution might require tweaking the last couple of keys to make the pressure curve asymptotic but not really sure if that's the correct solution or not.

Link to comment
Share on other sites

@Strych74, I don't know why it isn't working for you.  Almost all atmospheres end with something like "70-0-0-0".  Sigma Dimensions is suppose to ignore that last key and extrapolate from the keys preceeding it.  So if it were working as designed, it would properly extraloate the atmosphere to 140 km.  The last key shouldn't be the problem.  I know it worked properly when it was initially tested, but that was a long time ago.  Maybe something has broken since then.  You can try changing the last key to see if it makes any difference, but I'm not sure it will.  If I hadn't forced the pressure curve to go to zero, the next key would have been:

				key = 70000 3.00633E-04 -6.33976E-08 -6.33976E-08

It might also be benificial if I could see your Sigma Dimensions config.  Perhaps I can spot an error if one exists.

(edit)

If all else fails, we could use Earth's atmosphere curves from RSS and write a patch that will change Kerbin's atmosphere without the use of Sigma Dimensions.  Of course this won't help with any of the other planet's atmospheres if they're experiencing the same problem.

(edit 2)

I just loaded up KSP with Realistic Atmospheres and Sigma Dimensions installed and I'm getting the same problem as you described it.  Changing the last key of pressureCurve did nothing to fix it.  It seems clear to me that atmoTopLayer in Sigma Dimensions is now broken.  Unfortunately I haven't heard anything from Sigma88 in probabaly a year or more.  I think he has lost interest in KSP and has stopped maintaining his mods.  And since his mods are licensed All Rights Reserved, there really isn't anything anybody can do to fix it. 

I might consider writing patches for Realistic Atmospheres that will edit the atmospheres for different scales without the use of Sigma Dimensions, but I don't have time for that now.  Perhaps in the future.

(edit 3)

Further in game testing has shown that Sigma Dimensions is in fact working as it should.  For some reason the atmosphere curves we're seeing in the MM cache do not match what we're actually getting in game.
 

Edited by OhioBob
Link to comment
Share on other sites

@Strych74, the following patch will replace Kerbin's atmosphere with a proper 140 km atmosphere.  Unfortunately this does nothing to fix the atmospheres of any other planets.  You might as well set atmosTopLayer = 1 in your SD config as it doesn't seem to do anything other than change the atmosphere depth as seen in the Tracking Station.  For planets other than Kerbin, you'll just have to change their atmospheres using the atmosphere setting, though this is certainly less than ideal.

Spoiler
@Kopernicus:FINAL
{
	@Body[Kerbin]
	{
		@Atmosphere
		{
			%altitude = 140000
			%maxAltitude = 140000
			%atmosphereDepth = 140000
			!pressureCurve{}
			!temperatureCurve{}
			!temperatureSunMultCurve{}
			pressureCurve
			{
				key = 0 101.325 0 -0.0119729
				key = 1000 89.9537 -0.0107923 -0.0107923
				key = 2000 79.7013 -0.00972759 -0.00972759
				key = 3000 70.4691 -0.00875313 -0.00875313
				key = 4000 62.1620 -0.00787633 -0.00787633
				key = 5000 54.6886 -0.00708329 -0.00708329
				key = 6000 47.9719 -0.00636074 -0.00636074
				key = 7000 41.9470 -0.00569867 -0.00569867
				key = 8000 36.5555 -0.00509376 -0.00509376
				key = 9000 31.7428 -0.00453892 -0.00453892
				key = 10000 27.4635 -0.00402664 -0.00402664
				key = 12000 20.3407 -0.00312205 -0.00312205
				key = 14000 14.8739 -0.00236992 -0.00236992
				key = 16000 10.7657 -0.00175875 -0.00175875
				key = 18000 7.76098 -0.00126703 -0.00126703
				key = 20000 5.61289 -0.000901159 -0.000901159
				key = 22000 4.08419 -0.000643110 -0.000643110
				key = 24000 2.98894 -0.000462653 -0.000462653
				key = 26000 2.19866 -0.000334849 -0.000334849
				key = 28000 1.62536 -0.000243495 -0.000243495
				key = 30000 1.20769 -0.000177736 -0.000177736
				key = 35000 0.588602 -8.25983E-05 -8.25983E-05
				key = 40000 0.296819 -3.96388E-05 -3.96388E-05
				key = 45000 0.154692 -1.97099E-05 -1.97099E-05
				key = 50000 0.0825035 -1.03082E-05 -1.03082E-05
				key = 55000 0.0438832 -5.63677E-06 -5.63677E-06
				key = 60000 0.0227005 -3.07935E-06 -3.07935E-06
				key = 65000 0.0112807 -1.62592E-06 -1.62592E-06
				key = 70000 0.00536204 -8.22892E-07 -8.22892E-07
				key = 75000 0.00243557 -3.94225E-07 -3.94225E-07
				key = 80000 0.00106710 -1.78982E-07 -1.78982E-07
				key = 85000 0.000456872 -7.82929E-08 -7.82929E-08
				key = 90000 0.000192739 -3.34218E-08 -3.34218E-08
				key = 95000 8.12137E-05 -1.38889E-08 -1.38889E-08
				key = 100000 3.52962E-05 -5.69392E-09 -5.69392E-09
				key = 105000 1.62730E-05 -2.40474E-09 -2.40474E-09
				key = 110000 8.14091E-06 -1.04206E-09 -1.04206E-09
				key = 115000 4.55287E-06 -4.76718E-10 -4.76718E-10
				key = 121920 2.40103E-06 -1.98682E-10 -1.98682E-10
				key = 140000 0 0 0
			}
			temperatureCurve
			{
				key = 0 282.5 0 -0.0025
				key = 8000 240.5 -0.006 -0.006
				key = 15000 212 -0.0025 -0.0025
				key = 21000 214 0.0015 0.0015 
				key = 30000 228 0.002 0.002
				key = 42000 255.5 0.0025 0.0025
				key = 49750 268 0 0
				key = 60000 247.5 -0.003 -0.003
				key = 75000 209 -0.002 -0.002
				key = 91000 191.75 0 0
				key = 100000 206 0.003 0.003
				key = 110000 256 0.009 0.009
				key = 120000 375 0.011 0.011
				key = 140000 560 0.007 0
			}
			temperatureSunMultCurve
			{
				key = 0 1 0 -0.0002
				key = 2250 0.65 0 0
				key = 7000 0.65 0 0
				key = 12500 0 -0.000135 -0.000135
				key = 16500 -0.335 0 0
				key = 22000 0 6.5E-05 6.5E-05
				key = 33000 0.315 0 0
				key = 40500 0.315 0 0
				key = 52000 0.12 -3.5E-05 -3.5E-05
				key = 54750 0.0215 -1.4E-05 -1.4E-05
				key = 64500 -0.115 -1.4E-05 -1.4E-05
				key = 73000 -0.43 0 0
				key = 74750 -0.43 0 0
				key = 85750 -0.035 0 0
				key = 88750 -0.035 0 0 
				key = 96250 -0.13 0 0
				key = 97500 -0.13 0 0
				key = 110000 0.275 6E-05 -3E-06
				key = 140000 0.185 -2E-06 0
			}
		}
	}
}

 

 

Link to comment
Share on other sites

@Strych74, I think this apparent Sigma Dimensions bug is a false alarm.  While it's true the MM cache is showing only the changes produced by atmosphere, it appears that atmosTopLayer is actually working in game.  For instance, I ran a test using using atmosphere = 1.25 and atmoTopLayer = 1.6, which should give us a Kerbin atmosphere with a height of 140 km.  The curves we see in the MM cache only shows them stretched out to 87.5 km, and not extrpolated out to 140 km as they should be.  But when I load up the game and place a satellite in orbit within the 87.5-140 km region, it encounters atmospheric drag.  The Aero GUI is also indicating air pressure in this region.  So while the MM cache leads us to believe that atmoTopLayer is not working, in game testing shows that it actually is.

Link to comment
Share on other sites

7 hours ago, OhioBob said:

@Strych74, I think this apparent Sigma Dimensions bug is a false alarm.  While it's true the MM cache is showing only the changes produced by atmosphere, it appears that atmosTopLayer is actually working in game.  For instance, I ran a test using using atmosphere = 1.25 and atmoTopLayer = 1.6, which should give us a Kerbin atmosphere with a height of 140 km.  The curves we see in the MM cache only shows them stretched out to 87.5 km, and not extrpolated out to 140 km as they should be.  But when I load up the game and place a satellite in orbit within the 87.5-140 km region, it encounters atmospheric drag.  The Aero GUI is also indicating air pressure in this region.  So while the MM cache leads us to believe that atmoTopLayer is not working, in game testing shows that it actually is.

So would using the @atmoTopLayer produce the same atmosphere curve as the "hard-coded" version you provided above?  Would you recommend using the atmoTopLayer rather than the hard-coded curve to 140k?

Link to comment
Share on other sites

12 hours ago, Strych74 said:

So would using the @atmoTopLayer produce the same atmosphere curve as the "hard-coded" version you provided above?  Would you recommend using the atmoTopLayer rather than the hard-coded curve to 140k?

For the 140 km Kerbin atmosphere, the hard-coded one would be better.  That atmosphere was designed from the beginning to be 140 km, so its temperature curve, etc. follows a realitstic Earth-like profile all the way to the top.  The Sigma Dimensions atmosphere only has information up to 87.5 km, so above that it is just extrapolating from the last known information.  For instance, as I recall, it uses the last known temperature throughout the extrapolated region.  However, now that we know atmoTopLayer is actually working, you can use it to modify the atmospheres of other planets.

Link to comment
Share on other sites

  • 1 month later...

I ended up making a 10x rescale version of your mod, since I do not like using Sigma Dimensions to scale the atmosphere compared to just using similar atmospheric models from RealSolarSystem.

Keep Atmosphere and atmoTopLayer set to 1 if using 10x version.

(Snip)

 

Edited by Gargamel
Download link removed
Link to comment
Share on other sites

21 hours ago, Wilds said:

I ended up making a 10x rescale version of your mod, since I do not like using Sigma Dimensions to scale the atmosphere compared to just using similar atmospheric models from RealSolarSystem.

Keep Atmosphere and atmoTopLayer set to 1 if using 10x version.

@Wilds, while it is OK to modify Realistic Atmospheres for your own personal use, be advised that distributing your modifications is a violation of the Realistic Atmosphere's license.  Specifically, the NoDerivatives clause.

Quote
  • NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

Creative Commons — Attribution-NonCommercial-NoDerivatives 4.0 International — CC BY-NC-ND 4.0

 

Link to comment
Share on other sites

Ah ok, that is too bad. Not really interested since it is just using RSS pressure curves. but OhioBob is welcome to it if they want.

I used the atmospheric values from RealSolarSystem which is CC-BY-NC-SA fortunately. Thought this mod was too. So if anyone wants to have a realistic atmosphere for 10x rescale vanilla, check out RSS for reference which uses same syntax for tweaking atmospheres as this mod.

 

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

Interesting reading.  I want to make sure I'm understanding properly:

I loaded up a new install with the stock system rescaled to 2.5x.   Had a confusing time getting into orbit, finally realizing that "space" wasn't 77k (based on atmosphere = 1.1 in the Sigma config for the rescale) but actually around 91k  based also on the atmoTopLayer = 1.18blah entry written a little further down in the same config.

My assumption is that then it takes those values and applies them to the properties for planet Kerbin stored in whatever Kopernicus templates your game uses. I'm guessing mine must get loaded up from the ones stored in the sigma templates folder, since I haven't installed this mod yet.

I see entries like pressure curve, which, for Kerbin, has a last key entry of 70000   0    0    0    which I am assuming means that the curve ends at 70k, above which altitude there is no more atmosphere, which is what we see in the stock game.

Does the atmosphere = 1.1  value multiply all the keys in the curve (e.g. 70k becomes 77k, 65.3 becomes 71.83, etc?)

Does the atmoTopLayer = 1.18 then multiply by 77k to become ~91k?

Does Sigma then extrapolate values somehow to fill out the rest of the ever-thinning atmosphere curve from 77k to 91k?

@OhioBob made a post several pages back with guidance about how to calculate the atmosphere and atmoTopLayer values for Sigma to use.  Plugging 2.5x into that gives me something like 1.09 for the atmosphere and 1.21 for the atmoTopLayer.  I'd assume the variance in my sigma rescale file would be so that the in-game values for 77k and ~91k are the result.   Does 77k really mean anything important in the game?

 

 

 

 

 

Link to comment
Share on other sites

EDIT:  following up with this...

The 77k seems to be when the "space music" starts.

There was an intermediate figure described as Total Height... how does that come into play (other than a way to derive atmoTopLayer?)

 

Edited by Kurld
remove some duplication
Link to comment
Share on other sites

Mechjeb is still showing some atmospheric drag at 120k orbit (~64 am/s2) This actually seems to be generating a slight amount of lift, as my apo. has slowly raised from 120k to 120017 and is now falling again slowly towards 120000 as I approach that altitude.

Not sure what to make of it.

 

 

Link to comment
Share on other sites

I hyper-edited up to 200k and the drag reported by MJ was about -50 fm/sso something is off somewhere.

I loaded another ship which was in orbit at 100k and noticed no such drag weirdness.  So. . . something about this shuttle I'm using?

I'm so confused.

Link to comment
Share on other sites

12 hours ago, Kurld said:

Interesting reading.  I want to make sure I'm understanding properly:

I loaded up a new install with the stock system rescaled to 2.5x.   Had a confusing time getting into orbit, finally realizing that "space" wasn't 77k (based on atmosphere = 1.1 in the Sigma config for the rescale) but actually around 91k  based also on the atmoTopLayer = 1.18blah entry written a little further down in the same config.

My assumption is that then it takes those values and applies them to the properties for planet Kerbin stored in whatever Kopernicus templates your game uses. I'm guessing mine must get loaded up from the ones stored in the sigma templates folder, since I haven't installed this mod yet.

I see entries like pressure curve, which, for Kerbin, has a last key entry of 70000   0    0    0    which I am assuming means that the curve ends at 70k, above which altitude there is no more atmosphere, which is what we see in the stock game.

Does the atmosphere = 1.1  value multiply all the keys in the curve (e.g. 70k becomes 77k, 65.3 becomes 71.83, etc?)

Does the atmoTopLayer = 1.18 then multiply by 77k to become ~91k?

Does Sigma then extrapolate values somehow to fill out the rest of the ever-thinning atmosphere curve from 77k to 91k?

@OhioBob made a post several pages back with guidance about how to calculate the atmosphere and atmoTopLayer values for Sigma to use.  Plugging 2.5x into that gives me something like 1.09 for the atmosphere and 1.21 for the atmoTopLayer.  I'd assume the variance in my sigma rescale file would be so that the in-game values for 77k and ~91k are the result.   Does 77k really mean anything important in the game?

The atmosphere multiplier stretches the existing atmosphere curves, while atmoTopLayer extrapolates them.  For example, let's use your mulitplers and the stock Kerbin atmosphere, which is 70 km in height.  The atmosphere multiplier stretches the existing curves to a height of, 70 * 1.1 = 77 km.  The temperature and pressure at the bottom, middle and top of the atmosphere is exactly what it was before.  It has just been stretched out to a new height.  The atmoTopLayer multiplier then extrapolates the atmosphere from where it left off up to a new height of, 77 * 1.18 = 91 km.  Sigma Dimension computes a rate of change from the existing pressure curve, and then uses that rate of change as a basis for the extrapolation.  In the 77-91 km range the atmospheric pressure should decay exponentially so the pressure at the top of the new atmosphere is much lower than it was at the top of the old atmosphere.

Regarding MechJeb, I know nothing about that.  I have no idea why you seem to be experiencing drag above where the atmosphere ends.  That shouldn't happen.  But since it's apparently not a Realistic Atmopheres issue, it's not my concern.

Link to comment
Share on other sites

Thanks for the explanation.

I agree the orbital decay has nothing to do with RA (I don't even have that config installed) but I thought maybe I was wrong in my understanding about atmosphere parameters and how SD treats them, in general.  Or maybe somebody who plays the game a lot more than I do might see this and understand what was going on.

FWIW, I reloaded the game and put the shuttle that was acting weird directly into orbit with hyperedit.  It seems to be behaving now, so . . . beats the hell outta me.  Maybe it won't come back when I launch it again the old-fashioned way.

I think the MJ thing is just floating-point noise.  The other craft I was experimenting with also started showing it after I dipped it into the atmosphere briefly. 

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