libtcoddocumentation

9.2. Choosing a noise type

Choosing a noise type

Use this function to define the default algorithm used by the noise functions.
The default algorithm is simplex. It's much faster than Perlin, especially in 4 dimensions. It has a better contrast too.

void TCODNoise::setType(TCOD_noise_type_t type)

void TCOD_noise_set_type(TCOD_noise_t noise, TCOD_noise_type_t type)

noise_set_type(noise, type)

void TCODNoise::setType(type)

ParameterDescription
noiseIn the C version, the generator handler, returned by the initialization function.
typeThe algorithm to use, either TCOD_NOISE_SIMPLEX, TCOD_NOISE_PERLIN or TCOD_NOISE_WAVELET.
Example:

TCODNoise * noise1d = new TCODNoise(1);
noise1d->setType(TCOD_NOISE_PERLIN);

TCOD_noise_t noise1d = TCOD_noise_new(1,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY,NULL);
TCOD_noise_set_type(noise1d,TCOD_NOISE_PERLIN);

noise1d = libtcod.noise_new(1)
libtcod.noise_set_type(noise1d,libtcod.NOISE_PERLIN)