override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainOcean(x, y, rtgWorld.simplex, river, 40f));
 }
Example #2
0
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainFlatLakes(x, y, rtgWorld.simplex, river, 3f, 66f));
 }
Example #3
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            c       = CliffCalculator.calc(x, z, noise);
                int  cliff = 0;
                bool m     = false;

                Pixel b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth == 0)
                        {
                            float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f;
                            if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p)
                            {
                                cliff = 1;
                            }
                            if (c > cCliff)
                            {
                                cliff = 2;
                            }

                            if (cliff == 1)
                            {
                                if (rand.Next(3) == 0)
                                {
                                    primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                                }
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else if (k < 63)
                            {
                                if (k < 62)
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (simplex.noise2(i / 12f, j / 12f) > mixHeight)
                            {
                                primer.setPixelState(x, k, z, mixPixel);
                                m = true;
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, topPixel);
                            }
                        }
                        else if (depth < 6)
                        {
                            if (cliff == 1)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainHighland(x, y, rtgWorld.simplex, rtgWorld.cell, river, 10f, 68f, hillStrength, _base - 62f));
 }
Example #5
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random rand  = rtgWorld.rand;
            float  c     = CliffCalculator.calc(x, z, noise);
            bool   cliff = c > 1.3f ? true : false;

            for (int k = 255; k > -1; k--)
            {
                Pixel b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (depth > -1 && depth < 12)
                    {
                        if (cliff)
                        {
                            primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                        }
                        else
                        {
                            if (depth > 4)
                            {
                                primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                            }
                            else if (k > 77)
                            {
                                if (rand.Next(5) == 0)
                                {
                                    primer.setPixelState(x, k, z, Pixels.DIRT);
                                }
                                else
                                {
                                    if (depth == 0)
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, fillerPixel);
                                    }
                                }
                            }
                            else if (k < 69)
                            {
                                primer.setPixelState(x, k, z, Pixels.DIRT);
                            }
                            else if (k < 78)
                            {
                                if (depth == 0)
                                {
                                    if (k < 72 && rand.Next(k - 69 + 1) == 0)
                                    {
                                        primer.setPixelState(x, k, z, Pixels.DIRT);
                                    }
                                    else if (rand.Next(5) == 0)
                                    {
                                        primer.setPixelState(x, k, z, Pixels.DIRT);
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                            else
                            {
                                if (depth == 0)
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                        }
                    }
                    else if (k > 63)
                    {
                        primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                    }
                }
            }
        }
Example #6
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random rand = rtgWorld.rand;

            for (int k = 255; k > -1; k--)
            {
                Pixel b = primer.getPixelState(x, k, z).getPixel();

                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (depth == 0 && k > 61)
                    {
                        primer.setPixelState(x, k, z, topPixel);
                    }
                    else if (depth < 4)
                    {
                        primer.setPixelState(x, k, z, fillerPixel);
                    }
                }
            }
        }
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random rand  = rtgWorld.rand;
                float  c     = CliffCalculator.calc(x, z, noise);
                bool   cliff = c > 1.4f ? true : false;

                for (int k = 255; k > -1; k--)
                {
                    Pixel b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (cliff)
                        {
                            if (depth > -1 && depth < 2)
                            {
                                if (rand.Next(3) == 0)
                                {
                                    primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                                }
                            }
                            else if (depth < 10)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                        }
                        else
                        {
                            if (depth == 0 && k > 61)
                            {
                                primer.setPixelState(x, k, z, topPixel);
                            }
                            else if (depth < 4)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
Example #8
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random           rand    = rtgWorld.rand;
            OpenSimplexNoise simplex = rtgWorld.simplex;
            float            p       = simplex.noise2(i / 8f, j / 8f) * 0.5f;
            float            c       = CliffCalculator.calc(x, z, noise);
            int cliff = 0;

            Pixel b;

            for (int k = 255; k > -1; k--)
            {
                b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (depth == 0)
                    {
                        if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p)
                        {
                            cliff = 1;
                        }
                        if (c > 1.5f)
                        {
                            cliff = 2;
                        }
                        if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p)
                        {
                            cliff = 3;
                        }

                        if (cliff == 1)
                        {
                            if (rand.Next(3) == 0)
                            {
                                primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                        }
                        else if (cliff == 2)
                        {
                            primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                        }
                        else if (cliff == 3)
                        {
                            primer.setPixelState(x, k, z, Pixels.SNOW);
                        }
                        else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f)
                        {
                            primer.setPixelState(x, k, z, PixelUtil.getStateDirt(2));
                        }
                        else
                        {
                            primer.setPixelState(x, k, z, Pixels.GRASS);
                        }
                    }
                    else if (depth < 6)
                    {
                        if (cliff == 1)
                        {
                            primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                        }
                        else if (cliff == 2)
                        {
                            primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                        }
                        else if (cliff == 3)
                        {
                            primer.setPixelState(x, k, z, Pixels.SNOW);
                        }
                        else
                        {
                            primer.setPixelState(x, k, z, Pixels.DIRT);
                        }
                    }
                }
            }
        }
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainPlains(x, y, rtgWorld.simplex, river, 160f, 10f, 60f, 200f, 65f));
 }
