Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Perlin noise vs Simplex noise

Discussion in 'Scripting' started by Ghosts_Riley, Jun 15, 2014.

?

Have you played Minecraft?

  1. I've played Minecraft

    93.0%
  2. No I have not played Minecraft

    7.0%
  1. Ghosts_Riley

    Ghosts_Riley

    Joined:
    Dec 7, 2013
    Posts:
    82
    I was wondering which one is better for generating a Minecraft like terrain. I know that Minecraft uses Perlin noise, and Midpoint noise (For height maps), but would Minecraft run faster if it used Simplex noise? I can't really find anything different about the two so I thought maybe someone on the forums uses them. I've read that Simplex noise is faster, but then I've also read that it's not faster than Perlin noise. People say Simplex noise is harder to learn, but the creater of both algorithms (Ken Perlin) says that Simplex was created to be faster than Perlin noise. Thank you for the response in advance.

    One last question...

    Would Minecraft run at an advantage, or disadvantage if it ran in C# instead of JavaScript?
     
  2. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    unless you change the architecture of your code it shouldn't matter, although I'm a js-hater ;-)

    so my answer is YES JS IS WAY SLOWER!!! :D

    what do you mean with run? generate?
     
  3. Ghosts_Riley

    Ghosts_Riley

    Joined:
    Dec 7, 2013
    Posts:
    82
    I mean, overall preformance.
     
  4. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    but the world is generated upfront... so i guess perlin or simplex don't effect runtime, only generating time...
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The type of noise doesn't matter, and isn't anywhere near the bit of code that would be slow. Make the game, then figure it out.
     
  6. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,579
    Just to clarify Simplex noise is faster almost every time. Like its name suggests Simple-x has less and more simple computations than Perlin noise. The higher the number of dimensions the wider the margin will become as Simplex scales better. It is also Isotropic.

    Don't worry about the speed of the noise. Both are good algorithms and I've seen both used back when we made a minecraft terrain generator. Unity has a built in Perlin noise method, so why not pick that one! ;) Plus, its always easy to switch noise out as it is hardly ever deeply intertwined with other code in its generation.
     
  7. HaitzGames

    HaitzGames

    Joined:
    May 1, 2014
    Posts:
    1
    Perlin noise. Simplex is a better algorithm, but it's not such a difference. And the algorithm is quite hard (to say it politely) to understand. Much better to use code you know well what it does. And once you have the whole thing working and debugged, you could always go for the simplex one.

    And as an additional option, let me suggest the article I sent to CodeProject this week :D

    http://www.codeproject.com/Articles/785084/A-generic-lattice-noise-algorithm-an-evolution-of