コード例 #1
0
        private void SetupSwampinessNoise()
        {
            float      freqMultiplier = FreqMultiplier;
            ModuleBase input          = new Perlin((double)(0.09f * freqMultiplier), 2.0, 0.40000000596046448, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase input2         = new RidgedMultifractal((double)(0.025f * freqMultiplier), 2.0, 6, Rand.Range(0, 2147483647), QualityMode.High);

            input           = new ScaleBias(0.5, 0.5, input);
            input2          = new ScaleBias(0.5, 0.5, input2);
            noiseSwampiness = new Multiply(input, input2);
            ModuleBase  module = noiseElevation;
            FloatRange  swampinessMaxElevation = SwampinessMaxElevation;
            float       max = swampinessMaxElevation.max;
            FloatRange  swampinessMaxElevation2 = SwampinessMaxElevation;
            InverseLerp rhs = new InverseLerp(module, max, swampinessMaxElevation2.min);

            noiseSwampiness = new Multiply(noiseSwampiness, rhs);
            ModuleBase  module2 = noiseRainfall;
            FloatRange  swampinessMinRainfall = SwampinessMinRainfall;
            float       min = swampinessMinRainfall.min;
            FloatRange  swampinessMinRainfall2 = SwampinessMinRainfall;
            InverseLerp rhs2 = new InverseLerp(module2, min, swampinessMinRainfall2.max);

            noiseSwampiness = new Multiply(noiseSwampiness, rhs2);
            NoiseDebugUI.StorePlanetNoise(noiseSwampiness, "noiseSwampiness");
        }
コード例 #2
0
        private void SetupSwampinessNoise()
        {
            float      freqMultiplier = WorldGenStep_Terrain.FreqMultiplier;
            ModuleBase input          = new Perlin(0.090000003576278687 * freqMultiplier, 2.0, 0.40000000596046448, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase input2         = new RidgedMultifractal(0.02500000037252903 * freqMultiplier, 2.0, 6, Rand.Range(0, 2147483647), QualityMode.High);

            input  = new ScaleBias(0.5, 0.5, input);
            input2 = new ScaleBias(0.5, 0.5, input2);
            this.noiseSwampiness = new Multiply(input, input2);
            ModuleBase  module = this.noiseElevation;
            FloatRange  swampinessMaxElevation = WorldGenStep_Terrain.SwampinessMaxElevation;
            float       max = swampinessMaxElevation.max;
            FloatRange  swampinessMaxElevation2 = WorldGenStep_Terrain.SwampinessMaxElevation;
            InverseLerp rhs = new InverseLerp(module, max, swampinessMaxElevation2.min);

            this.noiseSwampiness = new Multiply(this.noiseSwampiness, rhs);
            ModuleBase  module2 = this.noiseRainfall;
            FloatRange  swampinessMinRainfall = WorldGenStep_Terrain.SwampinessMinRainfall;
            float       min = swampinessMinRainfall.min;
            FloatRange  swampinessMinRainfall2 = WorldGenStep_Terrain.SwampinessMinRainfall;
            InverseLerp rhs2 = new InverseLerp(module2, min, swampinessMinRainfall2.max);

            this.noiseSwampiness = new Multiply(this.noiseSwampiness, rhs2);
            NoiseDebugUI.StorePlanetNoise(this.noiseSwampiness, "noiseSwampiness");
        }
コード例 #3
0
        private void SetupRainfallNoise()
        {
            float      freqMultiplier = WorldGenStep_Terrain.FreqMultiplier;
            ModuleBase input          = new Perlin(0.014999999664723873 * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, 2147483647), QualityMode.High);

            input = new ScaleBias(0.5, 0.5, input);
            NoiseDebugUI.StorePlanetNoise(input, "basePerlin");
            SimpleCurve simpleCurve = new SimpleCurve();

            simpleCurve.Add(0f, 1.12f, true);
            simpleCurve.Add(25f, 0.94f, true);
            simpleCurve.Add(45f, 0.7f, true);
            simpleCurve.Add(70f, 0.3f, true);
            simpleCurve.Add(80f, 0.05f, true);
            simpleCurve.Add(90f, 0.05f, true);
            ModuleBase moduleBase = new AbsLatitudeCurve(simpleCurve, 100f);

            NoiseDebugUI.StorePlanetNoise(moduleBase, "latCurve");
            this.noiseRainfall = new Multiply(input, moduleBase);
            float      num    = 0.000222222225f;
            float      num2   = (float)(-500.0 * num);
            ModuleBase input2 = new ScaleBias((double)num, (double)num2, this.noiseElevation);

            input2 = new ScaleBias(-1.0, 1.0, input2);
            input2 = new Clamp(0.0, 1.0, input2);
            NoiseDebugUI.StorePlanetNoise(input2, "elevationRainfallEffect");
            this.noiseRainfall = new Multiply(this.noiseRainfall, input2);
            Func <double, double> processor = delegate(double val)
            {
                if (val < 0.0)
                {
                    val = 0.0;
                }
                if (val < 0.12)
                {
                    val = (val + 0.12) / 2.0;
                    if (val < 0.03)
                    {
                        val = (val + 0.03) / 2.0;
                    }
                }
                return(val);
            };

            this.noiseRainfall = new Arbitrary(this.noiseRainfall, processor);
            this.noiseRainfall = new Power(this.noiseRainfall, new Const(1.5));
            this.noiseRainfall = new Clamp(0.0, 999.0, this.noiseRainfall);
            NoiseDebugUI.StorePlanetNoise(this.noiseRainfall, "noiseRainfall before mm");
            this.noiseRainfall = new ScaleBias(4000.0, 0.0, this.noiseRainfall);
            SimpleCurve rainfallCurve = Find.World.info.overallRainfall.GetRainfallCurve();

            if (rainfallCurve != null)
            {
                this.noiseRainfall = new CurveSimple(this.noiseRainfall, rainfallCurve);
            }
        }
コード例 #4
0
        private void SetupVolcanicNoise()
        {
            float      freqMultiplier = FreqMultiplier;
            ModuleBase moduleBase     = new Perlin((double)(0.09f * freqMultiplier), 2.0, 0.40000000596046448, 6, Rand.Range(0, int.MaxValue), QualityMode.High);
            ModuleBase moduleBase2    = new RidgedMultifractal((double)(0.005f * freqMultiplier), 2.0, 6, Rand.Range(0, int.MaxValue), QualityMode.High);

            moduleBase         = new ScaleBias(0.5, 0.5, moduleBase);
            moduleBase2        = new ScaleBias(0.5, 0.5, moduleBase2);
            this.noiseVolcanic = new Multiply(moduleBase, moduleBase2);
            NoiseDebugUI.StorePlanetNoise(this.noiseVolcanic, "noiseVolcanic");
        }
コード例 #5
0
        private void SetupRadiationNoise()
        {
            float      freqMultiplier = FreqMultiplier;
            ModuleBase moduleBase     = new Perlin((double)(0.09f * freqMultiplier), 2.0, 0.40000000596046448, 6, Rand.Range(0, int.MaxValue), QualityMode.High);
            ModuleBase moduleBase2    = new RidgedMultifractal((double)(0.025f * freqMultiplier), 2.0, 6, Rand.Range(0, int.MaxValue), QualityMode.High);

            moduleBase          = new ScaleBias(0.5, 0.5, moduleBase);
            moduleBase2         = new ScaleBias(0.5, 0.5, moduleBase2);
            this.noiseRadiation = new Multiply(moduleBase, moduleBase2);
            InverseLerp rhs = new InverseLerp(this.noiseRadiation, RadMaxElevation.max, RadMaxElevation.min);

            this.noiseRadiation = new Multiply(this.noiseRadiation, rhs);

            NoiseDebugUI.StorePlanetNoise(this.noiseRadiation, "noiseRadiation");
        }
コード例 #6
0
        private void SetupHillinessNoise()
        {
            float freqMultiplier = FreqMultiplier;

            noiseMountainLines = new Perlin(0.025f * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, int.MaxValue), QualityMode.High);
            ModuleBase module = new Perlin(0.06f * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, int.MaxValue), QualityMode.High);

            noiseMountainLines = new Abs(noiseMountainLines);
            noiseMountainLines = new OneMinus(noiseMountainLines);
            module             = new Filter(module, -0.3f, 1f);
            noiseMountainLines = new Multiply(noiseMountainLines, module);
            noiseMountainLines = new OneMinus(noiseMountainLines);
            NoiseDebugUI.StorePlanetNoise(noiseMountainLines, "noiseMountainLines");
            noiseHillsPatchesMacro = new Perlin(0.032f * freqMultiplier, 2.0, 0.5, 5, Rand.Range(0, int.MaxValue), QualityMode.Medium);
            noiseHillsPatchesMicro = new Perlin(0.19f * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, int.MaxValue), QualityMode.High);
        }