Example #10
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random           rand    = rtgWorld.rand;
            OpenSimplexNoise simplex = rtgWorld.simplex;
            float            h       = (simplex.noise2(i / valley, j / valley) + 0.25f) * 65f;

            h = h < 1f ? 1f : h;
            float m    = simplex.noise2(i / 12f, j / 12f);
            bool  sand = false;

            Pixel b;

            for (int k = 255; k > -1; k--)
            {
                b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (depth == 0)
                    {
                        if (k > 90f + simplex.noise2(i / 24f, j / 24f) * 10f - h || (m < -0.28f && mix))
                        {
                            primer.setPixelState(x, k, z, Pixels.SAND);
                            //base[x * 16 + z] = RealisticBiomeVanillaBase.vanillaDesert;
                            sand = true;
                        }
                        else if (dirt && m < 0.22f || k < 62)
                        {
                            primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                        }
                        else
                        {
                            primer.setPixelState(x, k, z, topPixel);
                        }
                    }
                    else if (depth < 6)
                    {
                        if (sand)
                        {
                            if (depth < 4)
                            {
                                primer.setPixelState(x, k, z, Pixels.SAND);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, Pixels.SANDSTONE);
                            }
                        }
                        else
                        {
                            primer.setPixelState(x, k, z, fillerPixel);
                        }
                    }
                }
            }
        }
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainGrasslandMountains(x, y, rtgWorld.simplex, rtgWorld.cell, river, 4f, 90f, 67f));
 }
Example #12
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random rand  = rtgWorld.rand;
                float  c     = CliffCalculator.calc(x, z, noise);
                bool   cliff = c > 1.3f;
                Pixel  b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (cliff)
                        {
                            //                    if (!rtgConfig.STONE_SAVANNAS.get()) {
                            primer.setPixelState(x, k, z, CanyonColour.SAVANNA.getPixelForHeight(i, k, j));
                            //                    }
                            //                    else {
                            //                        if (depth > -1 && depth < 2) {
                            //                            if (rand.nextInt(3) == 0) {
                            //
                            //                                primer.setPixelState(x, k, z, hcCobble(world, i, j, x, y, k));
                            //                            }
                            //                            else {
                            //
                            //                                primer.setPixelState(x, k, z, hcStone(world, i, j, x, y, k));
                            //                            }
                            //                        }
                            //                        else if (depth < 10) {
                            //                            primer.setPixelState(x, k, z, hcStone(world, i, j, x, y, k));
                            //                        }
                            //                    }
                        }
                        else
                        {
                            if (k > 74 + grassRaise)
                            {
                                if (depth == 0)
                                {
                                    if (rand.Next(5) == 0)
                                    {
                                        primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                }
                                else if (depth < 4)
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                            else if (depth == 0 && k > 61)
                            {
                                int r = (int)((k - (62 + grassRaise)) / 2f);
                                if (rand.Next(r + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, Pixels.GRASS);
                                }
                                else if (rand.Next((int)(r / 2f) + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (depth < 4)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
Example #13
0
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainPlateau(x, y, rtgWorld.simplex, river, height, border, strength, heightLength, 50f, true));
 }
Example #14
0
        override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
        {
            //float b = simplex.noise2(x / cWidth, y / cWidth) * cHeigth * river;
            //b *= b / cStrength;
            river *= 1.3f;
            river  = river > 1f ? 1f : river;
            float r = rtgWorld.simplex.noise2(x / 100f, y / 100f) * 50f;

            r = r <-7.4f ? -7.4f : r> 7.4f ? 7.4f : r;
            float b = (17f + r) * river;

            float hn = rtgWorld.simplex.noise2(x / 12f, y / 12f) * 0.5f;
            float sb = 0f;

            if (b > 0f)
            {
                sb = b;
                sb = sb <0f ? 0f : sb> 7f ? 7f : sb;
                sb = hn * sb;
            }
            b += sb;

            float cTotal = 0f;
            float cTemp  = 0f;

            for (int i = 0; i < heightLength; i += 2)
            {
                cTemp = 0;
                if (b > height[i] && border > 0.6f + (height[i] * 0.015f) + hn * 0.2f)
                {
                    cTemp  = b > height[i] + height[i + 1] ? height[i + 1] : b - height[i];
                    cTemp *= strength;
                }
                cTotal += cTemp;
            }


            float bn = 0f;

            if (booRiver)
            {
                if (b < 5f)
                {
                    bn = 5f - b;
                    for (int i = 0; i < 3; i++)
                    {
                        bn *= bn / 4.5f;
                    }
                }
            }
            else if (b < 5f)
            {
                bn = (rtgWorld.simplex.noise2(x / 7f, y / 7f) * 1.3f + rtgWorld.simplex.noise2(x / 15f, y / 15f) * 2f) * (5f - b) * 0.2f;
            }

            b += cTotal - bn;

            float floNoise = _base + b;

            floNoise = floNoise < minimumOceanFloor ? minimumOceanFloor : floNoise;

            return(floNoise);
        }
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;

                for (int k = 255; k > -1; k--)
                {
                    Pixel b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth == 0 && k > 0 && k < 63)
                        {
                            mixCheck = simplex.noise2(i / width, j / width);

                            if (mixCheck > height)
                            {
                                primer.setPixelState(x, k, z, mixPixel);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, topPixel);
                            }
                        }
                        else if (depth < 4 && k < 63)
                        {
                            primer.setPixelState(x, k, z, fillerPixel);
                        }
                    }
                }
            }
