#Confusion with OpenSimplexNoise and Terrain Generation.

38 messages · Page 1 of 1 (latest)

coarse fulcrum
#

what are the cell indices you are using?

#

the noise function gives back a float value ranging from -1.0 to 1.0, multiplied by twi you have -4.0 to 4.0 , plus 2 : -2.0 to 6.0

#

and the set_cell function expects an int, so it will probably round up the value

#

well, you seem to be using the noise function to call the TileMap's set_cell() function, that is to decide what element of the tileset will be place at that tilemap coordinate

#

the tilemap's cell

#

sorry if i overexplain

#

so thats a grid of cells

#

thank you 🙂

#

to each cell you set a value wich is the number of the tileset element that will fil this cell

#

yes

#

yes

#

if you have 4 tiles you will have values from 0 to 3

#

yes

#

actually my initial calculation was wrong

#

just a sec

coarse fulcrum
#

try with :
noise.period = 2

and

set_cell(x +x_pos, y +y_pos, floor(noise.get_noise_2d(x +x_pos, y +y_pos)*2.0 +2.0))

#

a bit more random

#

the zero doesnt come out often enough

#

i just tried wit noise.octaves = 0

#

it kinds of outputs the zero more often

#

personnaly i would get the initial value from the noise, and then do series of if else statement
its inelegant but it would allow a beter control of the result

#

nice

#

for what prupose ?

#

ok 🙂

#

what i would do :
var n = noise.get_noise_2d(x +x_pos, y +y_pos) var v = 0 if n > -0.3 : v = 1 if n > 0.5 v = 2 else : v = 3 set_cell(x +x_pos, y +y_pos, v)

#

and the you adjust the numbers (n > x) until you have what you like

#

probably easier than to try to tame the noise function

#

yes, in that one

#

you still need the :
for x in range(width) :
for y in range(height)
part

#

lot of bones

#

var v = 0 if n > 0.0 : v = 1 if n > 0.3 v = 2 if n > 0.5 : v = 3

#

sorry there souldnt have been an "else" statement

#

thanks

#

🙂

#

yes

#

now i think its a matter of playing with these values to have something satisfying

#

you're welcome

#

have fun