コード例 #7
0
        private void SetupHillinessNoise()
        {
            float freqMultiplier = WorldGenStep_Terrain.FreqMultiplier;

            this.noiseMountainLines = new Perlin(0.02500000037252903 * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase module = new Perlin(0.059999998658895493 * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, 2147483647), QualityMode.High);

            this.noiseMountainLines = new Abs(this.noiseMountainLines);
            this.noiseMountainLines = new OneMinus(this.noiseMountainLines);
            module = new Filter(module, -0.3f, 1f);
            this.noiseMountainLines = new Multiply(this.noiseMountainLines, module);
            this.noiseMountainLines = new OneMinus(this.noiseMountainLines);
            NoiseDebugUI.StorePlanetNoise(this.noiseMountainLines, "noiseMountainLines");
            this.noiseHillsPatchesMacro = new Perlin(0.032000001519918442 * freqMultiplier, 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.Medium);
            this.noiseHillsPatchesMicro = new Perlin(0.18999999761581421 * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, 2147483647), QualityMode.High);
        }
コード例 #8
0
        private void SetupHillinessNoise()
        {
            float freqMultiplier = WorldGenStep_Terrain.FreqMultiplier;

            this.noiseMountainLines = new Perlin((double)(0.025f * freqMultiplier), 2.0, 0.5, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase moduleBase = new Perlin((double)(0.06f * freqMultiplier), 2.0, 0.5, 6, Rand.Range(0, 2147483647), QualityMode.High);

            this.noiseMountainLines = new Abs(this.noiseMountainLines);
            this.noiseMountainLines = new OneMinus(this.noiseMountainLines);
            moduleBase = new Filter(moduleBase, -0.3f, 1f);
            this.noiseMountainLines = new Multiply(this.noiseMountainLines, moduleBase);
            this.noiseMountainLines = new OneMinus(this.noiseMountainLines);
            NoiseDebugUI.StorePlanetNoise(this.noiseMountainLines, "noiseMountainLines");
            this.noiseHillsPatchesMacro = new Perlin((double)(0.032f * freqMultiplier), 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.Medium);
            this.noiseHillsPatchesMicro = new Perlin((double)(0.19f * freqMultiplier), 2.0, 0.5, 6, Rand.Range(0, 2147483647), QualityMode.High);
        }
コード例 #9
0
        private void SetupSwampinessNoise()
        {
            float      freqMultiplier = FreqMultiplier;
            ModuleBase input          = new Perlin(0.09f * freqMultiplier, 2.0, 0.40000000596046448, 6, Rand.Range(0, int.MaxValue), QualityMode.High);
            ModuleBase input2         = new RidgedMultifractal(0.025f * freqMultiplier, 2.0, 6, Rand.Range(0, int.MaxValue), QualityMode.High);

            input           = new ScaleBias(0.5, 0.5, input);
            input2          = new ScaleBias(0.5, 0.5, input2);
            noiseSwampiness = new Multiply(input, input2);
            InverseLerp rhs = new InverseLerp(noiseElevation, SwampinessMaxElevation.max, SwampinessMaxElevation.min);

            noiseSwampiness = new Multiply(noiseSwampiness, rhs);
            InverseLerp rhs2 = new InverseLerp(noiseRainfall, SwampinessMinRainfall.min, SwampinessMinRainfall.max);

            noiseSwampiness = new Multiply(noiseSwampiness, rhs2);
            NoiseDebugUI.StorePlanetNoise(noiseSwampiness, "noiseSwampiness");
        }
コード例 #10
0
        private void SetupSwampinessNoise()
        {
            float      freqMultiplier = WorldGenStep_Terrain.FreqMultiplier;
            ModuleBase moduleBase     = new Perlin((double)(0.09f * freqMultiplier), 2.0, 0.40000000596046448, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase moduleBase2    = new RidgedMultifractal((double)(0.025f * freqMultiplier), 2.0, 6, Rand.Range(0, 2147483647), QualityMode.High);

            moduleBase           = new ScaleBias(0.5, 0.5, moduleBase);
            moduleBase2          = new ScaleBias(0.5, 0.5, moduleBase2);
            this.noiseSwampiness = new Multiply(moduleBase, moduleBase2);
            InverseLerp rhs = new InverseLerp(this.noiseElevation, WorldGenStep_Terrain.SwampinessMaxElevation.max, WorldGenStep_Terrain.SwampinessMaxElevation.min);

            this.noiseSwampiness = new Multiply(this.noiseSwampiness, rhs);
            InverseLerp rhs2 = new InverseLerp(this.noiseRainfall, WorldGenStep_Terrain.SwampinessMinRainfall.min, WorldGenStep_Terrain.SwampinessMinRainfall.max);

            this.noiseSwampiness = new Multiply(this.noiseSwampiness, rhs2);
            NoiseDebugUI.StorePlanetNoise(this.noiseSwampiness, "noiseSwampiness");
        }
コード例 #11
0
        private void SetupElevationNoise()
        {
            float      freqMultiplier = WorldGenStep_Terrain.FreqMultiplier;
            ModuleBase lhs            = new Perlin(0.035000000149011612 * freqMultiplier, 2.0, 0.40000000596046448, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase lhs2           = new RidgedMultifractal(0.012000000104308128 * freqMultiplier, 2.0, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase input          = new Perlin(0.11999999731779099 * freqMultiplier, 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase moduleBase     = new Perlin(0.0099999997764825821 * freqMultiplier, 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.High);
            float      num;

            if (Find.World.PlanetCoverage < 0.550000011920929)
            {
                ModuleBase input2 = new DistanceFromPlanetViewCenter(Find.WorldGrid.viewCenter, Find.WorldGrid.viewAngle, true);
                input2     = new ScaleBias(2.0, -1.0, input2);
                moduleBase = new Blend(moduleBase, input2, new Const(0.40000000596046448));
                num        = Rand.Range(-0.4f, -0.35f);
            }
            else
            {
                num = Rand.Range(0.15f, 0.25f);
            }
            NoiseDebugUI.StorePlanetNoise(moduleBase, "elevContinents");
            input = new ScaleBias(0.5, 0.5, input);
            lhs2  = new Multiply(lhs2, input);
            float num2 = Rand.Range(0.4f, 0.6f);

            this.noiseElevation = new Blend(lhs, lhs2, new Const((double)num2));
            this.noiseElevation = new Blend(this.noiseElevation, moduleBase, new Const((double)num));
            if (Find.World.PlanetCoverage < 0.99989998340606689)
            {
                this.noiseElevation = new ConvertToIsland(Find.WorldGrid.viewCenter, Find.WorldGrid.viewAngle, this.noiseElevation);
            }
            this.noiseElevation = new ScaleBias(0.5, 0.5, this.noiseElevation);
            this.noiseElevation = new Power(this.noiseElevation, new Const(3.0));
            NoiseDebugUI.StorePlanetNoise(this.noiseElevation, "noiseElevation");
            double     scale          = (double)WorldGenStep_Terrain.ElevationRange.Span;
            FloatRange elevationRange = WorldGenStep_Terrain.ElevationRange;

            this.noiseElevation = new ScaleBias(scale, (double)elevationRange.min, this.noiseElevation);
        }
コード例 #12
0
        private void SetupElevationNoise()
        {
            float      freqMultiplier = FreqMultiplier;
            ModuleBase lhs            = new Perlin((double)(0.035f * freqMultiplier), 2.0, 0.40000000596046448, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase lhs2           = new RidgedMultifractal((double)(0.012f * freqMultiplier), 2.0, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase input          = new Perlin((double)(0.12f * freqMultiplier), 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase moduleBase     = new Perlin((double)(0.01f * freqMultiplier), 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.High);
            float      num;

            if (Find.World.PlanetCoverage < 0.55f)
            {
                ModuleBase input2 = new DistanceFromPlanetViewCenter(Find.WorldGrid.viewCenter, Find.WorldGrid.viewAngle, invert: true);
                input2     = new ScaleBias(2.0, -1.0, input2);
                moduleBase = new Blend(moduleBase, input2, new Const(0.40000000596046448));
                num        = Rand.Range(-0.4f, -0.35f);
            }
            else
            {
                num = Rand.Range(0.15f, 0.25f);
            }
            NoiseDebugUI.StorePlanetNoise(moduleBase, "elevContinents");
            input = new ScaleBias(0.5, 0.5, input);
            lhs2  = new Multiply(lhs2, input);
            float num2 = Rand.Range(0.4f, 0.6f);

            noiseElevation = new Blend(lhs, lhs2, new Const((double)num2));
            noiseElevation = new Blend(noiseElevation, moduleBase, new Const((double)num));
            if (Find.World.PlanetCoverage < 0.9999f)
            {
                noiseElevation = new ConvertToIsland(Find.WorldGrid.viewCenter, Find.WorldGrid.viewAngle, noiseElevation);
            }
            noiseElevation = new ScaleBias(0.5, 0.5, noiseElevation);
            noiseElevation = new Power(noiseElevation, new Const(3.0));
            NoiseDebugUI.StorePlanetNoise(noiseElevation, "noiseElevation");
            double     scale          = (double)ElevationRange.Span;
            FloatRange elevationRange = ElevationRange;

            noiseElevation = new ScaleBias(scale, (double)elevationRange.min, noiseElevation);
        }
コード例 #13
0
        private void SetupElevationNoise()
        {
            float      freqMultiplier = WorldGenStep_Terrain.FreqMultiplier;
            ModuleBase lhs            = new Perlin((double)(0.035f * freqMultiplier), 2.0, 0.40000000596046448, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase moduleBase     = new RidgedMultifractal((double)(0.012f * freqMultiplier), 2.0, 6, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase moduleBase2    = new Perlin((double)(0.12f * freqMultiplier), 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.High);
            ModuleBase moduleBase3    = new Perlin((double)(0.01f * freqMultiplier), 2.0, 0.5, 5, Rand.Range(0, 2147483647), QualityMode.High);
            float      num;

            if (Find.World.PlanetCoverage < 0.55f)
            {
                ModuleBase moduleBase4 = new DistanceFromPlanetViewCenter(Find.WorldGrid.viewCenter, Find.WorldGrid.viewAngle, true);
                moduleBase4 = new ScaleBias(2.0, -1.0, moduleBase4);
                moduleBase3 = new Blend(moduleBase3, moduleBase4, new Const(0.40000000596046448));
                num         = Rand.Range(-0.4f, -0.35f);
            }
            else
            {
                num = Rand.Range(0.15f, 0.25f);
            }
            NoiseDebugUI.StorePlanetNoise(moduleBase3, "elevContinents");
            moduleBase2 = new ScaleBias(0.5, 0.5, moduleBase2);
            moduleBase  = new Multiply(moduleBase, moduleBase2);
            float num2 = Rand.Range(0.4f, 0.6f);

            this.noiseElevation = new Blend(lhs, moduleBase, new Const((double)num2));
            this.noiseElevation = new Blend(this.noiseElevation, moduleBase3, new Const((double)num));
            if (Find.World.PlanetCoverage < 0.9999f)
            {
                this.noiseElevation = new ConvertToIsland(Find.WorldGrid.viewCenter, Find.WorldGrid.viewAngle, this.noiseElevation);
            }
            this.noiseElevation = new ScaleBias(0.5, 0.5, this.noiseElevation);
            this.noiseElevation = new Power(this.noiseElevation, new Const(3.0));
            NoiseDebugUI.StorePlanetNoise(this.noiseElevation, "noiseElevation");
            this.noiseElevation = new ScaleBias((double)WorldGenStep_Terrain.ElevationRange.Span, (double)WorldGenStep_Terrain.ElevationRange.min, this.noiseElevation);
        }
コード例 #14
0
        private void SetupRainfallNoise()
        {
            float      freqMultiplier = FreqMultiplier;
            ModuleBase input          = new Perlin(0.015f * freqMultiplier, 2.0, 0.5, 6, Rand.Range(0, int.MaxValue), QualityMode.High);

            input = new ScaleBias(0.5, 0.5, input);
            NoiseDebugUI.StorePlanetNoise(input, "basePerlin");
            ModuleBase moduleBase = new AbsLatitudeCurve(new SimpleCurve
            {
                {
                    0f,
                    1.12f
                },
                {
                    25f,
                    0.94f
                },
                {
                    45f,
                    0.7f
                },
                {
                    70f,
                    0.3f
                },
                {
                    80f,
                    0.05f
                },
                {
                    90f,
                    0.05f
                }
            }, 100f);

            NoiseDebugUI.StorePlanetNoise(moduleBase, "latCurve");
            noiseRainfall = new Multiply(input, moduleBase);
            float      num    = 0.000222222225f;
            float      num2   = -500f * num;
            ModuleBase input2 = new ScaleBias(num, num2, noiseElevation);

            input2 = new ScaleBias(-1.0, 1.0, input2);
            input2 = new Clamp(0.0, 1.0, input2);
            NoiseDebugUI.StorePlanetNoise(input2, "elevationRainfallEffect");
            noiseRainfall = new Multiply(noiseRainfall, input2);
            Func <double, double> processor = delegate(double val)
            {
                if (val < 0.0)
                {
                    val = 0.0;
                }
                if (val < 0.12)
                {
                    val = (val + 0.12) / 2.0;
                    if (val < 0.03)
                    {
                        val = (val + 0.03) / 2.0;
                    }
                }
                return(val);
            };

            noiseRainfall = new Arbitrary(noiseRainfall, processor);
            noiseRainfall = new Power(noiseRainfall, new Const(1.5));
            noiseRainfall = new Clamp(0.0, 999.0, noiseRainfall);
            NoiseDebugUI.StorePlanetNoise(noiseRainfall, "noiseRainfall before mm");
            noiseRainfall = new ScaleBias(4000.0, 0.0, noiseRainfall);
            SimpleCurve rainfallCurve = Find.World.info.overallRainfall.GetRainfallCurve();

            if (rainfallCurve != null)
            {
                noiseRainfall = new CurveSimple(noiseRainfall, rainfallCurve);
            }
        }