Updated Heightmap template editor (markdown)

Azgaar 2022-05-21 23:43:21 +03:00
parent 22d4aab1ed
commit 7462fb8282

@ -1,4 +1,4 @@
Template is a set of actions to be applied to get a heightmap. Template can be pretty prescriptive and provide similar-looking heightmaps on each execution, but usually there is significant level of randomness defined by the template creator. Template is a set of actions to be applied to get a heightmap. Template can be pretty prescriptive and provide similar-looking heightmaps on each execution, but there is always a significant level of randomness that allow templates to produce different maps of the same type.
Possible actions are: Possible actions are:
* Add a **hill** (raises surrounding land) * Add a **hill** (raises surrounding land)
@ -15,7 +15,9 @@ Possible actions are:
Once you have given all the instructions, you can then run the template (process all instructions in sequence). Once you have given all the instructions, you can then run the template (process all instructions in sequence).
There are also options to download and upload templates. There are also options to download and upload templates.
When running a template, the map is cleared first. When running a template, the map is cleared first. Undo / redo buttons can be used to check the heightmap on each step. In seed is provided, it will be used for heightmap generation, so the map will be the same on each execution.
Step can be skipped by clicking on the checkbox on the left. To execute the template click on the Execute button or just press <kbd>Enter</kbd>.
Step can have the following values: Step can have the following values:
* `n` - the number of times it must occur, can be a decimal value or range for random selection * `n` - the number of times it must occur, can be a decimal value or range for random selection
@ -25,41 +27,43 @@ Step can have the following values:
* * `y` is the vertical axis, from 0 at the top, to 100 at the bottom. * * `y` is the vertical axis, from 0 at the top, to 100 at the bottom.
## Hill ## Hill
If you go to Custom, it will show an instruction like this: When you open the Template Editor, the instruction is like this:
* `Hill n:1 h:90-100 x:65-75 y:47-53` * `Hill n:1 h:90-100 x:65-75 y:47-53`
This says to add 1 hill, of a height between 90-100, somewhere in the center-right of the map. y says more-or-less center 47% to 53%, and x says 65% to 75%. This says to add 1 hill, of a random height between 90-100, somewhere in the center-right of the map.
To test it, change the single Hill entry to: To test it, change the Hill entry to:
* `Hill n:1 h:20 x:50-50 y:50-50` * `Hill n:1 h:20 x:50-50 y:50-50`
If you click Run template, it will show a map with just a few cells of land right in the center of the map. If you click Execute template, it will show a map with just a few land cells right in the map center.
![Heightmap showing a single hill of height 20](https://evolvedexperiment.github.io/FMGImages/images/template1.png) ![Heightmap showing a single hill of height 20](https://evolvedexperiment.github.io/FMGImages/images/template1.png)
I suggest you enable "Render ocean cells" to see the effect it has on the ocean depths. I suggest you enable "Render ocean cells" option to see the effect it has on the ocean depths.
Now change n:1 to n:2 Now change n:1 to n:2
You will see massive change - this is because the land has been raised by 40 height values. You will see massive change — this is because the land has been raised by 40 height in total.
![Heightmap showing two hills of height 20 at the same place](https://evolvedexperiment.github.io/FMGImages/images/template2.png) ![Heightmap showing two hills of height 20 at the same place](https://evolvedexperiment.github.io/FMGImages/images/template2.png)
Hills are main 'bricks' that construct a heightmap.
## Pit ## Pit
Now Pit is the opposite of Hill - it will create a "hole". Pit is the opposite of Hill, it creates a "hole".
To test it, add a Pit so your instructions look like this: To test it, add a Pit so your instructions look like this:
* `Hill n:2 h:20 x:50-50 y:50-50` * `Hill n:2 h:20 x:50-50 y:50-50`
* `Pit n:1 h:20 x:50-50 y:50-50` * `Pit n:1 h:20 x:50-50 y:50-50`
Run it and you will see a hole - the exact look will vary a bit. Run it and you will see a hole the exact look will vary a bit.
![Heightmap showing two hills and pit at the same place](https://evolvedexperiment.github.io/FMGImages/images/template3.png) ![Heightmap showing two hills and pit at the same place](https://evolvedexperiment.github.io/FMGImages/images/template3.png)
## Range ## Range
Now add a range and disable the Hill and Pit entries. Add a range and disable the Hill and Pit entries.
You will see it makes a short raised area. You will see it makes an elongated raised area.
* `Range n:1 h:40-50 x:15-85 y:20-80` * `Range n:1 h:40-50 x:15-85 y:20-80`
![Heightmap showing a single range](https://evolvedexperiment.github.io/FMGImages/images/template4.png) ![Heightmap showing a single range](https://evolvedexperiment.github.io/FMGImages/images/template4.png)
@ -96,8 +100,24 @@ will make raise land slightly - smaller changes to low values, and larger change
by decimals as well, so multiply by 0.8 will lower everything a bit. by decimals as well, so multiply by 0.8 will lower everything a bit.
## Smooth ## Smooth
The last one is smooth - this should probably be at the end - all cell heights are averaged by their neighbors heights. Smooth averages cell heights by their neighbors heights. This means land next to a pit will lower, and land next to a hill will rise. Smooth removes any spiky bits near land and makes FMG performance better.
This means land next to a pit will lower, and land next to a hill will rise. Smooth removes any spiky bits near land
and generally makes performance better on the FMG. ![Heightmap showing a strait between two hilly areas.](https://evolvedexperiment.github.io/FMGImages/images/template7.png)
## Mask
Mask is newer step so it was not included into the original guide. To see what is does lets assign maximum height (100) to all cells and then add Mask with default `1` factor. It will gradually mask height of the cells along map edge to 0.
![image](https://user-images.githubusercontent.com/26469650/169668247-36d8d414-15bd-4feb-97ab-aa850faab972.png)
Fraction `2` will blend masked values with the original ones, so map edges will get `50` height.
![image](https://user-images.githubusercontent.com/26469650/169668347-215fcf81-0626-4ad2-af2d-4eb2f0c786e4.png)
Negative factor inverts the mask, so that cells in the map center are lowered.
![image](https://user-images.githubusercontent.com/26469650/169668348-a5474fee-92fc-47fa-b0f1-61eb0cb4bb82.png)
Factor can even be a decimal value:
![image](https://user-images.githubusercontent.com/26469650/169668364-82dad6eb-2665-4cc6-aa80-fd4f66f72273.png)
![Heightmap showing a strait between two hilly areas.](https://evolvedexperiment.github.io/FMGImages/images/template7.png)