Jump to content

[1.8x - 1.11x] Kerbal Weather Project (KWP) v1.0.0


Recommended Posts

KWP has been updated to version 1.0.2. 

What is new?

  • Climate and Weather API for modders (see API documentation).
  • Improved compatibility with FAR and other mods using Modular Flight Integrator
    • KWP will now affect pressure and temperature when used with FAR.

Fixed Issues:

  • Performance improvements
    • Fixed log spamming when leaving Kerbin SOI
    • Resolved weather toggling issue when FAR is installed.
    • Removed unnecessary calls to FI.BaseFIUpdateThermodynamics().
    • Deleted unused classes.
    • Corrected calculation of external shock temperature

 

Edited by cmet24
Link to post
Share on other sites

So, just to be clear, as the OP seems to imply, the plugin read a pre-computed dataset for a specific body and duration (1 year / 5 years), right ?
So what happens when the duration of the data is elapsed ? It cycle back to the beginning ?

Also, you mention specific data at the KSC launchsites. What does that mean ?
What is the difference between places that have this (more precise, I assume) data, and those that don't ?

Regarding performance, took the liberty of quickly profiling this (1.0.2 lite version, ~50 parts ship in atmo) :

NqTTHwS.png

You're consuming about ~0.25 ms per update, which is a bit high for something that just read a bunch of data, but acceptable in the grand scheme of things (the whole game update has a theoretical 20ms budget)
Maybe you could avoid the ~0.10 ms of WxUnityGui.FixedUpdate() when the UI isn't shown ?
Also, that same method seem to be quite part-count dependent (getting ~0.30ms with a 150 part ship)

However, you're allocating 6.4 KB every frame in KerbalWxClimo.FixedUpdate(), which I see very little justification for.
While GC pressure isn't as much an issue as it was before KSP 1.8, avoiding allocations is still very recommended.

Finally, maybe there is some justification but I'm still seeing a significant usage when in space with the UI closed : same CPU usage for WxUnityGui, about half the CPU usage / allocations for KerbalWxClimo

Side note 1, I get a bunch of errors/exceptions in the main menu, when creating a new game :

Spoiler

[ERR 14:18:54.732] Error calling custom SetDifficultyPreset method in type [KerbalWeatherProject_Lite.KerbalWxCustomParams_Sec3, KerbalWeatherProject_Lite.KerbalWxCustomParams_Sec3]:
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Debug:LogError(Object)
    GameParameters:GetDefaultParameters(Modes, Preset)
    MainMenu:UpdatedGameParameters(GameParameters)
    MainMenu:<CreateNewGameDialog>b__67_2(Boolean)
    DialogGUIToggle:<Create>b__15_0(Boolean)
    UnityEngine.EventSystems.EventSystem:Update()
[EXC 14:18:54.733] NotImplementedException: The method or operation is not implemented.
    GameParameters+CustomParameterNode.SetDifficultyPreset (GameParameters+Preset preset) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    GameParameters.GetDefaultParameters (Game+Modes mode, GameParameters+Preset p) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    GameParameters:GetDefaultParameters(Modes, Preset)
    MainMenu:UpdatedGameParameters(GameParameters)
    MainMenu:<CreateNewGameDialog>b__67_2(Boolean)
    DialogGUIToggle:<Create>b__15_0(Boolean)
    UnityEngine.EventSystems.EventSystem:Update()
[ERR 14:18:54.734] Error calling custom SetDifficultyPreset method in type [KerbalWeatherProject_Lite.KerbalWxCustomParams_Sec2, KerbalWeatherProject_Lite.KerbalWxCustomParams_Sec2]:
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Debug:LogError(Object)
    GameParameters:GetDefaultParameters(Modes, Preset)
    MainMenu:UpdatedGameParameters(GameParameters)
    MainMenu:<CreateNewGameDialog>b__67_2(Boolean)
    DialogGUIToggle:<Create>b__15_0(Boolean)
    UnityEngine.EventSystems.EventSystem:Update()
