diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index 7cebe35..64aa296 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -505,7 +505,7 @@ Applies 2D noise to the terrain in the defined region. Like `//erode`, this comm Parameter | Type | Default Value | Description ------------|-----------|---------------|----------------------- -algorithm | `string` | perlin | The 2D noise algorithm to apply - see below. +algorithm | `string` | perlinmt | The 2D noise algorithm to apply - see below. apply | `string|integer` | 5 | How to apply the noise to the terrain - see below. scalex | `float` | 1 | The scale of the noise on the x axis. scaley | `float` | 1 | The scale of the noise on the y axis. @@ -528,7 +528,8 @@ The following algorithms are currently available: Algorithm | Description ------------|-------------------------- -`perlin` | Perlin noise. Functional, but currently contains artefacts I'm having difficulty tracking down. +`perlinmt` | **Default**.Perlin noise, backed by Minetest's inbuilt `PerlinNoise` class. +`perlin` | Perlin noise, backed by a pure Lua perlin noise implementation. Functional, but currently contains artefacts I'm having difficulty tracking down. `sin` | A sine wave created with `math.sin()`. `white` | Random white noise. `red` | Red noise - has a lower frequency than white noise. Ref [Noise Functions and Map Generation by Red Blob Games](https://www.redblobgames.com/articles/noise/introduction.html). @@ -654,6 +655,21 @@ As with `//ellipsoidapply` for advanced users `//multi` is also supported - but ``` +## `//noiseapply2d ` +Like [`//ellipsoidapply`](#ellipsoidapply), but instead only keeps changes where a noise function (defaults to `perlinmt`, see [`//noise2d`](#noise2d)) returns a value greater than a given threshold value. + +Also takes a scale value that controls the scale of the noise - -higher values result in smaller "blobs". If you're operating on small areas, then a value of at least 10 is advised as "blobs" are by default on the scale of ~50 nodes. + +As with `//ellipsoidapply` for advanced users `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they be kept regardless, as `//noiseapply2d` only applies the masking to the nodes in the defined region. + +Any suggestions on how to provide more customisability without making this command more difficult to use or significantly more inconsistent with other `//*apply` functions are welcome - please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new). + +```weacmd +//noiseapply2d 0.5 10 set dirt +//noiseapply2d 0.4 3 layers dirt_with_snow dirt 3 stone 10 +``` + + ## `//scol [ ] ` Short for _select column_. Sets the pos2 at a set distance along 1 axis from pos1. If the axis isn't specified, defaults the direction you are facing. Implementation thanks to @VorTechnix. diff --git a/README.md b/README.md index fcfc505..e49deca 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ The detailed explanations have moved! Check them out [here](https://github.com/s - [`//fillcaves []`](https://worldeditadditions.mooncarrot.space/Reference/#fillcaves) - [`//convolve [[,]] []`](https://worldeditadditions.mooncarrot.space/Reference/#convolve) - [`//erode [ [ []] [ []] ...]`](https://worldeditadditions.mooncarrot.space/Reference/#erode) **experimental** + - [`//noise2d [ []] [ []] ...]`](https://worldeditadditions.mooncarrot.space/Reference/#noise2d) ### Flora - [`//bonemeal [ []]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#bonemeal-strength-chance) @@ -82,7 +83,7 @@ The detailed explanations have moved! Check them out [here](https://github.com/s - [`//subdivide `](https://worldeditadditions.mooncarrot.space/Reference/#subdivide) - [`//ellipsoidapply `](https://worldeditadditions.mooncarrot.space/Reference/#ellipsoidapply) _(new in v1.9)_ - [`//airapply `](https://worldeditadditions.mooncarrot.space/Reference/#airapply) _(new in v1.9)_ - - [`//noiseapply2d `](https://worldeditadditions.mooncarrot.space/Reference/#noiseapply2d) _(new in v1.13)_ + - [`//noiseapply2d `](https://worldeditadditions.mooncarrot.space/Reference/#noiseapply2d) _(new in v1.13)_ ### Extras - [`//y`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#y)