Module noisemanager

The NoiseManager manages seeds and creates PRNG of various kinds, always with a new, unique seed.

The seed is incremented with each creation, so it is guaranteed that the results are reproducable.

Functions

NoiseManager:new (start_seed, size_x, size_y, size_z) Creates a new instance of NoiseManager.
NoiseManager:get_noise (octaves, persistence, scale) Creates a Perlin object with the given values.
NoiseManager:get_next_seed () Gets the next seed that will be used.
NoiseManager:get_pcgrandom () Creates a PcgRandom object.
NoiseManager:get_random () Creates a PseudoRandom object.


Functions

NoiseManager:new (start_seed, size_x, size_y, size_z)
Creates a new instance of NoiseManager.

Parameters:

  • start_seed Optional. The initial seed value, defaults to 0.
  • size_x Optional. The map size in the x direction, defaults to the mapchunk size (see blockutil.MAPCHUNK_SIZE).
  • size_y Optional. The map size in the y direction, defaults to size_x.
  • size_z Optional. The map size in the z direction, defaults to size_z.

Returns:

    A new instance of NoiseManager.
NoiseManager:get_noise (octaves, persistence, scale)
Creates a Perlin object with the given values.

Parameters:

  • octaves The count of octaves.
  • persistence The persistence values.
  • scale The scale.

Returns:

    The new Perlin object.
NoiseManager:get_next_seed ()
Gets the next seed that will be used. Does not increment the counter.

Returns:

    The next seed that will be used.
NoiseManager:get_pcgrandom ()
Creates a PcgRandom object.

Returns:

    The new PcgRandom object.
NoiseManager:get_random ()
Creates a PseudoRandom object.

Returns:

    The new PseudoRandom object.
generated by LDoc 1.4.2