Skip to content

Commit

Permalink
Release-170 RC1. Remove the biome sampler.
Browse files Browse the repository at this point in the history
  • Loading branch information
R-T-B committed May 29, 2023
1 parent cb017ca commit 9c2de7e
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 176 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ May 29th, 2023
* Additional Content by: Democat3457, Gravitasi, aftokino, KCreator, Padishar, Kragrathea, OvenProofMars, zengei, MrHappyFace, Sigma88, Majiir (CompatibilityChecker), blackrack/LGHassen (shaders/GPL'd scatterer code)
* Much thanks to Sarbian for ModuleManager and ModularFlightIntegrator

New in this latest version release-169:
New in this latest version release-170 RC1:

1.) Hotfix to fix a bug that prevented the previously newly added config variable from being read.
1.) Prerelease testing a moderate refactor to the biome sampler. Performance FPS wise is about the same, but it appears to improve load times. Feedback welcome.

2.) The new refactored biome sampler operates per quad, so the config option "ScatterlatLongDecimalPrecision" is now obsolete. This gives around slightly more than 1km precision on stock Kerbin. Increase subdivision level if needing more precision for scatters or biomes.

3.) As this is a bleeding edge prerelease, some or all of these changes may be rolled back, pending testing.

Known Bugs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"MAJOR": 1,
"MINOR": 12,
"PATCH": 1,
"BUILD": 169
"BUILD": 170
},
"KSP_VERSION_MIN":
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void CreateScatters()
{
// TODO : perf refactor, use biome index/reference instead of name
UnityEngine.Vector2d latLon = modularScatter.body.GetLatitudeAndLongitude(quad.transform.position);
string scatterBiome = PQSMod_BiomeSampler.GetCachedBiome(latLon.x, latLon.y, modularScatter.body);
string scatterBiome = ResourceUtilities.GetBiome(latLon.x, latLon.y, modularScatter.body).name;
if (!modularScatter.allowedBiomes.Contains(scatterBiome))
{
pmCreateQuadScatter.End();
Expand Down
138 changes: 0 additions & 138 deletions src/Kopernicus/Components/PQSMod_BiomeSampler.cs

This file was deleted.

3 changes: 0 additions & 3 deletions src/Kopernicus/Configuration/ConfigReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public class ConfigReader
[Persistent]
public bool ResetFloatingOriginOnKSCReturn = false;
[Persistent]
public int ScatterlatLongDecimalPrecision = 5;
[Persistent]
public string SelectedPQSQuality = PQSCache.PresetList.preset;
[Persistent]
public float SettingsWindowXcoord = 0;
Expand Down Expand Up @@ -105,7 +103,6 @@ public void loadMainSettings()
Debug.Log("EnableAtmosphericExtinction: " + EnableAtmosphericExtinction);
Debug.Log("UseStockMohoTemplate: " + UseStockMohoTemplate);
Debug.Log("ResetFloatingOriginOnKSCReturn: " + ResetFloatingOriginOnKSCReturn);
Debug.Log("ScatterlatLongDecimalPrecision: " + ScatterlatLongDecimalPrecision);
Debug.Log("SettingsWindowXcoord: " + SettingsWindowXcoord);
Debug.Log("SettingsWindowYcoord: " + SettingsWindowYcoord);
}
Expand Down
12 changes: 0 additions & 12 deletions src/Kopernicus/Configuration/PQSLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -694,12 +694,6 @@ public PQSLoader()
PQSROCControl roc = Utility.GetMod<PQSROCControl>(Value);
roc.currentCBName = Value.name;
}

//Add the biome sampler
if (!Utility.HasMod<PQSMod_BiomeSampler>(Value))
{
Utility.AddMod<PQSMod_BiomeSampler>(Value, 0);
}
//Add createColorsFixes
if (!Utility.HasMod<PQSLandControlFixer>(Value))
{
Expand Down Expand Up @@ -828,12 +822,6 @@ public PQSLoader(CelestialBody body)
PQSROCControl roc = Utility.GetMod<PQSROCControl>(Value);
roc.currentCBName = Value.name;
}

