I've been working all day at learning perlin and other methods for generating terrain. I have a 2d top-down game and I need to generate random regions of connected colors. I've been playing with existing implementations - some worked very well, some didn't. My main problem was that several implementations were very inconsistent and were not returning the same noise number for a coordinate - something that's important to me.
I finally landed on an implementation of Simplex I like, and with all of my tests it's generating the same noise value for every coordinate properly.
However, the noise values are doubles with unknown ranges, for example:
x:1525 y:1125 Noise: 0.0
x:1525 y:1150 Noise: 0.2764424964813472
x:1525 y:1175 Noise: 0.02497111685822111
x:1525 y:1200 Noise: 0.22943575651784293
x:1525 y:1225 Noise: -0.498659492513381
x:1525 y:1250 Noise: -0.9257368870408553
x:1525 y:1275 Noise: 0.2976243577485172
I have a list of a dozen initial tile colors and am stumped as to best way to ensure that I can safely choose a color from the range based on the noise value.
Secondary question if possible - if anyone knows how I can change the above class to compute the noise values by using a seed (to eventually allow people to generate specific maps with known seeds)