From 16bd45b0664356fe9779f1ff3b49253133ac96b2 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Jul 2022 18:04:37 -0700 Subject: [PATCH 01/23] AtmosNear and AtmosFar do not exist --- NewHorizons/Builder/Body/StarBuilder.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/NewHorizons/Builder/Body/StarBuilder.cs b/NewHorizons/Builder/Body/StarBuilder.cs index 270b9915..8266b9d4 100644 --- a/NewHorizons/Builder/Body/StarBuilder.cs +++ b/NewHorizons/Builder/Body/StarBuilder.cs @@ -16,8 +16,6 @@ namespace NewHorizons.Builder.Body private static Texture2D _colorOverTime; private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); private static readonly int SkyColor = Shader.PropertyToID("_SkyColor"); - private static readonly int AtmosFar = Shader.PropertyToID("_AtmosFar"); - private static readonly int AtmosNear = Shader.PropertyToID("_AtmosNear"); private static readonly int Tint = Shader.PropertyToID("_Tint"); private static readonly int Radius = Shader.PropertyToID("_Radius"); private static readonly int InnerRadius = Shader.PropertyToID("_InnerRadius"); @@ -54,8 +52,6 @@ namespace NewHorizons.Builder.Body foreach (var lod in sunAtmosphere.transform.Find("AtmoSphere").GetComponentsInChildren()) { lod.material.SetColor(SkyColor, starModule.tint.ToColor()); - lod.material.SetColor(AtmosFar, starModule.tint.ToColor()); - lod.material.SetColor(AtmosNear, starModule.tint.ToColor()); lod.material.SetFloat(InnerRadius, starModule.size); lod.material.SetFloat(OuterRadius, starModule.size * OuterRadiusRatio); } From fb48cb69e5b40648fc7994cffe7586e95b2a3d12 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 14 Jul 2022 21:06:56 -0400 Subject: [PATCH 02/23] Fix planet impostor fog --- NewHorizons/Builder/Atmosphere/FogBuilder.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index d5fd4cd1..907b358a 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -7,6 +7,13 @@ namespace NewHorizons.Builder.Atmosphere { private static Texture2D _ramp; + private static readonly int FogTexture = Shader.PropertyToID("_FogTex"); + private static readonly int Tint = Shader.PropertyToID("_Tint"); + private static readonly int Radius = Shader.PropertyToID("_Radius"); + private static readonly int Density = Shader.PropertyToID("_Density"); + private static readonly int DensityExponent = Shader.PropertyToID("_DensityExp"); + private static readonly int ColorRampTexture = Shader.PropertyToID("_ColorRampTex"); + public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo) { if (_ramp == null) _ramp = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/FogColorRamp.png"); @@ -28,14 +35,23 @@ namespace NewHorizons.Builder.Atmosphere MR.allowOcclusionWhenDynamic = true; PlanetaryFogController PFC = fogGO.AddComponent(); + PFC._fogImpostor = MR; PFC.fogLookupTexture = dbPlanetaryFogController.fogLookupTexture; PFC.fogRadius = atmo.fogSize; PFC.fogDensity = atmo.fogDensity; PFC.fogExponent = 1f; - PFC.fogColorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()); + var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()); + PFC.fogColorRampTexture = colorRampTexture; PFC.fogColorRampIntensity = 1f; PFC.fogTint = atmo.fogTint.ToColor(); + MR.material.SetTexture(FogTexture, dbPlanetaryFogController.fogLookupTexture); + MR.material.SetColor(Tint, atmo.fogTint.ToColor()); + MR.material.SetFloat(Radius, atmo.fogSize); + MR.material.SetFloat(Density, atmo.fogDensity); + MR.material.SetFloat(DensityExponent, 1); + MR.material.SetTexture(ColorRampTexture, colorRampTexture); + fogGO.transform.position = planetGO.transform.position; fogGO.SetActive(true); From 123b59b909db3b2bf28c137d9af04148c2ccb25f Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 14 Jul 2022 21:35:51 -0400 Subject: [PATCH 03/23] Kablooey --- NewHorizons/Builder/Atmosphere/FogBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index 907b358a..cae0d014 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -38,6 +38,7 @@ namespace NewHorizons.Builder.Atmosphere PFC._fogImpostor = MR; PFC.fogLookupTexture = dbPlanetaryFogController.fogLookupTexture; PFC.fogRadius = atmo.fogSize; + PFC.lodFadeDistance = PFC.fogRadius * 0.5f; PFC.fogDensity = atmo.fogDensity; PFC.fogExponent = 1f; var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()); @@ -45,7 +46,6 @@ namespace NewHorizons.Builder.Atmosphere PFC.fogColorRampIntensity = 1f; PFC.fogTint = atmo.fogTint.ToColor(); - MR.material.SetTexture(FogTexture, dbPlanetaryFogController.fogLookupTexture); MR.material.SetColor(Tint, atmo.fogTint.ToColor()); MR.material.SetFloat(Radius, atmo.fogSize); MR.material.SetFloat(Density, atmo.fogDensity); From 746f279fc0e4706d6303776c38605640cbf37df5 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 14 Jul 2022 21:44:13 -0400 Subject: [PATCH 04/23] Scale I guess --- NewHorizons/Builder/Atmosphere/FogBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index cae0d014..4de64a9e 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -21,7 +21,7 @@ namespace NewHorizons.Builder.Atmosphere GameObject fogGO = new GameObject("FogSphere"); fogGO.SetActive(false); fogGO.transform.parent = sector?.transform ?? planetGO.transform; - fogGO.transform.localScale = Vector3.one; + fogGO.transform.localScale = Vector3.one * atmo.fogSize; // Going to copy from dark bramble var dbFog = SearchUtilities.Find("DarkBramble_Body/Atmosphere_DB/FogLOD"); From e0a65212e816f91c8306491ebd36fae84bebb396 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 Jul 2022 21:56:25 -0400 Subject: [PATCH 05/23] Reorganize star evolution controller --- .../StarEvolutionController.cs | 130 ++++++++++-------- 1 file changed, 72 insertions(+), 58 deletions(-) diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index 0a0e2024..8edb3ab7 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -55,6 +55,8 @@ namespace NewHorizons.Components.SizeControllers private float maxScale; private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); + private Color _currentColour; + void Start() { var sun = GameObject.FindObjectOfType(); @@ -151,76 +153,88 @@ namespace NewHorizons.Components.SizeControllers if (_proxy != null) _proxy.Die(); } + private void UpdateSupernova() + { + // Reset the scale back to normal bc now its just the supernova scaling itself + destruction and heat volumes + transform.localScale = Vector3.one; + + // Make the destruction volume scale slightly smaller so you really have to be in the supernova to die + if (_destructionVolume != null) _destructionVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius() * 0.9f; + if (_heatVolume != null) _heatVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius(); + + if (Time.time > _supernovaStartTime + 45f) + { + // Just turn off the star entirely + base.gameObject.SetActive(false); + } + } + + private void UpdateMainSequence() + { + var ageValue = _age / (lifespan * 60f); + + // Only do colour transition stuff if they set an end colour + if (EndColour != null) + { + // Use the age if theres no resizing happening, else make it get redder the larger it is or wtv + var t = ageValue; + if (maxScale > 0) t = CurrentScale / maxScale; + _currentColour = Color.Lerp(_startColour, _endColour, t); + supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, t); + } + else + { + _currentColour = _startColour; + } + + if (_flareEmitter != null) _flareEmitter._tint = _currentColour; + } + + private void UpdateCollapse() + { + // When its collapsing we directly take over the scale + var t = _collapseTimer / collapseTime; + CurrentScale = Mathf.Lerp(_collapseStartSize, 0, t); + transform.localScale = Vector3.one * CurrentScale; + _collapseTimer += Time.deltaTime; + + _currentColour = Color.Lerp(_endColour, Color.white, t); + + supernova._surface._materials[0].Lerp(_collapseStartSurfaceMaterial, _collapseEndSurfaceMaterial, t); + + // After the collapse is done we go supernova + if (_collapseTimer > collapseTime) + { + SupernovaStart.Invoke(); + supernova.enabled = true; + _isSupernova = true; + _supernovaStartTime = Time.time; + if (atmosphere != null) atmosphere.SetActive(false); + if (_destructionVolume != null) _destructionVolume._deathType = DeathType.Supernova; + } + } + protected new void FixedUpdate() { _age += Time.deltaTime; - var ageValue = _age / (lifespan * 60f); - // If we've gone supernova and its been 45 seconds that means it has faded out and is gone // The 45 is from the animation curve used for the supernova alpha if (_isSupernova) { - // Reset the scale back to normal bc now its just the supernova scaling itself + destruction and heat volumes - transform.localScale = Vector3.one; - - // Make the destruction volume scale slightly smaller so you really have to be in the supernova to die - if (_destructionVolume != null) _destructionVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius() * 0.9f; - if (_heatVolume != null) _heatVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius(); - - if (Time.time > _supernovaStartTime + 45f) - { - // Just turn off the star entirely - base.gameObject.SetActive(false); - } + UpdateSupernova(); return; } - Color currentColour; - if (!_isCollapsing) { base.FixedUpdate(); - - // Only do colour transition stuff if they set an end colour - if (EndColour != null) - { - // Use the age if theres no resizing happening, else make it get redder the larger it is or wtv - var t = ageValue; - if (maxScale > 0) t = CurrentScale / maxScale; - currentColour = Color.Lerp(_startColour, _endColour, t); - supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, t); - } - else - { - currentColour = _startColour; - } - - if (_flareEmitter != null) _flareEmitter._tint = currentColour; + UpdateMainSequence(); } else { - // When its collapsing we directly take over the scale - var t = _collapseTimer / collapseTime; - CurrentScale = Mathf.Lerp(_collapseStartSize, 0, t); - transform.localScale = Vector3.one * CurrentScale; - _collapseTimer += Time.deltaTime; - - currentColour = Color.Lerp(_endColour, Color.white, t); - - supernova._surface._materials[0].Lerp(_collapseStartSurfaceMaterial, _collapseEndSurfaceMaterial, t); - - // After the collapse is done we go supernova - if (_collapseTimer > collapseTime) - { - SupernovaStart.Invoke(); - supernova.enabled = true; - _isSupernova = true; - _supernovaStartTime = Time.time; - if (atmosphere != null) atmosphere.SetActive(false); - if (_destructionVolume != null) _destructionVolume._deathType = DeathType.Supernova; - return; - } + UpdateCollapse(); + if (_isSupernova) return; } // This is just all the scales stuff for the atmosphere effects @@ -230,8 +244,8 @@ namespace NewHorizons.Components.SizeControllers _fog.lodFadeDistance = CurrentScale * StarBuilder.OuterRadiusRatio / 3f; // The colour thing goes over one - var max = Math.Max(currentColour.g, Math.Max(currentColour.b, currentColour.r)); - var fogColour = currentColour / max / 1.5f; + var max = Math.Max(_currentColour.g, Math.Max(_currentColour.b, _currentColour.r)); + var fogColour = _currentColour / max / 1.5f; fogColour.a = 1f; _fog.fogTint = fogColour; _fog._fogTint = fogColour; @@ -243,9 +257,9 @@ namespace NewHorizons.Components.SizeControllers { lod.material.SetFloat("_InnerRadius", CurrentScale); lod.material.SetFloat("_OuterRadius", CurrentScale * StarBuilder.OuterRadiusRatio); - lod.material.SetColor("_AtmosFar", currentColour); - lod.material.SetColor("_AtmosNear", currentColour); - lod.material.SetColor("_SkyColor", currentColour); + lod.material.SetColor("_AtmosFar", _currentColour); + lod.material.SetColor("_AtmosNear", _currentColour); + lod.material.SetColor("_SkyColor", _currentColour); } } } From 37f59cfca33abf30f9ac753040feda656244a7b1 Mon Sep 17 00:00:00 2001 From: FreezeDriedMangoes Date: Thu, 14 Jul 2022 22:09:40 -0400 Subject: [PATCH 06/23] fixed bramble being visible from outside --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 8e7e3750..0af643bd 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -248,6 +248,7 @@ namespace NewHorizons.Builder.Body var cloak = repelVolume.gameObject.GetComponentInChildren(); cloak.transform.localScale = Vector3.one * 4000f; cloak._sectors = new Sector[] { sector }; + cloak.GetComponent().enabled = true; atmo.SetActive(true); volumes.SetActive(true); From 69b3e405f33f8aed40b2c31354b0393b53e11f94 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 Jul 2022 22:29:33 -0400 Subject: [PATCH 07/23] Organize stars more --- .../StarEvolutionController.cs | 76 ++++++++++--------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index 8edb3ab7..6102027d 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -116,7 +116,7 @@ namespace NewHorizons.Components.SizeControllers _atmosphereRenderers = atmosphere?.transform?.Find("AtmoSphere")?.GetComponentsInChildren(); } - if (WillExplode) GlobalMessenger.AddListener("TriggerSupernova", Die); + if (WillExplode) GlobalMessenger.AddListener("TriggerSupernova", StartCollapse); if (scaleCurve != null) { @@ -134,7 +134,7 @@ namespace NewHorizons.Components.SizeControllers public void OnDestroy() { - if (WillExplode) GlobalMessenger.RemoveListener("TriggerSupernova", Die); + if (WillExplode) GlobalMessenger.RemoveListener("TriggerSupernova", StartCollapse); } public void SetProxy(StarEvolutionController proxy) @@ -143,32 +143,6 @@ namespace NewHorizons.Components.SizeControllers _proxy.supernova.SetIsProxy(true); } - public void Die() - { - _isCollapsing = true; - _collapseStartSize = CurrentScale; - _collapseTimer = 0f; - supernova._surface._materials[0].CopyPropertiesFromMaterial(_collapseStartSurfaceMaterial); - - if (_proxy != null) _proxy.Die(); - } - - private void UpdateSupernova() - { - // Reset the scale back to normal bc now its just the supernova scaling itself + destruction and heat volumes - transform.localScale = Vector3.one; - - // Make the destruction volume scale slightly smaller so you really have to be in the supernova to die - if (_destructionVolume != null) _destructionVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius() * 0.9f; - if (_heatVolume != null) _heatVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius(); - - if (Time.time > _supernovaStartTime + 45f) - { - // Just turn off the star entirely - base.gameObject.SetActive(false); - } - } - private void UpdateMainSequence() { var ageValue = _age / (lifespan * 60f); @@ -203,17 +177,49 @@ namespace NewHorizons.Components.SizeControllers supernova._surface._materials[0].Lerp(_collapseStartSurfaceMaterial, _collapseEndSurfaceMaterial, t); // After the collapse is done we go supernova - if (_collapseTimer > collapseTime) + if (_collapseTimer > collapseTime) StartSupernova(); + } + + private void UpdateSupernova() + { + // Reset the scale back to normal bc now its just the supernova scaling itself + destruction and heat volumes + transform.localScale = Vector3.one; + + // Make the destruction volume scale slightly smaller so you really have to be in the supernova to die + if (_destructionVolume != null) _destructionVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius() * 0.9f; + if (_heatVolume != null) _heatVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius(); + + if (Time.time > _supernovaStartTime + 45f) { - SupernovaStart.Invoke(); - supernova.enabled = true; - _isSupernova = true; - _supernovaStartTime = Time.time; - if (atmosphere != null) atmosphere.SetActive(false); - if (_destructionVolume != null) _destructionVolume._deathType = DeathType.Supernova; + // Just turn off the star entirely + base.gameObject.SetActive(false); } } + public void StartCollapse() + { + Logger.LogVerbose($"{gameObject.transform.root.name} started collapse"); + + _isCollapsing = true; + _collapseStartSize = CurrentScale; + _collapseTimer = 0f; + supernova._surface._materials[0].CopyPropertiesFromMaterial(_collapseStartSurfaceMaterial); + + if (_proxy != null) _proxy.StartCollapse(); + } + + private void StartSupernova() + { + Logger.LogVerbose($"{gameObject.transform.root.name} started supernova"); + + SupernovaStart.Invoke(); + supernova.enabled = true; + _isSupernova = true; + _supernovaStartTime = Time.time; + if (atmosphere != null) atmosphere.SetActive(false); + if (_destructionVolume != null) _destructionVolume._deathType = DeathType.Supernova; + } + protected new void FixedUpdate() { _age += Time.deltaTime; From 444f543e84ac9432be7d3c2f5707549fd6d19d44 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 14 Jul 2022 22:42:24 -0400 Subject: [PATCH 08/23] Fix the last state not showing --- NewHorizons/Components/QuantumPlanet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Components/QuantumPlanet.cs b/NewHorizons/Components/QuantumPlanet.cs index bce7d9a2..2b853b76 100644 --- a/NewHorizons/Components/QuantumPlanet.cs +++ b/NewHorizons/Components/QuantumPlanet.cs @@ -53,7 +53,7 @@ namespace NewHorizons.Components public int GetRandomNewState() { - var range = Enumerable.Range(0, states.Count - 1).Where(i => i != CurrentIndex); + var range = Enumerable.Range(0, states.Count).Where(i => i != CurrentIndex); var index = Random.Range(0, range.Count()); return range.ElementAt(index); } From 861f061e957df957997b89af47c7b83aef2ed957 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 Jul 2022 23:00:28 -0400 Subject: [PATCH 09/23] Prevent star bug at end of life --- .../StarEvolutionController.cs | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index 6102027d..db2ca3db 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -145,16 +145,21 @@ namespace NewHorizons.Components.SizeControllers private void UpdateMainSequence() { - var ageValue = _age / (lifespan * 60f); - // Only do colour transition stuff if they set an end colour if (EndColour != null) { // Use the age if theres no resizing happening, else make it get redder the larger it is or wtv - var t = ageValue; + var t = _age / (lifespan * 60f); if (maxScale > 0) t = CurrentScale / maxScale; - _currentColour = Color.Lerp(_startColour, _endColour, t); - supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, t); + if (t < 1f) + { + _currentColour = Color.Lerp(_startColour, _endColour, t); + supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, t); + } + else + { + _currentColour = _endColour; + } } else { @@ -231,7 +236,7 @@ namespace NewHorizons.Components.SizeControllers UpdateSupernova(); return; } - + if (!_isCollapsing) { base.FixedUpdate(); @@ -242,7 +247,7 @@ namespace NewHorizons.Components.SizeControllers UpdateCollapse(); if (_isSupernova) return; } - + // This is just all the scales stuff for the atmosphere effects if (_fog != null) { @@ -263,9 +268,11 @@ namespace NewHorizons.Components.SizeControllers { lod.material.SetFloat("_InnerRadius", CurrentScale); lod.material.SetFloat("_OuterRadius", CurrentScale * StarBuilder.OuterRadiusRatio); - lod.material.SetColor("_AtmosFar", _currentColour); - lod.material.SetColor("_AtmosNear", _currentColour); - lod.material.SetColor("_SkyColor", _currentColour); + + // These break once it reaches endColour and I have no idea why + //lod.material.SetColor("_AtmosFar", _currentColour); + //lod.material.SetColor("_AtmosNear", _currentColour); + //lod.material.SetColor("_SkyColor", _currentColour); } } } From f34fea66a4bb08d865cdab3833cdebb144317abc Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 Jul 2022 23:08:59 -0400 Subject: [PATCH 10/23] Remove air info, resize ShockLayerRuleset --- NewHorizons/Builder/Atmosphere/AirBuilder.cs | 17 +++++++++++------ .../Builder/Atmosphere/EffectsBuilder.cs | 13 +++++++------ .../External/Modules/AtmosphereModule.cs | 9 --------- NewHorizons/Handlers/PlanetCreationHandler.cs | 12 ++---------- 4 files changed, 20 insertions(+), 31 deletions(-) diff --git a/NewHorizons/Builder/Atmosphere/AirBuilder.cs b/NewHorizons/Builder/Atmosphere/AirBuilder.cs index 2ec48cb4..f9c3c617 100644 --- a/NewHorizons/Builder/Atmosphere/AirBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/AirBuilder.cs @@ -1,10 +1,11 @@ +using NewHorizons.External.Configs; using NewHorizons.External.Modules; using UnityEngine; namespace NewHorizons.Builder.Atmosphere { public static class AirBuilder { - public static void Make(GameObject planetGO, Sector sector, AtmosphereModule.AirInfo info) + public static void Make(GameObject planetGO, Sector sector, PlanetConfig config) { GameObject airGO = new GameObject("Air"); airGO.SetActive(false); @@ -13,7 +14,7 @@ namespace NewHorizons.Builder.Atmosphere SphereCollider sc = airGO.AddComponent(); sc.isTrigger = true; - sc.radius = info.scale; + sc.radius = config.Atmosphere.size; SimpleFluidVolume sfv = airGO.AddComponent(); sfv._layer = 5; @@ -26,15 +27,19 @@ namespace NewHorizons.Builder.Atmosphere ShockLayerRuleset shockLayerRuleset = planetGO.GetComponentInChildren().gameObject.AddComponent(); shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric; shockLayerRuleset._radialCenter = airGO.transform; - shockLayerRuleset._innerRadius = 0; - shockLayerRuleset._outerRadius = info.scale; - if (info.hasOxygen) + var bottom = config.Base.surfaceSize; + var top = config.Atmosphere.size; + + shockLayerRuleset._innerRadius = (bottom + top) / 2f; + shockLayerRuleset._outerRadius = top; + + if (config.Atmosphere.hasOxygen) { airGO.AddComponent(); } - if (info.isRaining) + if (config.Atmosphere.hasRain) { var vref = airGO.AddComponent(); vref._rainDirection = VisorRainEffectVolume.RainDirection.Radial; diff --git a/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs b/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs index 1ff3df9e..0271e8ed 100644 --- a/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs @@ -1,11 +1,12 @@ -using NewHorizons.External.Modules; +using NewHorizons.External.Configs; +using NewHorizons.External.Modules; using NewHorizons.Utility; using UnityEngine; namespace NewHorizons.Builder.Atmosphere { public static class EffectsBuilder { - public static void Make(GameObject planetGO, Sector sector, AtmosphereModule.AirInfo info, float surfaceSize) + public static void Make(GameObject planetGO, Sector sector, PlanetConfig config, float surfaceSize) { GameObject effectsGO = new GameObject("Effects"); effectsGO.SetActive(false); @@ -19,7 +20,7 @@ namespace NewHorizons.Builder.Atmosphere SCG._dynamicCullingBounds = false; SCG._waitForStreaming = false; - if (info.isRaining) + if (config.Atmosphere.hasRain) { var rainGO = GameObject.Instantiate(SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Sector_GDInterior/Effects_GDInterior/Effects_GD_Rain"), effectsGO.transform); rainGO.transform.position = planetGO.transform.position; @@ -29,7 +30,7 @@ namespace NewHorizons.Builder.Atmosphere { new Keyframe(surfaceSize - 0.5f, 0), new Keyframe(surfaceSize, 10f), - new Keyframe(info.scale, 0f) + new Keyframe(config.Atmosphere.size, 0f) }); rainGO.GetComponent()._activeInSector = sector; @@ -37,7 +38,7 @@ namespace NewHorizons.Builder.Atmosphere rainGO.SetActive(true); } - if (info.isSnowing) + if (config.Atmosphere.hasSnow) { var snowGO = new GameObject("SnowEffects"); snowGO.transform.parent = effectsGO.transform; @@ -53,7 +54,7 @@ namespace NewHorizons.Builder.Atmosphere { new Keyframe(surfaceSize - 0.5f, 0), new Keyframe(surfaceSize, 10f), - new Keyframe(info.scale, 0f) + new Keyframe(config.Atmosphere.size, 0f) }); snowEmitter.GetComponent()._activeInSector = sector; diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index c22a4c14..786475f5 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -86,15 +86,6 @@ namespace NewHorizons.External.Modules /// public bool useAtmosphereShader; - // not an actual config thing, rip - public class AirInfo - { - public bool hasOxygen; - public bool isRaining; - public bool isSnowing; - public float scale; - } - [JsonObject] public class CloudInfo { diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index f6e23438..25e1e2e8 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -532,17 +532,9 @@ namespace NewHorizons.Handlers if (body.Config.Atmosphere != null) { - var airInfo = new AtmosphereModule.AirInfo() - { - hasOxygen = body.Config.Atmosphere.hasOxygen, - isRaining = body.Config.Atmosphere.hasRain, - isSnowing = body.Config.Atmosphere.hasSnow, - scale = body.Config.Atmosphere.size - }; - var surfaceSize = body.Config.Base.surfaceSize; - AirBuilder.Make(go, sector, airInfo); + AirBuilder.Make(go, sector, body.Config); if (!string.IsNullOrEmpty(body.Config.Atmosphere?.clouds?.texturePath)) { @@ -551,7 +543,7 @@ namespace NewHorizons.Handlers } if (body.Config.Atmosphere.hasRain || body.Config.Atmosphere.hasSnow) - EffectsBuilder.Make(go, sector, airInfo, surfaceSize); + EffectsBuilder.Make(go, sector, body.Config, surfaceSize); if (body.Config.Atmosphere.fogSize != 0) FogBuilder.Make(go, sector, body.Config.Atmosphere); From e7ecdd632847a7daa01e00ae916575188c7d85ad Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 14 Jul 2022 23:11:35 -0400 Subject: [PATCH 11/23] clouds --- NewHorizons/Builder/Atmosphere/AirBuilder.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/NewHorizons/Builder/Atmosphere/AirBuilder.cs b/NewHorizons/Builder/Atmosphere/AirBuilder.cs index f9c3c617..3336bc59 100644 --- a/NewHorizons/Builder/Atmosphere/AirBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/AirBuilder.cs @@ -28,11 +28,19 @@ namespace NewHorizons.Builder.Atmosphere shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric; shockLayerRuleset._radialCenter = airGO.transform; - var bottom = config.Base.surfaceSize; - var top = config.Atmosphere.size; + if (config.Atmosphere.clouds != null) + { + shockLayerRuleset._innerRadius = config.Atmosphere.clouds.innerCloudRadius; + shockLayerRuleset._outerRadius = config.Atmosphere.clouds.outerCloudRadius; + } + else + { + var bottom = config.Base.surfaceSize; + var top = config.Atmosphere.size; - shockLayerRuleset._innerRadius = (bottom + top) / 2f; - shockLayerRuleset._outerRadius = top; + shockLayerRuleset._innerRadius = (bottom + top) / 2f; + shockLayerRuleset._outerRadius = top; + } if (config.Atmosphere.hasOxygen) { From 3f91f70571a8ed52d134c8f51422fc3fdd402359 Mon Sep 17 00:00:00 2001 From: FreezeDriedMangoes Date: Thu, 14 Jul 2022 23:13:44 -0400 Subject: [PATCH 12/23] fixed screen fog not scaling to the node size and fixed nodes not warping player if they were scaled down too much --- NewHorizons/Patches/BramblePatches.cs | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 NewHorizons/Patches/BramblePatches.cs diff --git a/NewHorizons/Patches/BramblePatches.cs b/NewHorizons/Patches/BramblePatches.cs new file mode 100644 index 00000000..bbd5e33b --- /dev/null +++ b/NewHorizons/Patches/BramblePatches.cs @@ -0,0 +1,31 @@ +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.Patches +{ + [HarmonyPatch] + public class BramblePatches + { + [HarmonyPrefix] + [HarmonyPatch(typeof(SphericalFogWarpVolume), nameof(SphericalFogWarpVolume.IsProbeOnly))] + public static bool SphericalFogWarpVolume_IsProbeOnly(SphericalFogWarpVolume __instance, ref bool __result) + { + __result = false; + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(FogWarpVolume), nameof(FogWarpVolume.GetFogThickness))] + public static bool FogWarpVolume_GetFogThickness(FogWarpVolume __instance, ref float __result) + { + if (__instance is InnerFogWarpVolume sph) __result = sph._exitRadius; + else __result = 50; // 50f is hardcoded as the return value in the base game + + return false; + } + } +} From 7c981b32a43e2930b1f4aeb31bb3b260ff6aa17f Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 14 Jul 2022 23:26:17 -0400 Subject: [PATCH 13/23] Configurable shock speeds --- NewHorizons/Builder/Atmosphere/AirBuilder.cs | 2 ++ NewHorizons/External/Modules/AtmosphereModule.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/NewHorizons/Builder/Atmosphere/AirBuilder.cs b/NewHorizons/Builder/Atmosphere/AirBuilder.cs index 3336bc59..b3cda09b 100644 --- a/NewHorizons/Builder/Atmosphere/AirBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/AirBuilder.cs @@ -27,6 +27,8 @@ namespace NewHorizons.Builder.Atmosphere ShockLayerRuleset shockLayerRuleset = planetGO.GetComponentInChildren().gameObject.AddComponent(); shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric; shockLayerRuleset._radialCenter = airGO.transform; + shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed; + shockLayerRuleset._maxShockSpeed = config.Atmosphere.maxShockSpeed; if (config.Atmosphere.clouds != null) { diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index 786475f5..b0f31bc9 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -86,6 +86,16 @@ namespace NewHorizons.External.Modules /// public bool useAtmosphereShader; + /// + /// Minimum speed that your ship can go in the atmosphere where flames will appear. + /// + [DefaultValue(100f)] public float minShockSpeed = 100f; + + /// + /// Maximum speed that your ship can go in the atmosphere where flames will appear at their brightest. + /// + [DefaultValue(300f)] public float maxShockSpeed = 300f; + [JsonObject] public class CloudInfo { From fab9dcb4e59f14f71c68c0d65989d3ce5c9b4cc1 Mon Sep 17 00:00:00 2001 From: Ben C Date: Thu, 14 Jul 2022 20:27:57 -0700 Subject: [PATCH 14/23] Gorp --- .github/workflows/update_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_release.yml b/.github/workflows/update_release.yml index 7428c467..207995d5 100644 --- a/.github/workflows/update_release.yml +++ b/.github/workflows/update_release.yml @@ -11,7 +11,7 @@ on: jobs: Update_Release: name: Create/Update Release - if: ${{ github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr') }} + if: github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr') runs-on: ubuntu-latest steps: - name: Create/Update Release @@ -26,4 +26,4 @@ jobs: **Generated From PR: ${{ github.event.pull_request.html_url }}** draft: true - prerelease: false \ No newline at end of file + prerelease: false From fc9887e58b03a161648facab576235c26dfaabae Mon Sep 17 00:00:00 2001 From: Ben C Date: Thu, 14 Jul 2022 20:29:12 -0700 Subject: [PATCH 15/23] Remove draft check --- .github/workflows/update_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_release.yml b/.github/workflows/update_release.yml index 207995d5..1bad2aae 100644 --- a/.github/workflows/update_release.yml +++ b/.github/workflows/update_release.yml @@ -11,7 +11,7 @@ on: jobs: Update_Release: name: Create/Update Release - if: github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr') + if: contains(github.event.pull_request.labels.*.name, 'update-pr') runs-on: ubuntu-latest steps: - name: Create/Update Release From 281b93c1fbcc061589e0ea059d656d16ce2a3009 Mon Sep 17 00:00:00 2001 From: FreezeDriedMangoes Date: Thu, 14 Jul 2022 23:30:15 -0400 Subject: [PATCH 16/23] bramble dimension sphere shape now scales with the dimension scale --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 0af643bd..dd472e73 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -235,6 +235,9 @@ namespace NewHorizons.Builder.Body fog._fogRadius *= scale; fog._fogDensity *= scale; + var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume"); + volumesShape.GetComponent().radius *= scale; + // Change fog color if (body.Config.Bramble.dimension.fogTint != null) { From 4cd1eeaa1f71f3572b8b13d2c73660d6f5da4123 Mon Sep 17 00:00:00 2001 From: Ben C Date: Thu, 14 Jul 2022 20:30:46 -0700 Subject: [PATCH 17/23] Fix Release Build Thingy --- .github/workflows/release_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 513d04da..3f202d16 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -22,7 +22,7 @@ on: jobs: Build: - if: ${{ github.ref == 'refs/heads/main' || (github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr')) }} + if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'update-pr') }} uses: ./.github/workflows/build.yaml with: build_type: Release From ce17b48b7c2803d44abdb5f2b9ca313978fb3adb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 15 Jul 2022 03:32:28 +0000 Subject: [PATCH 18/23] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 7e079ea6..c5f9c369 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -286,6 +286,18 @@ "useAtmosphereShader": { "type": "boolean", "description": "Whether we use an atmospheric shader on the planet. Doesn't affect clouds, fog, rain, snow, oxygen, etc. Purely\nvisual." + }, + "minShockSpeed": { + "type": "number", + "description": "Minimum speed that your ship can go in the atmosphere where flames will appear.", + "format": "float", + "default": 100.0 + }, + "maxShockSpeed": { + "type": "number", + "description": "Maximum speed that your ship can go in the atmosphere where flames will appear at their brightest.", + "format": "float", + "default": 300.0 } } }, From e311faed476d6a4184088598f34ecf3bd8fd2bce Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 Jul 2022 23:35:47 -0400 Subject: [PATCH 19/23] Move quantum object validation out of Migrate --- NewHorizons/External/Configs/PlanetConfig.cs | 97 ++++++++++---------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index d4ef8224..7f662072 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -182,6 +182,54 @@ namespace NewHorizons.External.Configs if (Atmosphere?.clouds?.lightningGradient != null) Atmosphere.clouds.hasLightning = true; if (Bramble?.dimension != null && Orbit?.staticPosition == null) throw new Exception($"Dimension {name} must have Orbit.staticPosition defined."); if (Orbit?.staticPosition != null) Orbit.isStatic = true; + + // For each quantum group, verify the following: + // this group's id should be unique + // if type == sockets, group.sockets should not be null or empty + // if type == sockets, count every prop that references this group. the number should be < group.sockets.Count + // if type == sockets, for each socket, if rotation == null, rotation = Vector3.zero + // if type == sockets, for each socket, position must not be null + // For each detail prop, + // if detail.quantumGroupID != null, there exists a quantum group with that id + if (Props?.quantumGroups != null && Props?.details != null) + { + Dictionary existingGroups = new Dictionary(); + foreach (var quantumGroup in Props.quantumGroups) + { + if (existingGroups.ContainsKey(quantumGroup.id)) { Logger.LogWarning($"Duplicate quantumGroup id found: {quantumGroup.id}"); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } + + existingGroups[quantumGroup.id] = quantumGroup; + if (quantumGroup.type == PropModule.QuantumGroupType.Sockets) + { + if (quantumGroup.sockets?.Length == 0) { Logger.LogError($"quantumGroup {quantumGroup.id} is of type \"sockets\" but has no defined sockets."); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } + else + { + foreach (var socket in quantumGroup.sockets) + { + if (socket.rotation == null) socket.rotation = UnityEngine.Vector3.zero; + if (socket.position == null) { Logger.LogError($"quantumGroup {quantumGroup.id} has a socket without a position."); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } + } + } + } + } + + Dictionary existingGroupsPropCounts = new Dictionary(); + foreach (var prop in Props?.details) + { + if (prop.quantumGroupID == null) continue; + if (!existingGroups.ContainsKey(prop.quantumGroupID)) Logger.LogWarning($"A prop wants to be a part of quantum group {prop.quantumGroupID}, but this group does not exist."); + else existingGroupsPropCounts[prop.quantumGroupID] = existingGroupsPropCounts.GetValueOrDefault(prop.quantumGroupID) + 1; + } + + foreach (var quantumGroup in Props.quantumGroups) + { + if (quantumGroup.type == PropModule.QuantumGroupType.Sockets && existingGroupsPropCounts.GetValueOrDefault(quantumGroup.id) >= quantumGroup.sockets?.Length) + { + Logger.LogError($"quantumGroup {quantumGroup.id} is of type \"sockets\" and has more props than sockets."); + quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; + } + } + } } public void Migrate() @@ -258,55 +306,6 @@ namespace NewHorizons.External.Configs if (Base.sphereOfInfluence != 0f) Base.soiOverride = Base.sphereOfInfluence; - // for each quantum group, verify the following: - // this group's id should be unique - // if type == sockets, group.sockets should not be null or empty - // if type == sockets, count every prop that references this group. the number should be < group.sockets.Count - // if type == sockets, for each socket, if rotation == null, rotation = Vector3.zero - // if type == sockets, for each socket, position must not be null - // for each detail prop, - // if detail.quantumGroupID != null, there exists a quantum group with that id - - if (Props?.quantumGroups != null && Props?.details != null) - { - Dictionary existingGroups = new Dictionary(); - foreach (var quantumGroup in Props.quantumGroups) - { - if (existingGroups.ContainsKey(quantumGroup.id)) { NewHorizons.Utility.Logger.LogWarning($"Duplicate quantumGroup id found: {quantumGroup.id}"); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } - - existingGroups[quantumGroup.id] = quantumGroup; - if (quantumGroup.type == PropModule.QuantumGroupType.Sockets) - { - if (quantumGroup.sockets?.Length == 0) { NewHorizons.Utility.Logger.LogError($"quantumGroup {quantumGroup.id} is of type \"sockets\" but has no defined sockets."); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } - else - { - foreach (var socket in quantumGroup.sockets) - { - if (socket.rotation == null) socket.rotation = UnityEngine.Vector3.zero; - if (socket.position == null) { NewHorizons.Utility.Logger.LogError($"quantumGroup {quantumGroup.id} has a socket without a position."); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } - } - } - } - } - - Dictionary existingGroupsPropCounts = new Dictionary(); - foreach (var prop in Props?.details) - { - if (prop.quantumGroupID == null) continue; - if (!existingGroups.ContainsKey(prop.quantumGroupID)) NewHorizons.Utility.Logger.LogWarning($"A prop wants to be a part of quantum group {prop.quantumGroupID}, but this group does not exist."); - else existingGroupsPropCounts[prop.quantumGroupID] = existingGroupsPropCounts.GetValueOrDefault(prop.quantumGroupID)+1; - } - - foreach (var quantumGroup in Props.quantumGroups) - { - if (quantumGroup.type == PropModule.QuantumGroupType.Sockets && existingGroupsPropCounts.GetValueOrDefault(quantumGroup.id) >= quantumGroup.sockets?.Length) - { - NewHorizons.Utility.Logger.LogError($"quantumGroup {quantumGroup.id} is of type \"sockets\" and has more props than sockets."); - quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; - } - } - } - // Moved a bunch of stuff off of shiplog module to star system module because it didnt exist when we made this if (ShipLog != null) { From 50b3094a91bdb457a17775a16a8acd93019c6809 Mon Sep 17 00:00:00 2001 From: Ben C Date: Thu, 14 Jul 2022 20:36:03 -0700 Subject: [PATCH 20/23] Fix Release Build Again --- .github/workflows/release_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 3f202d16..f90bb8ee 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -43,7 +43,7 @@ jobs: Update_Release: name: 'Create/Update Release Asset' needs: Build - if: ${{ github.ref != 'refs/heads/main' && github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr') }} + if: ${{ github.ref != 'refs/heads/main' && contains(github.event.pull_request.labels.*.name, 'update-pr') }} runs-on: ubuntu-latest steps: - name: Download Asset From 64810344b8ca345a2ae7da5fe6ed98d19c124688 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Jul 2022 20:45:14 -0700 Subject: [PATCH 21/23] remove AtmosFar BRUH --- .../Components/SizeControllers/StarEvolutionController.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index db2ca3db..2da729c6 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -270,8 +270,6 @@ namespace NewHorizons.Components.SizeControllers lod.material.SetFloat("_OuterRadius", CurrentScale * StarBuilder.OuterRadiusRatio); // These break once it reaches endColour and I have no idea why - //lod.material.SetColor("_AtmosFar", _currentColour); - //lod.material.SetColor("_AtmosNear", _currentColour); //lod.material.SetColor("_SkyColor", _currentColour); } } From dd9f2560beca4f4ac1aeaaa0c06d7a0bad17811c Mon Sep 17 00:00:00 2001 From: FreezeDriedMangoes Date: Thu, 14 Jul 2022 23:49:17 -0400 Subject: [PATCH 22/23] fixed fog backdrop being missing --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index dd472e73..e7417503 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -253,6 +253,11 @@ namespace NewHorizons.Builder.Body cloak._sectors = new Sector[] { sector }; cloak.GetComponent().enabled = true; + // fix the fog backdrop + atmo.GetComponent()._sector = sector; + atmo.GetComponent()._sector = sector; + + // finalize atmo.SetActive(true); volumes.SetActive(true); effects.SetActive(true); From a330856fc882f55472ced3b72da1cc83a2fa7660 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Jul 2022 20:58:41 -0700 Subject: [PATCH 23/23] enable le sphere shape so it all works --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index e7417503..237335bb 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -236,7 +236,9 @@ namespace NewHorizons.Builder.Body fog._fogDensity *= scale; var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume"); - volumesShape.GetComponent().radius *= scale; + var sphereShape = volumesShape.GetComponent(); + sphereShape.enabled = true; // this starts disabled for some fucking reason + sphereShape.radius *= scale; // Change fog color if (body.Config.Bramble.dimension.fogTint != null)