[0.18.18] noise.terrace source code request for mysterious behavior
Posted: Thu Apr 16, 2020 5:31 am
Context: setting a custom richness_expression for iron-ore in a lua mod using the noise.terrace function produces unexpected output.
Function X
Function Y
Output in the attachment.
It looks like in the negative X part of the grid, noise.terrace is just wrong despite it not directly consuming the X coordinate at any point in the Y function. I've tried various combinations and the negative x part of the map just exhibits different behavior than I'm expecting. The positive X portion of the map works as expected.
I would like to see the c++ source of the noise.terrace function to help clear up my misconception for what it's supposed to do because it looks like it's bugged out right now. A few members of the discord with source access tried to disambiguate what it does, but all we got was that noise.terrace(value, 0, 1, math.huge) boils down to a floor() function.
Function X
Code: Select all
...["iron-ore"].autoplace.richness_expression = noise.define_noise_function(function(x, y, tile, map)
return 250 + (250 * noise.terrace(x / 32, 0, 1, math.huge))
end)
Code: Select all
...["iron-ore"].autoplace.richness_expression = noise.define_noise_function(function(x, y, tile, map)
return 250 + (250 * noise.terrace(y / 32, 0, 1, math.huge))
end)
It looks like in the negative X part of the grid, noise.terrace is just wrong despite it not directly consuming the X coordinate at any point in the Y function. I've tried various combinations and the negative x part of the map just exhibits different behavior than I'm expecting. The positive X portion of the map works as expected.
I would like to see the c++ source of the noise.terrace function to help clear up my misconception for what it's supposed to do because it looks like it's bugged out right now. A few members of the discord with source access tried to disambiguate what it does, but all we got was that noise.terrace(value, 0, 1, math.huge) boils down to a floor() function.