Modding:WorldGen Configuration: Difference between revisions

From Vintage Story Wiki
Marked this version for translation
mNo edit summary
(Marked this version for translation)
Line 1: Line 1:
{{GameVersion|1.15}}
{{GameVersion|1.15}}
<languages/><translate>
<languages/><translate>
== Landforms ==  
== Landforms == <!--T:1-->


<!--T:2-->
Landforms define the shape of the terrain. Let's take a look at an existing landform.
Landforms define the shape of the terrain. Let's take a look at an existing landform.


<!--T:3-->
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Line 26: Line 28:




<!--T:4-->
There are 2 system at work that let you control the shape of the terrain - the octaves and the Y-Thresholds.
There are 2 system at work that let you control the shape of the terrain - the octaves and the Y-Thresholds.


=== Octaves ===
=== Octaves === <!--T:5-->


<!--T:6-->
If you know perlin noise, you will know what this is, but shortly explained low octaves will give you very smooth terrain whereas high octave give you rugged/chaotic terrain. You can mix an match freely between those. Examples:
If you know perlin noise, you will know what this is, but shortly explained low octaves will give you very smooth terrain whereas high octave give you rugged/chaotic terrain. You can mix an match freely between those. Examples:


<!--T:7-->
* <code>terrainOctaves: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]</code> would give you veeeery gradually changing terrain
* <code>terrainOctaves: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]</code> would give you veeeery gradually changing terrain
* <code>terrainOctaves: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1]</code> would give you veeeery rugged and chaotic terrain
* <code>terrainOctaves: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1]</code> would give you veeeery rugged and chaotic terrain


<!--T:8-->
'''Octave Thresholds'''
'''Octave Thresholds'''


<!--T:9-->
These act as substractor to the octaves. This allows you for example to generate a flat terrain with a few rare bumps, by setting something like this:
These act as substractor to the octaves. This allows you for example to generate a flat terrain with a few rare bumps, by setting something like this:


<!--T:10-->
<code>
<code>
terrainOctaves:          [1, 1, 1, 0, 0, 0,  1, 0, 0, 0],<br>
terrainOctaves:          [1, 1, 1, 0, 0, 0,  1, 0, 0, 0],<br>
Line 44: Line 52:
</code>
</code>


<!--T:11-->
This causes the 7th octave to be only active 30% of the time, as most of it is substracted away.
This causes the 7th octave to be only active 30% of the time, as most of it is substracted away.


<!--T:12-->
Note: The amount of octaves is always fixed at 10. You can't configure less or more than 10.
Note: The amount of octaves is always fixed at 10. You can't configure less or more than 10.


=== Y-Thresholds ===
=== Y-Thresholds === <!--T:13-->


<!--T:14-->
Imagine you had a side view of a mountain and you could make it wider and thinner at any given elevation. This is approximately how the y-threshold system works. terrainYKeyPositions are the relative (0=bottom, 1=top of the world) coordinates and terrainYKeyThresholds define how much Percent of terrain should be solid blocks (0 = always solid, 1 = always air), or in other words it's density. We could also make a graph of this:
Imagine you had a side view of a mountain and you could make it wider and thinner at any given elevation. This is approximately how the y-threshold system works. terrainYKeyPositions are the relative (0=bottom, 1=top of the world) coordinates and terrainYKeyThresholds define how much Percent of terrain should be solid blocks (0 = always solid, 1 = always air), or in other words it's density. We could also make a graph of this:


<!--T:15-->
[[File:Densitygraph.png]]
[[File:Densitygraph.png]]


<!--T:16-->
In this example at maximum world height the density is 0, so there will always be air blocks. In the middle we have a jump where the y-position changes, but not the density, so this will create cliffs in the mountain. On the lower end the opposite happens. The Y-Position changes very little but it's density increases a lot. If that position happens to be at the sealevel we would get flat beaches. The default sealevel y-position is 0.43  
In this example at maximum world height the density is 0, so there will always be air blocks. In the middle we have a jump where the y-position changes, but not the density, so this will create cliffs in the mountain. On the lower end the opposite happens. The Y-Position changes very little but it's density increases a lot. If that position happens to be at the sealevel we would get flat beaches. The default sealevel y-position is 0.43  
And below a certain y-position the density is always 1. If we would set that to a lower value, we would get very deep lakes.
And below a certain y-position the density is always 1. If we would set that to a lower value, we would get very deep lakes.


<!--T:17-->
The amount of configurable Y-Thresholds is arbitrary you may use any quantity, just make sure both lists have the same amount of elements. However, it wouldn't make sense to configure more than 256 thresholds for a world height of 256 blocks.
The amount of configurable Y-Thresholds is arbitrary you may use any quantity, just make sure both lists have the same amount of elements. However, it wouldn't make sense to configure more than 256 thresholds for a world height of 256 blocks.


<!--T:18-->
You can build such graph using the new [http://tyron.at/vs/landformcreator.html world gen tool]
You can build such graph using the new [http://tyron.at/vs/landformcreator.html world gen tool]


=== Testing Landforms ===
=== Testing Landforms === <!--T:19-->


<!--T:20-->
You can trial&error landforms very quickly without the need to restart the game every time you made changes to the landforms.json
You can trial&error landforms very quickly without the need to restart the game every time you made changes to the landforms.json
<ol>
<ol>
Confirmedusers
13,514

edits