//Add the biome sampler
if (!Utility.HasMod<PQSMod_BiomeSampler>(Value))
{
Utility.AddMod<PQSMod_BiomeSampler>(Value, 0);
}
//Add createColorsFixes
if (!Utility.HasMod<PQSLandControlFixer>(Value))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Kopernicus/Constants/CompatibilityChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class CompatibilityChecker : MonoBehaviour
#endif
internal const Int32 VERSION_MINOR_LOWER_LIMIT = 8;
internal const Int32 REVISION = 1;
internal const Int32 KOPERNICUS = 169;
internal const Int32 KOPERNICUS = 170;

public static Boolean IsCompatible()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Kopernicus/Constants/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public static String VersionNumber
get
{
#if (!KSP_VERSION_1_8)
return "Release-169";
return "Release-170";
#else
return "LEGACY18_Release-169";
return "LEGACY18_Release-170";
#endif
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/Kopernicus/Kopernicus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<Compile Include="ShadowMan\Utilities\Shader\RenderTypeFixer.cs" />
<Compile Include="ShadowMan\Utilities\Shader\ShaderProperties.cs" />
<Compile Include="ShadowMan\Utilities\Shader\ShaderReplacer.cs" />
<Compile Include="ToolbarButton.cs" />
<Compile Include="UI\ToolbarButton.cs" />
<Compile Include="Components\DrawTools.cs" />
<Compile Include="Components\HazardousBody.cs" />
<Compile Include="Components\KopernicusHeatManager.cs" />
Expand Down Expand Up @@ -227,7 +227,6 @@
<Compile Include="Components\NativeByteArray.cs" />
<Compile Include="Components\OrbitRendererUpdater.cs" />
<Compile Include="Components\PlanetaryParticle.cs" />
<Compile Include="Components\PQSMod_BiomeSampler.cs" />
<Compile Include="Components\PQSMod_TextureAtlasFixer.cs" />
<Compile Include="Components\Ring.cs" />
<Compile Include="Components\Serialization\SerializableMonoBehaviour.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/Kopernicus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: KSPAssemblyDependency("Kopernicus.Parser", 1, 0)]
[assembly: KSPAssemblyDependency("ModularFlightIntegrator", 1, 0)]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.12.169.0")]
[assembly: AssemblyFileVersion("1.12.170.0")]
[assembly: LogAggregator("GameData/ModuleManager.ConfigCache")]
[assembly: LogAggregator("Logs/Kopernicus/")]
[assembly: LogAggregator("KSP.log")]
2 changes: 0 additions & 2 deletions src/Kopernicus/RuntimeUtility/RuntimeUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,6 @@ private void WriteConfigIfNoneExists()
configFile.WriteLine(" EnableAtmosphericExtinction = False //Whether to use built-in atmospheric extinction effect of lens flares. This is somewhat expensive - O(nlog(n)) on average.");
configFile.WriteLine(" UseStockMohoTemplate = True //Boolean. This uses the stock Moho template with the Mohole bug/feature. Planet packs may customize this as desired. Be aware disabling this disables the Mohole.");
configFile.WriteLine(" ResetFloatingOriginOnKSCReturn = False //Boolean. Enable this for interstaller (LY+) range planet packs to prevent corruption on return to KSC.");
configFile.WriteLine(" ScatterlatLongDecimalPrecision = 5 //Integer. Default 5. Higher values allow for smoother scatter/biome precision, at the cost of performance. Leave untouched if unsure.");
configFile.WriteLine(" SelectedPQSQuality = " + PQSCache.PresetList.preset);
configFile.WriteLine(" SettingsWindowXcoord = 0");
configFile.WriteLine(" SettingsWindowYcoord = 0");
Expand Down Expand Up @@ -1217,7 +1216,6 @@ private void UpdateConfig()
configFile.WriteLine(" EnableAtmosphericExtinction = " + KopernicusConfig.EnableAtmosphericExtinction.ToString() + " //Whether to use built-in atmospheric extinction effect of lens flares. This is somewhat expensive - O(nlog(n)) on average.");
configFile.WriteLine(" UseStockMohoTemplate = " + KopernicusConfig.UseStockMohoTemplate.ToString() + " //Boolean. This uses the stock Moho template with the Mohole bug/feature. Planet packs may customize this as desired. Be aware disabling this disables the Mohole.");
configFile.WriteLine(" ResetFloatingOriginOnKSCReturn = " + KopernicusConfig.ResetFloatingOriginOnKSCReturn.ToString() + " //Boolean. Enable this for interstaller (LY+) range planet packs to prevent corruption on return to KSC.");
configFile.WriteLine(" ScatterlatLongDecimalPrecision = " + KopernicusConfig.ScatterlatLongDecimalPrecision + " //Integer. Default 5. Higher values allow for smoother scatter/biome precision, at the cost of performance. Leave untouched if unsure.");
configFile.WriteLine(" SelectedPQSQuality = " + PQSCache.PresetList.preset);
configFile.WriteLine(" SettingsWindowXcoord = " + KopernicusConfig.SettingsWindowXcoord.ToString());
configFile.WriteLine(" SettingsWindowYcoord = " + KopernicusConfig.SettingsWindowYcoord.ToString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
using static UnityEngine.UIElements.UxmlAttributeDescription;
using System.Security.AccessControl;

namespace Kopernicus
namespace Kopernicus.UI
{

[KSPAddon(KSPAddon.Startup.EveryScene, false)]
public class ToolbarButton : MonoBehaviour
{
Expand Down Expand Up @@ -113,16 +114,6 @@ public void DrawKopernicusWindow(int windowId)
RuntimeUtility.RuntimeUtility.KopernicusConfig.EnableAtmosphericExtinction = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.EnableAtmosphericExtinction, "EnableAtmosphericExtinction: Whether to use built-in atmospheric extinction effect of lens flares. This is somewhat expensive - O(nlog(n)) on average.", toggleStyle);
RuntimeUtility.RuntimeUtility.KopernicusConfig.UseStockMohoTemplate = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.UseStockMohoTemplate, "UseStockMohoTemplate: This uses the stock Moho template with the Mohole bug / feature.Planet packs may customize this as desired.Be aware unchecking this disables the Mohole.", toggleStyle);
RuntimeUtility.RuntimeUtility.KopernicusConfig.ResetFloatingOriginOnKSCReturn = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.ResetFloatingOriginOnKSCReturn, "ResetFloatingOriginOnKSCReturn: Check this for interstaller (LY+) range planet packs to prevent corruption on return to KSC.", toggleStyle);
GUILayout.Label("ScatterlatLongDecimalPrecision: Higher values allow for smoother scatter/biome precision, at the cost of performance. Leave untouched if unsure.", labelStyle);
try
{
RuntimeUtility.RuntimeUtility.KopernicusConfig.ScatterlatLongDecimalPrecision = (int)Convert.ToInt32(GUILayout.TextField(RuntimeUtility.RuntimeUtility.KopernicusConfig.ScatterlatLongDecimalPrecision.ToString()));
}
catch
{
RuntimeUtility.RuntimeUtility.KopernicusConfig.ScatterlatLongDecimalPrecision = 5;
RuntimeUtility.RuntimeUtility.KopernicusConfig.ScatterlatLongDecimalPrecision = (int)Convert.ToInt32(GUILayout.TextField(RuntimeUtility.RuntimeUtility.KopernicusConfig.ScatterlatLongDecimalPrecision.ToString()));
}
GUILayout.Label("EnforcedShaderLevel: A number defining the enforced shader level for the above parameters. 0 = Low, 1 = Medium, 2 = High, 3 = Ultra.", labelStyle);
try
{
Expand Down

0 comments on commit 9c2de7e

Please sign in to comment.