mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 02:56:09 -04:00
added strata generation
parent
67bf739960
commit
d540a014f4
@ -42,6 +42,7 @@ The players is prompted to choose from 3 default sizes; small medium or large. S
|
||||
|
||||
Using:
|
||||
* heightMap, a 2D array of size width X depth
|
||||
* waterLevel, a constant of 32
|
||||
* noise1, a combined noise function with two octave noise functions (of octave 8) as input.
|
||||
* noise2, a combined noise function with two octave noise functions (of octave 8) as input.
|
||||
* noise3, an octave noise function (of octave 6)
|
||||
@ -61,11 +62,32 @@ if heightResult < 0 {
|
||||
set heightResult to 8/10 its value
|
||||
}
|
||||
|
||||
heightMap(x,z) is then set to the integer component of heightResult.
|
||||
heightMap(x,z) is then set to the integer component of heightResult + waterLevel.
|
||||
```
|
||||
|
||||
## Create strata
|
||||
// Todo
|
||||
|
||||
Using:
|
||||
* blocks, a 3D array of size width x height x depth
|
||||
* noise, an octave noise function (of octave 8)
|
||||
|
||||
For each column in the x,z plane populate blocks in array with stone-to-dirt and dirt-to-air transitions:
|
||||
```
|
||||
Let dirtThickness be noise.compute(x,z) / 24 - 4
|
||||
Let dirtTransition be heightMap(x,z)
|
||||
Let stoneTransition be dirtTransition + dirtThickness
|
||||
|
||||
for y in height {
|
||||
Let blockType be AIR
|
||||
if y equals 0 then blockType is LAVA
|
||||
else if y <= stoneTransition then blockType is STONE
|
||||
else if y <= dirtTransition then blockType is DIRT
|
||||
|
||||
set block(x,y,z) to blockType
|
||||
}
|
||||
```
|
||||
By doing so the block array is populated with lava at height 0, stone along with a variable thickness layer of dirt up to the heightMap elevation for that column and then air above.
|
||||
|
||||
## Carve out caves
|
||||
// Todo
|
||||
## Create ore veins
|
||||
|
Loading…
x
Reference in New Issue
Block a user