Example #16
0
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(riverized(height.added(rtgWorld, x, y) + _base, river));
 }
Example #17
0
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainHighland(x, y, rtgWorld.simplex, rtgWorld.cell, river, start, width, height, _base - 62f));
 }
Example #18
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random rand  = rtgWorld.rand;
                float  c     = CliffCalculator.calc(x, z, noise);
                bool   cliff = c > 1.3f;

                for (int k = 255; k > -1; k--)
                {
                    Pixel b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth > -1 && depth < 12)
                        {
                            if (cliff)
                            {
                                primer.setPixelState(x, k, z, CanyonColour.MESA_BRYCE.getPixelForHeight(i, k, j));
                            }
                            else
                            {
                                if (depth > 4)
                                {
                                    primer.setPixelState(x, k, z, CanyonColour.MESA_BRYCE.getPixelForHeight(i, k, j));
                                }
                                else if (k > 74 + grassRaise)
                                {
                                    if (rand.Next(5) == 0)
                                    {
                                        primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                                    }
                                    else
                                    {
                                        if (depth == 0)
                                        {
                                            primer.setPixelState(x, k, z, topPixel);
                                        }
                                        else
                                        {
                                            primer.setPixelState(x, k, z, fillerPixel);
                                        }
                                    }
                                }
                                else if (k < 62)
                                {
                                    primer.setPixelState(x, k, z, Pixels.DIRT);
                                }
                                else if (k < 62 + grassRaise)
                                {
                                    if (depth == 0)
                                    {
                                        primer.setPixelState(x, k, z, Pixels.GRASS);
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, Pixels.DIRT);
                                    }
                                }
                                else if (k < 75 + grassRaise)
                                {
                                    if (depth == 0)
                                    {
                                        int r = (int)((k - (62 + grassRaise)) / 2f);
                                        if (rand.Next(r + 1) == 0)
                                        {
                                            primer.setPixelState(x, k, z, Pixels.GRASS);
                                        }
                                        else if (rand.Next((int)(r / 2f) + 1) == 0)
                                        {
                                            primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                                        }
                                        else
                                        {
                                            primer.setPixelState(x, k, z, topPixel);
                                        }
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, fillerPixel);
                                    }
                                }
                                else
                                {
                                    if (depth == 0)
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, fillerPixel);
                                    }
                                }
                            }
                        }
                        else if (k > 63)
                        {
                            primer.setPixelState(x, k, z, CanyonColour.MESA_BRYCE.getPixelForHeight(i, k, j));
                        }
                    }
                }
            }
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f);
     return(riverized(65f + groundEffect.added(rtgWorld, x, y), river));
 }
Example #20
0
 override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river)
 {
     return(terrainBryce(x, y, rtgWorld.simplex, river, height, border));
 }
 override public void rReplace(Chunk primer, int i, int j, int x, int y, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
 {
     this.rReplaceWithRiver(primer, i, j, x, y, depth, rtgWorld, noise, river, _base);
 }
Example #22
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random           rand       = rtgWorld.rand;
            OpenSimplexNoise simplex    = rtgWorld.simplex;
            bool             water      = false;
            bool             riverPaint = false;
            bool             grass      = false;

            if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.1f) > 0.86f)
            {
                riverPaint = true;

                if (simplex.noise2(i / 12f, j / 12f) > 0.25f)
                {
                    grass = true;
                }
            }

            Pixel b;

            for (int k = 255; k > -1; k--)
            {
                b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (riverPaint)
                    {
                        if (grass && depth < 4)
                        {
                            primer.setPixelState(x, k, z, fillerPixel);
                        }
                        else if (depth == 0)
                        {
                            if (rand.Next(2) == 0)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                            }
                        }
                    }
                    else if (depth > -1 && depth < 9)
                    {
                        primer.setPixelState(x, k, z, Pixels.SNOW);
                        if (depth == 0 && k > 61 && k < 254)
                        {
                            SnowHeightCalculator.calc(x, k, z, primer, noise);
                        }
                    }
                }
                else if (!water && b == Pixels.WATER)
                {
                    primer.setPixelState(x, k, z, Pixels.ICE);
                    water = true;
                }
            }
        }