Tutorial: Map Generator - Randomness
This is the third part of the map generator tutorial. The previous part can be found here, and should be completed before trying this part of the tutorial. In the two previous parts you learned how to create overlays and combined them with logical operators, use algorithms and how to transform them. These ingredients do allow you to build some basic maps already, as seen in the previous exercise, but we need one more aspect of the map generator to make landscapes really interesting. That aspect is randomness and is treated in this part of the tutorial. There are two ways randomness is introduced into maps, these are through algorithms that behave randomly and through a single transformation called turbulence.
Turbulent Lines
So let's start with introducing turbulence. For this purpose a new algorithm is introduced, the lines algorithm. It draws vertical lines where the parameter a
determines the line width and b
the distance between the lines. Therefore b
must always be chosen larger than a
, otherwise the whole overlay will be filled completely. Furthermore we will introduce two new attributes which together specify the turbulence transformation. First there is the turbulence
attribute - which takes the values 10, 100, 1000 and 10000 - specifying the amount of deformation of the layer. Second the lambda
attribute can be used to repeat the deformation process up to 20 times. So now let's take a look at this piece of map generator code and the result.
// Straight lines made interesting. map ExampleTurbulentLines { mat=Water; tex=water; overlay { algo=lines; a=10; b=20; mat=Gold; tex=gold; turbulence=10; lambda=0; }; };
blaBLA [TODO: Explain algo lines and turbulence]
Example 2
Example 3
Exercise
Summary
[TODO: Summarize]
The next part of this tutorial about some special features is here.