Skip to content

FastNoise

PersonTheCat edited this page Jan 16, 2021 · 6 revisions

Background

FastNoise is the backbone behind Cave Generator's most interesting features. It is what enables the mod to generate complex features using a variety of different settings. Cave Generator uses a lightly modified version of this library to provide even more control over the various shapes it produces.

Previewing your caves

The original creator of FastNoise, @Auburn, has also released a preview application which covers the majority of settings used by Cave Generator. You can find it in the readme on the FastNoise page on GitHub.

Here's a quick peak at how the application looks. It can help you understand your changes more quickly and in smaller increments.

FastNoise Preview Application

Note

Cave Generator's implementation of FastNoise has recently gone out of date. As a result, a few of the settings are either missing from the preview application or from Cave Generator itself. I will work on implementing the missing features in a later release.

Using FastNoise in Cave Generator

You may have seen a few specialized implementations of these settings on a previous page about noise generation. Cave Generator divides noise settings into two objects, noise2D and noise3D, which represent the two most important use cases noise generation has in the mod: 2-dimensional and 3-dimensional noise generation. We will outline all of the different settings these features have on this page.

2-dimensional noise settings

Technically, noise2D is ambiguous. It can either be used to generate heightmaps or determine placement based on scale. Depending on which it is doing, not all of the settings may be used. I am hoping to change this in a future version, but I need a clear solution which can easily be converted from current presets.

This table outlines all of the settings found in noise2D. Notice that some of the settings are only used when generating heightmaps, one of them is used for placement, and some are used for both.

Field Type Default Use Description
minVal integer -1 heightmaps The lowest value this generator can produce.
maxVal integer 1 heightmaps The highest value this generator can produce.
scale float 0.5 placement A value 0 - 1. Produces a threshold for placement.
frequency float 1.0 both Waveform frequency of the noise generated.
seed integer both An optional seed used for this generator.

Note

All of these values have defaults, but most objects that use them have overrides to produce better effects. <Todo: link me>

3-dimensional noise settings

This table outlines all of the settings found in noise3D. There is much less ambiguity about what these settings are used for, but there are also a lot of settings.

Field Type Default Description
scale float 0.5 A value of 0 - 1. Produces a threshold for placement.
frequency float 1.0 Waveform frequency of the noise generated.
scaleY float 1.0 Stretches or skews the noise vertically.
lacunarity float 1.0 Octave lacunarity for fractal noise types.
gain float 0.5 Octave gain for fractal noise types.
jitter float 0.45 Cellular point movement for cellular noise types.
jitterX float 0.45 Overrides jitter on the x-axis.
jitterY float 0.45 Overrides jitter on the y-axis.
jitterZ float 0.45 Overrides jitter on the z-axis.
octaves integer 1 Fractal resolution and number of generation passes.
perturb boolean false Whether to apply a gradient perturb and warp the output.
perturbAmp float 1.0 Maximum amount to warp the output when using perturb.
perturbFreq float 0.1 The frequency used by the perturb function.
invert boolean false Whether to completely invert the output of the generator.
type string SimplexFractal The type of noise generation to use.
interp string Hermite The type of interpolation to use.
fractal string FBM The type of fractalization to apply, where applicable.
distFunc string Euclidian The type distance function used with cellular types.
returnType string Distance2 The return type from cellular noise types.
cellularLookup string Simplex The type of noise to use when returnType == NoiseLookup.
seed integer An optional seed for sharing between generators.

Note

All of these values have defaults, but most objects that use them have overrides to produce better effects. <Todo: link me>

Special types

Here's a list of each special type from FastNoise and Cave Generator along with every possible value it can have. These are not case sensitive.

Noise types

These are the possible values you can write for type and cellularLookup.

  • Value
  • ValueFractal
  • Perlin
  • PerlinFractal
  • Simplex
  • SimplexFractal
  • Cellular
  • WhiteNoise
  • Cubic
  • CubicFractal

Interpolation types

These are the possible values you can write for interp.

  • Linear
  • Hermite
  • Quintic

Fractal types

These are the possible values you can write for fractal.

  • FBM
  • Billow
  • RigidMulti

Distance functions

These are the possible values you can write for distFunc.

  • Euclidian
  • Manhattan
  • Natural

Cellular return types

These are the possible values you can write for returnType.

  • CellValue
  • NoiseLookup
  • Distance
  • Distance2
  • Distance2Add
  • Distance2Sub
  • Distance2Mul
  • Distance2Div
  • Distance3
  • Distance3Add
  • Distance3Sub
  • Distance3Mul
  • Distance3Div

Continue reading

Continue to presets: decorations

Clone this wiki locally