[EXC 14:18:54.735] NotImplementedException: The method or operation is not implemented.
    GameParameters+CustomParameterNode.SetDifficultyPreset (GameParameters+Preset preset) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    GameParameters.GetDefaultParameters (Game+Modes mode, GameParameters+Preset p) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    GameParameters:GetDefaultParameters(Modes, Preset)
    MainMenu:UpdatedGameParameters(GameParameters)
    MainMenu:<CreateNewGameDialog>b__67_2(Boolean)
    DialogGUIToggle:<Create>b__15_0(Boolean)
    UnityEngine.EventSystems.EventSystem:Update()
[ERR 14:18:54.736] Error calling custom SetDifficultyPreset method in type [KerbalWeatherProject_Lite.KerbalWxCustomParams, KerbalWeatherProject_Lite.KerbalWxCustomParams]:
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Debug:LogError(Object)
    GameParameters:GetDefaultParameters(Modes, Preset)
    MainMenu:UpdatedGameParameters(GameParameters)
    MainMenu:<CreateNewGameDialog>b__67_2(Boolean)
    DialogGUIToggle:<Create>b__15_0(Boolean)
    UnityEngine.EventSystems.EventSystem:Update()
[EXC 14:18:54.737] NotImplementedException: The method or operation is not implemented.
    GameParameters+CustomParameterNode.SetDifficultyPreset (GameParameters+Preset preset) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    GameParameters.GetDefaultParameters (Game+Modes mode, GameParameters+Preset p) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    GameParameters:GetDefaultParameters(Modes, Preset)
    MainMenu:UpdatedGameParameters(GameParameters)
    MainMenu:<CreateNewGameDialog>b__67_2(Boolean)
    DialogGUIToggle:<Create>b__15_0(Boolean)
    UnityEngine.EventSystems.EventSystem:Update()

Side note 2, OnGUI errors when clicking some of the main UI buttons (FLIGHT/WIND, etc) :

Spoiler

[ERR 14:35:53.343] GUI Error: You called GUI.Window inside a another window's function. Ensure to call it in a OnGUI code path.
    UnityEngine.GUILayout:Window(Int32, Rect, WindowFunction, String, GUILayoutOption[])
    KerbalWeatherProject_Lite.WxUnityGUI:OnGUI()
    KerbalWeatherProject_Lite.WxUnityGUI:DrawWindow(Int32)
    UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

 

Edited by Gotmachine
Link to post
Share on other sites
4 hours ago, The_Stinky_Broccoli said:

wow. just wow. is this compatible with RO/RSS

Kinda, probably. It will work with any planet pack - it simply applies to whatever's the homeworld. But, since it uses a precomputed data set, it will always apply Kerbin's weather/climate. It should scale with radius, but atmosphere height probably won't scale.

Also, RSS uses a property called cbNameLater which is very uncommonly used in planet packs. It's what allows the things that normally always call the homeworld Kerbin to call Earth Earth, and things like visuals configs do need to be adjusted for that, so there's also a chance that it won't see the planet at all.

Link to post
Share on other sites

I rarely post anything nowdays, but I had to log in to show support. This is one of the best things KSP modding community ever yielded. Amazing work. There have been previous attempts at weather simulations, but this dwarfs all of them.

Link to post
Share on other sites
3 hours ago, mcbmaestro said:

I really hope a seasoned modder steps forward and does some visuals.  I've tried to do mod stuff but I couldn't even make the donut in blender.:(

I’m guessing that people will make KWP and EVE compatible so the clouds will move with the wind, but that’s kinda far in the future.

Link to post
Share on other sites

Hello,

From far, it seems harder to simulate Laythe.

The main reasons are:

  • You cannot suppose that solar irradiation is constant as with the case with Kerbin. Laythe goes into the shadow of Jool. Distance from Kerbol changes due to the fact that it orbits Jool.
  • Laythe is smaller and is farther away from Kerbol : I don't know if the atmosphere would be stable with the simulation (or if it would crash in snowflakes of oxygen) you would need to test several parameters and maybe use more complex models.

But that would be awesome to see this either way!! :-) 

Link to post
Share on other sites
18 hours ago, Fixsme said:

Hello,

From far, it seems harder to simulate Laythe.

The main reasons are:

  • You cannot suppose that solar irradiation is constant as with the case with Kerbin. Laythe goes into the shadow of Jool. Distance from Kerbol changes due to the fact that it orbits Jool.
  • Laythe is smaller and is farther away from Kerbol : I don't know if the atmosphere would be stable with the simulation (or if it would crash in snowflakes of oxygen) you would need to test several parameters and maybe use more complex models.

But that would be awesome to see this either way!! :-) 

Tidal heating would also be significant, and normally it'd be too cold for liquid water so it'd need that tidal heating as well

Link to post
Share on other sites
5 hours ago, WarriorSabe said:

Tidal heating would also be significant, and normally it'd be too cold for liquid water so it'd need that tidal heating as well

Since Laythe's orbit appears to have 0 eccentricity, 0 inclination , and is tidally lock (source KSP wiki): I don't  think you can use tidal heating from Jool (see Tiday heating rate equation). Maybe from other moons?

Link to post
Share on other sites
10 hours ago, Fixsme said:

Since Laythe's orbit appears to have 0 eccentricity, 0 inclination , and is tidally lock (source KSP wiki): I don't  think you can use tidal heating from Jool (see Tiday heating rate equation). Maybe from other moons?

Realistically speaking, Laythe should have eccentricity - you never have zero if other moons are around since those pull on it. Not necessarily very high though; Io only has 0.0041, but that's enough to turn it into a volcanic wasteland.

Link to post
Share on other sites

  There seems to be a compatibility issue between Scatterer and Kerbal Weather Project. I wasn't sure which project I should notify, so I'm posting in both threads.

KSP: 1.11-win-x64

OS: Windows 10 Pro x64, version 1909

GPU: GTX 1080 Ti, driver version 461.09

Mods:

  • Scatterer
  • Kerbal Weather Project
  • Nertea's mods

Symptoms: Entering into a flight will cause both water and sky to stop rendering. Effects will not be restored until after program restart.

Removing KWP solves the issue.

Relevant log snippet (note: EVE is not installed):

Quote

