Tutorial: Map Generator - Randomness: Difference between revisions

Maikel (talk | contribs)
No edit summary
Maikel (talk | contribs)
No edit summary
Line 1: Line 1:
This is the third part of the map generator tutorial. The previous part can be found [[Tutorial:_Map_Generator_-_Algorithms_%26_Transformations|'''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 landscape 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 and through a single transformation called turbulence.  
This is the third part of the map generator tutorial. The previous part can be found [[Tutorial:_Map_Generator_-_Algorithms_%26_Transformations|'''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==
==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 <code>a</code> determines the line width and <code>b</code> the distance between the lines. Therefore <code>b</code> must always be chosen larger than <code>a</code>, 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 <code>turbulence</code> attribute - which takes the values 10, 100, 1000 and 10000 - specifying the amount of deformation of the layer. Second the <code>lambda</code> 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]
[TODO: Explain algo lines and turbulence]



Revision as of 20:09, 21 January 2011

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.