Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

how to use perlin noise with tilemaps?

Discussion in 'Scripting' started by djc51401, Aug 2, 2020.

  1. djc51401

    djc51401

    Joined:
    Apr 3, 2020
    Posts:
    10
    im trying to procedurally generate 2d top-down islands and i watched a video from sebastian lague that got me a very basic start to it but the problem with it is that the video i used was the gave generation ones and so its only really good for 2 types of blocks. i want to do a perlin noise generation but every tutorial i find is making a 2d texture and then using a single plane to generate the world. How would i use perlin noise in a tilemap so i can make different elevations/ materials?? any helps appreciated!!!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    7,762
    Generally you use it by scaling the average noise "hump" in the noise so that the islands are the right size, and then you sample all the points via the PerlinNoise (2-dimensional input), and if it is greater than 0.5 consider it island, otherwise not.

    You'd need to interject a floodfill step to determine continguousness, and not get islands that go of your sample area.
     
unityunity