[LOG 15:45:59.035] [Scatterer][Debug] mapping EVE clouds
[EXC 15:45:59.041] ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
    System.Reflection.Assembly.GetTypes () (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
    AssemblyLoader+LoadedAssembly.TypeOperation (System.Action`1[T] action) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    AssemblyLoader+LoadedAssembyList.TypeOperation (System.Action`1[T] action) (at <f8bc9e2b903e48a5b248ab0083c07c62>:0)
    scatterer.ReflectionUtils.getType (System.String name) (at <db4451e6c1fd443c8b762a77e1ee9797>:0)
    scatterer.EVEReflectionHandler.MapEVEClouds () (at <db4451e6c1fd443c8b762a77e1ee9797>:0)
    scatterer.EVEReflectionHandler.Start () (at <db4451e6c1fd443c8b762a77e1ee9797>:0)
    scatterer.Scatterer.Init () (at <db4451e6c1fd443c8b762a77e1ee9797>:0)
    scatterer.Scatterer+<DelayedInit>d__0.MoveNext () (at <db4451e6c1fd443c8b762a77e1ee9797>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[LOG 15:45:59.042] [ModuleManager] Intercepted a ReflectionTypeLoadException. List of broken DLLs:
KerbalWeatherProject 1.0.0.0 GameData\KerbalWeatherProject\KerbalWeatherProject.dll

Full log: https://drive.google.com/file/d/1IO2WMDY-X8ZkxUoUdVC5OpO_W4U0Qfxp/view?usp=sharing

Edited by harbingerdawn
Formatting
Link to post
Share on other sites
2 hours ago, harbingerdawn said:

  There seems to be a compatibility issue between Scatterer and Kerbal Weather Project. I wasn't sure which project I should notify, so I'm posting in both threads.

KSP: 1.11-win-x64

OS: Windows 10 Pro x64, version 1909

GPU: GTX 1080 Ti, driver version 461.09

Mods:

  • Scatterer
  • Kerbal Weather Project
  • Nertea's mods

Symptoms: Entering into a flight will cause both water and sky to stop rendering. Effects will not be restored until after program restart.

Removing KWP solves the issue.

Relevant log snippet (note: EVE is not installed):

Full log: https://drive.google.com/file/d/1IO2WMDY-X8ZkxUoUdVC5OpO_W4U0Qfxp/view?usp=sharing

Interesting, I'm using Kerbal Weather + scatterer + AVP, and not having these issues.  I have seen scatterer (by itself) cause the bug you're experiencing, in the past.. make sure it's updated?

Link to post
Share on other sites
1 hour ago, ss8913 said:

Interesting, I'm using Kerbal Weather + scatterer + AVP, and not having these issues.  I have seen scatterer (by itself) cause the bug you're experiencing, in the past.. make sure it's updated?

It is, I just downloaded it (and everything else). Could it be related to having KWP + scatterer, but not having EVE?

Link to post
Share on other sites
On 1/23/2021 at 7:34 PM, harbingerdawn said:

It is, I just downloaded it (and everything else). Could it be related to having KWP + scatterer, but not having EVE?

no, before i figured out that KWP doesnt' do clouds, I thought EVE/AVP might be conflicting, so i uninstalled that for a couple sessions.. did not see the behavior you described at any time.  Maybe try uninstalling/reinstalling scatterer?  cleaning up any cache that scatterer may or may not use?

Link to post
Share on other sites

This in incredible, I was working all this stuff out by hand.
Does the wind model base itself on 6h kerbin and the sheer quantiy of cells? or does the coriollis ajustment made compensate into being earthlike?

Edited by Spartwo
Link to post
Share on other sites

Maybe you could make a manual for using this mod because I've checked out the website and GitHub and this forum and cant seem to find an actual detailed explanation of how to use it/what each button does. I downloaded it weeks ago, had a bad experience with it just blowing my planes over or freezing them in place before I could use them on the runway. I have a heavily modded install. I just downloaded KWP again, and so far when I try to launch an airplane at KSP runway it loads and then again, is completely stuck in position and won't move no matter what. This time I tried clicking the weather button, and all the sudden I was in the air spinning out of control. Then I tried the climate button and it went insane. I reverted to SPH and tried again. This time I pushed I think climate again, and my game crashed.

I am guessing this mod doesn't work well with BDAc and/or the issues have to do with PhysicsRangeExtender? Again, I have like almost 100 mods on there. I do keep them all up to date as they are updated but obviously we all know that's a mess and so are many of the mods in general. I can send a mod list but I don't know if it would be helpful or not because of how many there are? I've been playing KSP on a consistent and hardcore basis since 2015, but honestly I almost never post on forums and have posted logs once ever. I already restarted the game, so my log is only showing the game loading up. If there is a way to retrieve the log from when it just crashed, I'd love someone to tell me how to get it so I can post it here. Until then, Im just writing this so you're aware of it.. and I realize you cant help without that info.

Regardless, I downloaded your mod because it obviously seems awesome and looks like you put a ton of time and work into it, so I just want to also say thank you and nice job. Now I just need to get it working for me! Haha.

 

Edit: it just crashed again...

Here's the log: https://www.dropbox.com/s/ct9dq5ratb96llv/KSP.log?dl=0 

Mod list: https://www.dropbox.com/s/6xgmss23eboho75/Doc1.pdf?dl=0

 

 

Edited by Cochise
Added log and mod list
Link to post
Share on other sites

KWP has been updated to version 1.0.3. 

Performance Improvements:

  • Removed repetitive/unnecessary OnGUI() calls.
  • Modified WxUnityGui.FixedUpdate() so that data retrieval is only performed when the GUI is active (shown)

Bug Fixes:

  • Added SetDifficultyPreset methods eliminating startup errors in log file.
  • Solved issue with OnGUI errors when selecting main UI buttons
  • Fixed issue with FARAtmosphere delegates
  • Modified ModularFlightIntegrator to ensure aero override is not called when FAR is installed.
  • Corrected typo in file path for binary weather and climate data.

Thanks to @Gotmachine for cataloging  error messages and pointing out performance issues associated with updating the KWP in-game GUI. Also, thanks to @dkavolis for adapting FAR to accommodate third party pressure and temperature values through the FARAtmosphere.

Edited by cmet24
Link to post
Share on other sites
On 1/21/2021 at 3:01 AM, Fixsme said:

Hello,

From far, it seems harder to simulate Laythe.

The main reasons are:

  • You cannot suppose that solar irradiation is constant as with the case with Kerbin. Laythe goes into the shadow of Jool. Distance from Kerbol changes due to the fact that it orbits Jool.
  • Laythe is smaller and is farther away from Kerbol : I don't know if the atmosphere would be stable with the simulation (or if it would crash in snowflakes of oxygen) you would need to test several parameters and maybe use more complex models.

But that would be awesome to see this either way!! :-) 

@Fixsme and @WarriorSabe it might be possible to simulate a Laythe like atmosphere using NASA's ROCKE-3D model which can be used for simulations of Titan's atmosphere. Alternatively, you could attempt to re-create conditions one might expect on Laythe by modifying MPAS orbital and planetary parameters until you end up with a climate congruent with the observed biomes. That said, somethings would be difficult to accurately simulate: like atmospheric tides which would be significant on a moon like Laythe! 

@Cochise Thanks for sharing the log file and mod list. It appears as if the path to the KWP binary weather/climate data was invalid. This should be corrected in the latest release of KWP (v. 1.0.3). If you still run into this issue let me know and I'll see if I can re-create the problem myself.

Link to post
Share on other sites

 

On 1/23/2021 at 3:24 PM, harbingerdawn said:

  There seems to be a compatibility issue between Scatterer and Kerbal Weather Project. I wasn't sure which project I should notify, so I'm posting in both threads.

KSP: 1.11-win-x64

OS: Windows 10 Pro x64, version 1909

GPU: GTX 1080 Ti, driver version 461.09

Mods:

  • Scatterer
  • Kerbal Weather Project
  • Nertea's mods

Symptoms: Entering into a flight will cause both water and sky to stop rendering. Effects will not be restored until after program restart.

Removing KWP solves the issue.

Relevant log snippet (note: EVE is not installed):

Full log: https://drive.google.com/file/d/1IO2WMDY-X8ZkxUoUdVC5OpO_W4U0Qfxp/view?usp=sharing

@harbingerdawn thanks for sharing your log.  I've been unable to reproduce this issue with just Scatter and KWP (v. 1.0.3) installed. I haven't tested scatter and KWP with all of Nertea's mods yet. Do you have all of Nertea's mods installed or just the near future mods? 

Screenshot from KSP 1.11 running KWP 1.0.3 and Scatterer v0.0723 (Default Config + Sunflare)

Kerbal-Space-Program-Screenshot-2021-01-

Edited by cmet24
add screenshot
Link to post
Share on other sites
On 1/30/2021 at 9:26 PM, cmet24 said:

@Fixsme and @WarriorSabe it might be possible to simulate a Laythe like atmosphere using NASA's ROCKE-3D model which can be used for simulations of Titan's atmosphere. Alternatively, you could attempt to re-create conditions one might expect on Laythe by modifying MPAS orbital and planetary parameters until you end up with a climate congruent with the observed biomes. That said, somethings would be difficult to accurately simulate: like atmospheric tides which would be significant on a moon like Laythe! 

@Cochise Thanks for sharing the log file and mod list. It appears as if the path to the KWP binary weather/climate data was invalid. This should be corrected in the latest release of KWP (v. 1.0.3). If you still run into this issue let me know and I'll see if I can re-create the problem myself.

I updated to 1.0.3 ...still having the same problems. Vessel loads on runway, frozen in place. If I hit Toggle KWP, the vessel drops a foot or two and then it is moveable/flyable. But KWP window shows no wind or weather whatsoever. If I hit Toggle KWP again, my vessel starts floating and spinning counter clockwise... and while the control surfaces respond to keystrokes, the craft doesn't respond at all, and is just stuck in the air spinning around slowly. If I try pushing Weather, nothing happens. If I try pushing Climatology, nothing happens. Then if I try pushing Toggle Weather at KSC while stationary on the ground, all of the sudden it's pitch black, you can see through my craft, through Kerbin, and into space, so my plane looks like it's a window to the other side of the planet. If I push the same button while moving or in air, it goes pitch black, and either crashes the game right away or my plane explodes and if I'm lucky I can hit escape and revert to SPH.

I have tried it several times now and can't figure it out. It doesn't help that there's no way to tell if the mod is enabled or not... the window doesn't tell me, and since there is no weather/wind showing up no matter what I push, I can't tell that way either. 

My modded install takes too long to load to have my game keep crashing or for me to keep trying different buttons/sequences like this. Idk what to tell you man. I can post my log again but all I did was update to the new version. Im going to be uninstalling for now. Lmk if you get it working. Hope this was helpful, thats why I'm posting it. 

 

Link to post
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...