Galileo88 / Galileos-Planet-Pack

Galileo's Planet Pack
Other
41 stars 18 forks source link

Incompatible with Scatterer >= 0.767 #70

Closed Tuupertunut closed 3 years ago

Tuupertunut commented 3 years ago

KSP version: 1.12.1 GPP version: 1.6.5.0 as well as latest master (4fecc66)

Description: With Scatterer versions 0.0767 and later, the atmosphere is not visible (black sky). The atmosphere is normal with Scatterer 0.0723. The log is spammed with the following exceptions with 0.0767 and later. There are no such exceptions with 0.0723.

Uploading Crash Report
NullReferenceException: Object reference not set to an instance of an object
  at scatterer.ProlandManager.getDirectionToCelestialBody (CelestialBody target) [0x00000] in <36bf44bca099450cb9f22f4b65b82426>:0 
  at scatterer.SkyNode.UpdateSunflareExtinctions () [0x00032] in <36bf44bca099450cb9f22f4b65b82426>:0 
  at scatterer.SkyNode.UpdateGraphicsUniforms () [0x00095] in <36bf44bca099450cb9f22f4b65b82426>:0 
  at scatterer.SkyNode.OnPreRender () [0x00000] in <36bf44bca099450cb9f22f4b65b82426>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

(Filename: <36bf44bca099450cb9f22f4b65b82426> Line: 0)

Uploading Crash Report
NullReferenceException: Object reference not set to an instance of an object
  at scatterer.SunFlare.updateProperties () [0x00006] in <36bf44bca099450cb9f22f4b65b82426>:0 
  at scatterer.SunflareCameraHook.OnPreRender () [0x0000e] in <36bf44bca099450cb9f22f4b65b82426>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

(Filename: <36bf44bca099450cb9f22f4b65b82426> Line: 0)

There were changes in Scatterer sunflare syntax in 0.0767 that might be causing these problems. https://github.com/LGhassen/Scatterer/releases/tag/0.0767 Although, Scatterer still claims to support the old sunflare syntax.

How to reproduce:

  1. Install GPP 1.6.5.0
  2. Install Scatterer 0.0772
  3. Go to space center view
  4. The sky is black
Tuupertunut commented 3 years ago

I found the issue. Scatterer has changed the way sunflares are discovered. Before they were discovered from the sunflares node in Scatterer_planetsList, but now they are discovered just by listing all Scatterer_sunflare nodes in the config. The star Robau has a Scatterer_sunflare node, so its sunflare was enabled even when the star doesn't exist, this caused scatterer to crash. Adding :NEEDS[GEP,OPM] to the Robau sunflare fixed the issue.

Now there's just one more problem: Ciro is showing the default scatterer sunflare, not the Ciro one.

Tuupertunut commented 3 years ago

Found that one too. The Ciro default sunflare issue is caused by the new sunflare syntax. Scatterer does still support the old syntax but GPP creates the Scatterer_sunflare node for Sun by editing the Scatterer default, which now uses the new syntax. The different syntaxes become mixed and the Scatterer default is used. This is fixed by removing the default Sun sunflare node and creating a new one, instead of editing it.

Tuupertunut commented 3 years ago

I made a PR #71 that fixes this.