#math.noise not returning value between -1 and 1

40 messages · Page 1 of 1 (latest)

fossil rapids
#

math.noise is not returning values between 1 and -1 for me whenever i try to print temperature
relevant code snippet:

local grid = {}

for x = 1, X do
    grid[x] = {}
    
    for z = 1, Z do
        grid[x][z] = {
            height = math.noise(x/frequencyHeight, z/frequencyHeight) * scaleHeight, 
            temperature = math.noise(x/frequencyTemperature, z/frequencyTemperature) * scaleTemperature
        }
    end
end

frequency = 1, scale = 1: prints -0 and 0
frequency = 1, scale = 10: prints between -5 and 5

rocky flicker
#

math.noise is a bit between -0.5 and 0.5
but can go a bit higher than that like 0.502

#

to get -1 - 1 you can just do *2

civic shuttle
#

was information

#

from

#

before

#

but its -1 and 1

#

on their docs

fossil rapids
#

for: temperature = math.noise(x, z) * 2
this gets printed:
20:57:38.662 ▶ 0 (x78) - Server - Script:35
20:57:38.680 -0 - Server - Script:35
20:57:38.681 ▶ 0 (x237) - Server - Script:35
20:57:38.738 -0 - Server - Script:35
20:57:38.738 ▶ 0 (x243) - Server - Script:35
20:57:38.797 -0 - Server - Script:35
20:57:38.797 ▶ 0 (x153) - Server - Script:35 20:57:38.662 ▶ 0 (x78) - Server - Script:35
20:57:38.680 -0 - Server - Script:35
20:57:38.681 ▶ 0 (x237) - Server - Script:35
20:57:38.738 -0 - Server - Script:35
20:57:38.738 ▶ 0 (x243) - Server - Script:35
20:57:38.797 -0 - Server - Script:35
20:57:38.797 ▶ 0 (x153) - Server - Script:35

rocky flicker
#
civic shuttle
#

to normalize it

#

instead

#

or

#

u might just have the impression

#

actually no since u mentioned

#

what it prints

rocky flicker
#

do x/10 or something

civic shuttle
#

just /2

#

is proabably

#

enough

#

but idk

#
local grid = {}

for x = 1, X do
    grid[x] = {}
    
    for z = 1, Z do
        local noiseHeight = math.noise(x/frequencyHeight, z/frequencyHeight)
        local noiseTemperature = math.noise(x/frequencyTemperature, z/frequencyTemperature)
        
        local normalizedHeight = (noiseHeight + 1) / 2
        local normalizedTemperature = (noiseTemperature + 1) / 2
        
        grid[x][z] = {
            height = normalizedHeight * scaleHeight, 
            temperature = normalizedTemperature * scaleTemperature
        }
    end
end
rocky flicker
#

no, jet me just google the name...

civic shuttle
#

oki

rocky flicker
#

ok, cant find the name of what its called
but it needs to be divided
like math.noise(x/10, y)

#

since frequency is 1
youre not dividing it
just change frequency
@fossil rapids

civic shuttle
#

gamer

#

when robbe see a grid or anything that will help generation

#

its his domain

icy tangle
civic shuttle
#

so hard theories

#

so good help given

#

and someone come and say this

icy tangle
#

lol

rocky flicker
#

its noise * 2

gaunt flax