Towns
评价数不足
Towns Map Creation: Part 4: Water: Hills and Mountains
由 Varsh 制作
The map still is pretty flat so now we're going to change all of that by making things a lot more interesting and add in those much needed hills and mountains.
   
奖励
收藏
已收藏
取消收藏
Notes
This tutorial does not require much explanation as a lot of these settings are similar or the same to what has already been shown in a previous tutorial. If you don't know what these settings mean then please go over the past tutorials up to this point.
Why hills and mountains?
The real landscape is full of contours crafted by the wind, water, and volcanoes over millions of years, so having a flat plain with nothing but a few lakes and a river isn't exactly brilliant, how about making hills and mountains that are large enough for you to carve into their crevice and make things more fun? Well that's what we're about to achieve.
Height seeds
Height seeds work in the same manner as seeds, the only difference in this case is that all that happens is that the seed always goes upwards each turn. If you have 30 turns for the height seed then it will rise 30 tiles. To prevent this you give your compass percentages like how you did with the lakes and set the amount of tile spaces required for the next level of tiles to go up.

If there's a single tile left and you have a larger space requirement before it goes up another layer then the hill or mountain will not grow in height any more.
The mountain seed
So to start off we need to create a height seed with the following:
<heightSeed id="seedHeight1"> <!-- This is where the hills and mountains information goes → </heightSeed>
To give variance for each of the new map generations we want to roll dice to determine the number of hills or mountains generated. For this see I'm going to create mountains so I don't want too many of them on the map, so I will roll 2 dice with 3 sides and then add 2 to the score, this giving me anything between 4 and 8 mountains.

Mountains are generally quite steep towards the centre so having a close distance per tile before it goes up is essential. For this purpose I have set a single die roll to 1d3 to allow between 1 and 3 tile differences.

Also I don't want the mountain to be so tall that no one can stand on top of it, there are only 24 layers outside though only 23 are usable because of the top terrain layer, so having a mountain at least 23-1 is essential, I decided to keep it simple and stick with 20. Even though the amount of turns is set to 20 it doesn't mean that the mountain will be 20 tiles in height.

So for the current settings for the height seed we have:
<num>2d3+2</num> <turns>20</turns> <flatsBetweenLevels>1d3</flatsBetweenLevels>
The last part of the mountain building process is done in the exact same way as lakes, you have a north, south, east and west percentage. As we already made the lakes permanently 100 percente in each direction it made them look rather odd and diamond in shape, but as we now know how these percentages work we'll just set them all to 50 percent for now.

Keep in mind that as it is a height seed there are no upPCTs and no downPCTs.

For this mountain seed you should have the following:
<heightSeed id="seedHeight1"> <num>2d3+2</num> <turns>20</turns> <flatsBetweenLevels>1d3</flatsBetweenLevels> <northPCT>50</northPCT> <southPCT>50</southPCT> <eastPCT>50</eastPCT> <westPCT>50</westPCT> </heightSeed>
The hill seed
As that was a mountain seed there will be a lot of sharp rising terrain now on the map, what we want to do is have some variance by adding hills instead, these will have a much wider flat before going up a tile and there won't be as many tiles to go up either. The tags are kept exactly the same as the mountain but this time I want to have a 2d10+5 for the hill count as I want many more hills than there are mountains.

The flats are also needing to be much wider this time too so I've changed the value to 1d5. This does mean that it is possible to have a single tile difference though due to having very few turns it shouldn't matter much. An idea if you feel like could be to have 1d3+2, that way it will always be at least 3 tiles difference but have the maximum still as 5.

For this hill seed you should have the following:
<heightSeed id="seedHeight2"> <num>2d10+5</num> <turns>10</turns> <flatsBetweenLevels>1d5</flatsBetweenLevels> <northPCT>50</northPCT> <southPCT>50</southPCT> <eastPCT>50</eastPCT> <westPCT>50</westPCT> </heightSeed>
Play around with the values or even create a new height seed if you want to add more hills and mountains. For the rest of this tutorial I will be keeping to there values.

With this now in place you should now have two types of height seeds on the map from tall mountains to low wide hills. Hopefully your new map is starting to look like something more realistic.
Code
Here's the code for the gen_map.xml file with the new additions:
<?xml version="1.0" encoding="UTF-8"?> <gen_map> <init id="init"> <numLevelsOutside>24</numLevelsOutside> <numLevelsUnderground>40</numLevelsUnderground> <mainTerrain>grass,dirt,stone</mainTerrain> <numCitizens>100</numCitizens> <startingLevel>23</startingLevel> </init> <seed id="seedLake"> <type>_WATER_</type> <num>1d3</num> <level>24</level> <pointx>1d160+20</pointx> <pointy>1d160+20</pointy> <turns>10</turns> <northPCT>100</northPCT> <southPCT>100</southPCT> <eastPCT>100</eastPCT> <westPCT>100</westPCT> <downPCT>100</downPCT> </seed> <bezier id="bezierRiver1"> <type>_WATER_INF_</type> <level>24</level> <depth>5</depth> <wide>5</wide> <point1_x_min>25</point1_x_min> <point1_x_max>175</point1_x_max> <point1_y_min>-50</point1_y_min> <point1_y_max>-50</point1_y_max> <point2_x_min>25</point2_x_min> <point2_x_max>175</point2_x_max> <point2_y_min>250</point2_y_min> <point2_y_max>250</point2_y_max> <controlpoint1_x_min>-50</controlpoint1_x_min> <controlpoint1_x_max>250</controlpoint1_x_max> <controlpoint1_y_min>25</controlpoint1_y_min> <controlpoint1_y_max>75</controlpoint1_y_max> <controlpoint2_x_min>-50</controlpoint2_x_min> <controlpoint2_x_max>250</controlpoint2_x_max> <controlpoint2_y_min>125</controlpoint2_y_min> <controlpoint2_y_max>175</controlpoint2_y_max> </bezier> <heightSeed id="seedHeight1"> <num>2d3+2</num> <turns>20</turns> <flatsBetweenLevels>1d3</flatsBetweenLevels> <northPCT>50</northPCT> <southPCT>50</southPCT> <eastPCT>50</eastPCT> <westPCT>50</westPCT> </heightSeed> <heightSeed id="seedHeight2"> <num>2d10+5</num> <turns>10</turns> <flatsBetweenLevels>1d5</flatsBetweenLevels> <northPCT>50</northPCT> <southPCT>50</southPCT> <eastPCT>50</eastPCT> <westPCT>50</westPCT> </heightSeed> </gen_map>