How do I "flatten the curve" on Noise (perlin/classic2d)?

0 favourites
  • 9 posts
From the Asset Store
Sound effects of monsters, ghosts, beasts and more
  • After normalizing the values to a 0-100 range, I get this curve on the perlin/classic2D.

    On the left are the ranges, as in 0_9 is from 0 to 9, and on the right the percentage.

    But I suck at math, so what do I have to learn to make this curve more linear, meaning I want to make values equally proportional across the board, "flatten the curve" I guess, e.g. like 10% per range.

    EDIT: I did some research and I guess this is a bell curve, or a gaussian, but when researching "how to flatten a bell curve formula" I had no success.

    Tagged:

  • You can adjust your ranges instead. If you use the chart I posted in your previous post regarding noise, you can get a pretty good approximation - 0-0.382 will contain roughly 10% of the returned values, 0.382-0.437 will be the next 10%, 0.437-0.462 will have your next 10%, ect. Edit: This is without normalization, which you shouldn't need.

    dropbox.com/s/60uu0inwekr2iaf/classic2d-percentagedistribution.PNG

  • I didn't really understand your answer tbh. What should I get from this table you provided?

    My point on flattening the Perlin noise is to get terrain generation (meaning I still need numbers to be close to its neighbours), but without the distinction between common and rare occurences.

    The answer I'm seeking is most likely a formula that gets values from a range (which is definitely needed since Perlin noise diverges further from 0 and 100 the more octaves you use) and transforms it into something linear.

    EDIT: the distribution of your values seems to fix my issue now that I payed more attention, but how did you get these numbers in this table?

  • I took a sample of 10m perlin noise values, sorted them, and recorded the threshold value for each percent of total samples.

    There will be some variation no matter what (that's why 50% isn't at exactly 0.5), but statistically speaking it should be close enough to not have any noticable difference in practice.

  • can I look at the file you did that. That's exactly what I'm unable to do.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ok. Im gonna have to take some time and study what you did, but you definitely solved the issue, thank you so much!

    EDIT: For future reference, since the file might be lost in the future. Oosyrag's solution is the following:

  • oosyrag I thought you might be interested in this.

    After some testing, I observed that if you only check X OR Y axis when creating the prob table, you get discrepant values when applying to both axis, as in a map for example, so the only thing I changed was testing in X AND Y when creating the table.

    For future reference, this is the final product if someone needs it for 2 axis.

  • As I've mentioned before, the values will change even if you run it on the same axis multiple times (x y or z even), but the distribution should be similar in the long run. For more consistent results, increase the sample size.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)