Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Razor1994 · May 31, 2020 at 06:32 PM · voxelperlin noisenoiseterrain generation

How can i make this noise generated terrain more interesting?

Hello all,

how can i make the noise for my terrain generation more interesting? The terrain is generated by 3 Perlin-noises which are being combined.

The terrain looks like that (i had to compress the screenshot since it was too big for this thread. The full version can be found at the link below) : alt text Screenshot

As you can see the terrain is bumpy and repeats itself pretty quickly. So i would want some more flat areas in there.

Currently the terrain is generated using 3 Perlin-Noises, here is the code:

The Perlin class is provided by the libnoise C# port.

Setting up the noises:

         baseTerrianLayer = new Perlin();
         baseTerrianLayer.Frequency = 6f;
         baseTerrianLayer.Lacunarity = 1;
         baseTerrianLayer.OctaveCount = 1;
         baseTerrianLayer.Persistence = 1;
 
         secondTerrainLayer = new Perlin();
         secondTerrainLayer.Frequency = 0.02f;
         secondTerrainLayer.Lacunarity = 1;
         secondTerrainLayer.OctaveCount = 1;
         secondTerrainLayer.Persistence = 0.05;
 
         thirdTerrainLayer = new Perlin();
         thirdTerrainLayer.Frequency = 6;
         thirdTerrainLayer.Lacunarity = 4;
         thirdTerrainLayer.OctaveCount = 3;
         thirdTerrainLayer.Persistence = 2;



Now getting the height for each block in each chunk:

                 float n1 = (float)Generator.baseTerrianLayer .GetValue(xCoordinate, 0, zCoordinate);
                 float n2 = (float)Generator.thirdTerrainLayer.GetValue(xCoordinate, 0, zCoordinate);
                 float n3 = (float)Generator.secondTerrainLayer.GetValue(xCoordinate, 0, zCoordinate);
                 float n = (n1 + n2 + n3) / 3f;
 
                 float mappedNoiseValue = Map(0, 120, -1, 1, n);
                 float height = FastFloor(mappedNoiseValue);



Here is the mapping and the fastfloor method:

  float Map(float min, float max, float omin, float omax, float value)
     {
         return Mathf.Lerp(min, max, Mathf.InverseLerp(omin, omax, value));
     }
 
     private static float FastFloor(double f)
     {
         return (f >= 0.0f ? (int)f : (int)f - 1);
     }



I hope that somebody can help me with that!

Thanks in advance
- Damian

unityterrainrezised.jpg (389.4 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by avallsrodriguez2138 · Jan 07 at 09:46 PM

@Razor1994 There are lots of ways to create terrains more dynamic and interesting!


INTRO

You can already start doing it tweaking easy things like giving it a bigger amplitude (aka elevation range), creating mountains and lakes, coloring the landscape based on the vertex heights, and adding a blue plane simulating water

  • JSFiddle Perlin Noise demo: https://jsfiddle.net/alonso2138/7oj8y2fe/33/

If you want to go further, try biomes, biomes can be a really difficult challenge because it is difficult to determine dynamic areas and assign a biome to it thinking that it has to be determined by its neighbor's areas.

Well, don't panic because here you have two approaches you can take to implement biomes into your world:


CLIMATE SIMULATION

This can sound like an extremely difficult approach but it is indeed the easiest one:

Take at least two noise-generated planes different from each other. If you only have one noise function you can play with offset, frequency, and layers to create two different planes. Layers are something important to talk about; you take many noise-generated planes varying the frequency and then mix them up in a new blank one (by iterating through each vertex and mixing the different geometries in different ways; adding dividing subtracting... until you get something you like). These planes will be temperature and humidity simulations, the higher the point in the temperature plane is the hotter the place is. The quality of the climate depends on the processing effort you want to put on and the number of layers/climates simulations you do. Now you have to apply each vertex in your final plane (totally flat and blank) a biome. This is a chart I made to help me with my world creation, but you can create your own one with fewer biomes:

alt text

In my world, the climate simulation plane's elevation amplitude is from -3 to 3 which is why it's based on those values.

The next step is having a special configuration for each biome; ground color, plants, and animals species that can generate in those vertices, and the most important; terrain shape. Look at Minecraft: each biome has a characteristic topography that makes each biome almost unique, it's important because it's the most visual thing. So instead of using a simple noise plane, use a noise-generated plane for each biome with its own options, just like in the climate simulation. After all of this is done, you will notice once you get to the frontier between two biomes that they are not continuous with each other. This is normal as they have different generation algorithms so, the solution is very simple: "weights"! Weights are a way to calculate an average between the two functions to bring them together in a continuous way. For example, you are in a grass biome, everything is pretty flat, if we suppose you are in a full-grass position, then the grass weight is 1 and all the other biomes' weight is 0. Let's say you get closer to a mountain biome, then, the grass weight will get smaller and the mountain biome weight will get bigger (you will notice that the terrain is as the weight changes it becomes more a mountain-like biome) until you get to a point that is totally mountain biome, with a mountain biome weight of 1 and grass biome weight of 0.


VORONOI BIOMES

Sadly I don't master this approach since I find the best one is the climate one but, this approach consists of having a Voronoi or Worley continuous noise function and using those cells as biomes to make their shape of them look dynamic and more organic. Then to determine the cell's biomes you iterate through every cell and check if every biome could be assigned to that cell according to certain rules made by you. For example, mountain biomes have to be at least 2 cells away from beach cells. The using the weights which are already given by the noise; the intensity of the color in each cell to create the transition between both biomes, as you see the white vertices are the center of the cells, where the weight is 1 and the black vertices are the edges of them where the weight is divided into the neighboring cells weights. alt text


CONCLUSION

Sorry for the simplicity of the Voronoi approach I provided but I wasn't able to fully implement it in javascript to give you an example. Anyways, both of them have great potential and can make awesome and realistic landscapes. Just try things until you get what you want. With procedural generation, almost any result works well.


t-temperature-h-humidity-moisture.png (416.0 kB)
image07.jpg (36.1 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

139 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Generating Chunks of Ore Using Perlin Noise 3 Answers

Advice on 2D Surface Terrain Generation Using Noise 1 Answer

Why is my script causing Unity to crash? 1 Answer

[C#] Wondering what is amiss with my 1D Perlin Noise Terrain Generator? 2 Answers

Noise block terrain generation? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges