Some random map scripts I've created

I’ve created a few random map scripts over the past year and I thought I could share some of these maps on this forum, as well as brief explanations on created them. If you’re not familiar with random map scripting, check out the Definitive Random Map Scripting Guide. This post also talks a bit about land generation, which you read more about in this guide (h/t HankDeSuperNerd).

Infinity Stones

Download: AoE2 Mod Page, aoe2map

Can you take control of the hills of (essentially) infinite Stone?

Despite the name, there isn’t an infinite amount of Stone on this map. I found that 10 million resources was about the most you can go for each pile before stuff started glitching. To make sure each hill has Stone, I set the min_distance_group_placement property to 10 and made it only spawn on the gravel terrain on the top of the hill. Because each hill top had a diameter of less than 10 units, the “infinite” Stone piles would spawn on separate hills.

Stone miners work twice as fast, while Castles and Krepost have half HP. It’s also playable with AI. However, because the default AI was not programmed to focus on Stone mining and was not programmed to sell massive amounts of Stone, they ended up struggling to train Gold units.

Arena Island

Download: AoE2 Mod Page, aoe2map

It’s Arena, but on an island.

Being on an island, the starting area is smaller than regular Arena. Most resources are inside the walls, but extra herdables and resources are located outside the wall. Each player also starts with Sea Towers, to give you some protection from early naval rushes.

To create this map, I first set the base terrain to water in the land generation section. Then I created a ring of placeholder terrain, which in this was DIRT3. When I was creating this map, I simply copied the create_land ring from Arena-ception’s map. This ring, in turn, was created using TheMadCader’s MadLands utility.

After generating the ring, I used another create_land command to fill the middle with the main terrain, setting land_percent to 100 and land_position to 50 50. The ring of trees act like a dam, blocking the main terrain from spilling into the outside water. Finally, I used a create_player_lands to generate the starting player lands. I set the player land size and land percent to 0, though, so to maintain the island’s circular shape.

It’s in terrain generation where I give starting units space to spawn. First, I filled in all of DIRT3 over 20 units away from the starting player area with Forest terrain. Then, because I didn’t want DIRT3 to be the starting area terrain, I replaced DIRT3 with the player terrain, a terrain that varied based on map theme.

Houseboat Shallows

Download: AoE2 Mod Page, aoe2map

Like Houseboat, but with shallows.

The original Houseboat has two issues that makes it unplayable to the default AI: it requires the use of Transport Ships and the land around the TC is too small to build farms. Houseboat Shallows attempts to correct these issues by increasing the Houseboat size and by connecting the houseboat to the mainland with shallows. However, by making these changes, early game microing suddenly becomes much easier and Transport Ships a lot less useful. But they’re still useful if you want to quickly ferry away your Sheep before any enemies come along to steal them.

In both the original and my version of Houseboat, there is a strip of land surrounding the lakes that contains Gold, Stone, Forage Bushes and extra Sheep. The original Houseboat attempted to keep the number of strip resources the same for each player by using the temp_min_distance_group_placement property, but that didn’t always produced consistent results.

The set_place_for_every_player method is a much more effective way to ensure consistent player resources. However, that placement method only works if the terrain they’re being placed on is not separated from the player land origin by restricted terrain. In Houseboat, the strip is separated from the player land origin by water and shallows and Gold/Stone/etc cannot be placed on those terrains. Thus you can’t use this method… unless you also enable ignore_terrain_restrictions.

However, if you do enable ignore_terrain_restrictions, some resources, due to how they’re clumped, may spawn on water, even if you specifically specify that they should only spawn on the strip. To ensure this won’t happen, I created an additional 2 unit wide buffer between the strip and pond. You can take a look at the diagram below to see what I’m talking about:

Fortress Island

Download: AoE2 Mod Page, aoe2map

Like Fortress, but on an island.

Similar to Arena Island, Fortress Island has a smaller starting walled area compared to its regular counterpart. While all huntables and herdables are located inside the wall, most resources, especially Wood, are located outside the wall.

Impact Lake

Download: AoE2 Mod Page, aoe2map

A map with an impact crater lake in the middle, surrounded by a rim containing extra Stone and Gold.

This map looks simple, but creating concentric terrains at different elevations is actually more complex than you’d expect. In fact, I had to ask the experts on the RMS Discord for help in making this map (h/t TechChariot).

Like the forest ring on Arena Island, the crater rim was created using MadLands. Similar to Arena Island, the crater rim acted like a dam, this time preventing the surrounding land (base_elevation 5) from filling in the crater at the middle. Unlike in Arena Island, though, the surrounding land was generated using create_player_land instead of create_land.

Side note, if you take a look at my uploaded script, the create_player_land command is placed before all the crater rim stuff, despite that not making any logical sense if the crater rim is suppose to act like some sort of dam. The script still works properly if the create_player_land command is placed after the crater rim generation, indicating that the game might read create_player_land commands before other create_land commands. However, the Definitive RMS Guide doesn’t mention anything of the like, so I don’t know for sure.

Four Ponds

Download: AoE2 Mod Page, aoe2map

Like Four Lakes, but all the water is now in the middle. Additionally, the area between the four ponds contains extra Boars, Stone and Gold, as well as a Relic.

The bodies of water was created using the left_border, right_border, top_border and bottom_border properties. To make the sure ponds were circular, I set land_percent to 100. Otherwise, it’s a pretty simple map.

Nomad World Tour

Download: AoE2 Mod Page, aoe2map

Nomad, but on maps you know.

There are 21 potential map styles, ranging from Atacama to Wolf Hill (minus the Wolves). I added min_distance_to_map_edge 10 to Villager spawns to decrease likelihood of trapped Villagers. None, of the map style, though, will resemble default Nomad or Land Nomad. Check the description on the download page for all the potential generations.

Like with regular Meadows, the Meadows style in this map script uses two create_player_land commands to create the spawn area and the main woodline. I discovered that if the woodline and non-woodline create_player_lands have the same land_id, the map will spawn 6 starting villagers instead of the default 3. That why I set the land_id in the woodline create_player_land command to 500.

Random Arabia

Download: AoE2 Mod Page, aoe2map

Like Megarandom-style starts, but wished that all the maps to look more like Arabia? Well, Random Arabia is the map for you!

You will always start with a Town Center, a standard number of Villagers and at least 1 scouting unit. You will also start with a Forage bush and near Stone/Gold. The objects that may vary include:

  • Scout numbers and/or type. Your scout can be your civilization’s standard starting Scout, but it can also be a Serjeant or even a Flaming Camel.
  • The second building, if it spawns. All buildings except for Mill, Mining/Lumber Camp, Docks and Caravanserais can spawn.
  • Extra resources. Far Gold may or may not spawn, while extra resources may spawn scattered across the map.

What is guaranteed is that you will never have the vanilla 1 TC, 3-6 Villagers, 1 Scout start.

Regarding the map layout, there’s a 30% chance that the map will be land Arabia, a 30% chance that there be oases inside the forests, a 20% chance that the map will be Cenotes-style, a 10% chance that the map will resemble Kawsasan, and a 10% chance that there will be a center lake.

I also gave all players close woodlines. To do this, I had to use a bunch of placeholder terrain:

  1. In land_generation, I used the create_player_land to create player spawn area with BEACH terrain. With base_size 13 (for non-Kawasan style generations) and land_percent 4, the player spawn area is about 15-20 tiles.
  2. Moving to the terrain_generation section, I used a create_terrain command to change one random player’s land from BEACH to DLC_ROCk.
  3. Then I created a 25 tile clump of forest, with set_avoid_player_start_areas enabled. If you recall, the player spawn area has a radius of about 15-20 tiles, while set_avoid_player_start_areas by default prevents terrain from spawning within 13 tiles of the starting area. In turn, the forest clump that will be created will be between 13 to 20 tiles, which is reasonable for starting woodlines.
  4. I originally wanted the second forest clump to have some spacing to the first clump. To do this, I used another create_terrain command to place a 20 clump of ROAD placeholder terrain on top of DLC_ROCK, with spacing_to_other_terrain_types set to 1
  5. After placing the ROAD terrain, I placed forest terrain on top of the ROAD terrain. With that, a second clump of forest should in theory should be generated near player spawn. However, I found spacing_to_other_terrain_types 1 caused this second clump to be incredibly small due to the spawn area’s relatively small size. Therefore, I ended up setting spacing_to_other_terrain_types to 0, which actually makes the ROAD terrain placement unnecessary.

After these steps, I had the following block of code:

create_terrain DLC_ROCK
{
base_terrain BEACH
number_of_clumps 1
land_percent 100
}

create_terrain FOREST_MAIN
{
base_terrain DLC_ROCK
number_of_clumps 1
number_of_tiles 25
spacing_to_other_terrain_types 0
set_avoid_player_start_areas
clumping_factor 20
}

create_terrain ROAD
{
base_terrain DLC_ROCK
number_of_clumps 1
number_of_tiles 20
spacing_to_other_terrain_types 0
set_avoid_player_start_areas 
clumping_factor 20
}

create_terrain FOREST_MAIN
{
base_terrain ROAD
number_of_clumps 1
number_of_tiles 25
}

create_terrain TERRAIN_MAIN
{
base_terrain DLC_ROCK
number_of_clumps 1
land_percent 100
}

If there are non-contiguous terrain, such as player spawn terrain, the create_terrain command will only create terrain in one of those areas. Therefore, I copied this block of code eight more times to fill in the rest of the player lands. You’ll notice that means there will be nine, instead of eight, copies of this block of code in this RMS. This is done to reduce the chance something like this happening.

Finally, you cannot nest start_random codes. For example, on this map, there’s a 75% chance that you’ll spawn with a second building. If you don’t spawn with a second building, then you’ll always spawn with 2 scouts. If you do spawn with a second building, then there’s a 50% you’ll spawn with 2+ scouts and another 50% chance you’ll spawn with only 1. The following block of code won’t work:

/* This will not work! */
start_random
	percent_chance 25 #define SEC_BUILD_NO /* No second building */
		start_random
			percent_chance 0 #define FIRST_SCOUT_SINGLE /* Spawn 1 scout */
			percent_chance 100 #define FIRST_SCOUT_MULT /* Spawns 2+ scouts */
		end_random
	percent_chance 75 #define SEC_BUILD_YES /* Spawns second building */
		start_random
			percent_chance 50 #define FIRST_SCOUT_SINGLE
			percent_chance 50 #define FIRST_SCOUT_MULT
		end_random
end_random

Instead, it should be arranged like this:

start_random
	percent_chance 25 #define SEC_BUILD_NO
	percent_chance 75 #define SEC_BUILD_YES
end_random

if SEC_BUILD_YES
	start_random
		percent_chance 50 #define FIRST_SCOUT_SINGLE
		percent_chance 50 #define FIRST_SCOUT_MULT
	end_random
	else
	start_random
		percent_chance 100 #define FIRST_SCOUT_MULT
	end_random
endif

Nomad Lakes

Download: AoE2 Mod Page, aoe2map

Like Nomad, but with lakes

A spinoff/spiritual sequel to Nomad World Tour, this map has three features that will vary:

  • Map border: 40% chance it will be empty land, 40% it will be forest, 20% chance it will an unbuildable terrain
  • Edge lakes: 40% there will be four corner lakes, 30% there will be Budapest-style lakes, 30% there won’t be any edge lakes
  • Middle Lakes: There could be one, two, four or an equivalent player number of lakes. If there are four edge lakes, then there’s a chance there won’t be any middle lake(s).

Like Land Nomad or African Clearing, I wanted Nomad Lakes to have a border around the map to prevent villagers from being trapped on the map’s edge. To do this, I used create_land to create land to fill the map with the main terrain bounded by a 4% offset from the map’s edges. This main terrain is where all the forests will be placed:

create_land
{
terrain_type TERRAIN_MAIN
land_percent 100
base_size 1

if EDGE_FOREST
	top_border 4
	left_border 4
	right_border 4
	bottom_border 4
else
	top_border 4
	left_border 4
	right_border 4
	bottom_border 4	
endif

if TINY_MAP
	border_fuzziness 60
else
	border_fuzziness 40  
endif
  
if STYLE_CENTERLAKE
	land_position 50 80
else
    land_position 50 50
endif

base_size 0
} 	

You’ll notice that this create_land command has land_position attributes, even though I’m essentially filling the whole map with TERRAIN_MAIN. This is because if you don’t specify land_position, then the game will randomly choose a land_position within the defined border. This means that sometimes, the land_position the game chooses will overlap with a lake that was also created with a create_land command, leading to protrusions and other unsightly annoyances. Setting land_position to outside the lake boundaries can reduce the amount of irregularities, though they will still pop up from time to time. In general, the game tends to struggle when it comes to overlapping lands generated with the create_land command.

3 Likes

I recently added Budapest-style lakes to Nomad Lakes and I found something interesting when trying to add those lakes.

If you look closely at the Budapest minimap, you’ll notice that the northwest and southeast lakes tends to be pinched at the map’s edge:

Left minimap lakes have border_fuzziness 15 and clumping_factor 15, while the right minimap lakes lakes have border_fuzziness 100 and clumping_factor 40.

No one knows why this pinching feature doesn’t impact the NE and SW sides of a map, but to get rid of this feature for the NW and SE sides, you need to extend the lake borders past the map boundaries. In other words, you will need to use negative values in your border attributes (h/t Chrazini from the RMS Discord). For example, to get rid of the pinching in the northwest lake, I used the following borders:

  left_border			   30
  right_border			   30
  top_border               -25 /* 0 on default Budapest */
  bottom_border            90

But remember, if you don’t specify land_position, then the game will randomly choose a land_position within the defined border. This includes areas outside the map boundaries. But if the game places land_position outside the map boundary, the game crashes. Therefore, for each lake, I have to specify a land_position inside the map.

Overall, to get Budapest-style lakes without the pinching, I used the following block of code:

create_land /* NE lake */
{
  terrain_type  WATER
  land_percent                     100
  number_of_tiles 99999
  left_border                      90
  right_border                     -25
  top_border                       30
  bottom_border                    30
  base_size                        1
  border_fuzziness              15
  clumping_factor                15
  land_position 99 50
  zone 1
}

create_land /* SW lake */
{
  terrain_type  WATER
  land_percent                     100
  number_of_tiles 99999
  left_border                      -25
  right_border                     90
  top_border                       30
  bottom_border                    30
  base_size                        1
  border_fuzziness                15
  clumping_factor                 15
  zone 2
  land_position 1 50
}
create_land /* SE lake */
{
  terrain_type  WATER
  land_percent                     100
  number_of_tiles 99999
  left_border			   30
  right_border			   30
  top_border                       90
  bottom_border                    -25
  base_size                        1
  border_fuzziness              15
  clumping_factor                15
  zone 3
  land_position 50 99
}

create_land /* NW lake */
{
  terrain_type  WATER
  land_percent                     100
  number_of_tiles 99999
  left_border			   30
  right_border			   30
  top_border                       -25
  bottom_border                    90
  base_size                        1
  border_fuzziness              15
  clumping_factor                15
  zone 4
  land_position 50 1
}

This block of code generated the following lakes:

Like in the previous screenshot, left minimap lakes have border_fuzziness 15 and clumping_factor 15, while the right minimap lakes lakes have border_fuzziness 100 and clumping_factor 40.

If you take a look at the Nomad Lakes code, you’ll notice that, for all the lakes, I use border_fuzziness 100 and clumping_factor 40 instead of having both attributes be 15. This is because if the lakes had a fuzzier boundary, and if the map border was a forest, I found that a thin line of trees would sometimes spawn at the lakes’ edges. As I intended for players to dock on those lakes in the early games, having forests blocking lakes would obviously not be a good thing.

2 Likes

Shock Troops Arabia and Shock Troops Arena

Download: AoE2 Mod Page, aoe2map (Arena), aoe2map (Arabia)

Like Arabia and Arena, but everyone starts with 13 Villagers, 2 TCs and 31 soldiers. What could go wrong?

My proof of concept of a RMS where you start with a bunch of military units and Villgers. Players start with the following:

  • 2 TCs
  • 8 Army Tents
  • 13 Villagers
  • 10 Camel Scouts
  • 10 Skirmishers
  • 10 Spearmen
  • 1 Default scouting unit
  • 1 Battering Ram (Arena)

The reason for starting with 10 Camel Scouts instead of 10 Scout Cavalry has to do with the SCOUT constant. SCOUT is the Scout Cavalry’s internal unit name, but the default .dat file contains an effect that upgrades all SCOUT objects to Camel Scouts or Eagle Scouts if the player is playing as the Gurjaras or a Mesoamerican civilization respectively. Because starting with 10 Eagle Scouts is a bit OP, I decided instead to make those extra scouting units be Camel Scouts.

The second Town Center is scripted to spawn on the closest woodline while staying at least 15 units away from the primary TC. As you know in Arena, the woodline inside the walls are inconsistent, while there’s also usually a safe cove that spawns behind the player’s base. In turn, when using default Arena attributes for the create_player_land command, the second TC would have an inconsistent spawning location. Sometimes, the second TC would spawn safely in the back cove, while other times it would dangerously spawn in front of the forward walls.

To deal with issue, I changed land_percent attribute from 20 to 0 and increased the base_size value from 12 to 17. This in turn created perfectly square-shaped bases without any coves and back walls, which in turn led to the 2nd TC always spawning inside the wall. It makes the map look less aesthetically pleasing, but I think it’s an understandable tradeoff.

1 Like

Nomad Rivers and Nomad Valley

Download: AoE2 Mod Page, aoe2map (Rivers), aoe2map (Valley)

Like Nomad, but on Rivers and Valley (or is it Wade?)

For both maps, there will always an island in the middle containing extra mines or Forage Bushes. On Nomad Rivers, all islands are connected to each other by shallows, while on Valley, shallows replaces Beach/Ice terrain. Valley shallows contain huntables (50% chance Deer, 50% chance Boar) and Shore Fish. There’s also a 50% chance that player lands in Nomad Valley will be elevated Wade-style.

In Nomad Valley, Shore Fish spawn inside the pools of water in the shallows, even though by default they’re only allowed to spawn off shallow shores. To get around this, I first place a terrain blocker (ID 1613) object in the pools of water, using the terrain blocker as a placeholder; terrain blockers do not have terrain restrictions. Then I spawn the Shore Fish using the second_object attribute. This is the same method Wade uses to spawn Shore Fish in their shallows.

Overall, my create_object command looked like the following:

#const TERRAIN_BLOCKER 1613

create_object TERRAIN_BLOCKER
{
if ASIAN_MAP
 second_object DLC_BOXTURTLE
else
 second_object SHORE_FISH
endif
number_of_objects  9320
temp_min_distance_group_placement  5
terrain_to_place_on WATER
}
1 Like

Nomad Meadows Map Pack

Download:

There are six maps in this pack of very open maps:

  • Nomad Atacama: Like Atacama, but with corner ponds
  • Nomad Haboob: Like Haboob, but with corner ponds. A center forest also spawns on normal size and above.
  • Nomad Hill: Like Gold Rush, but with corner rivers. But it’s also like Wolf Hill, but without the wolves.
  • Nomad Meadow: Like Meadow, but with forests on the borders. Instead of Relics, the middle pit contains Forage Bushes or Gold & Stone Mines (50% chance of each)
  • Nomad Steppe: Like Steppe, but even more nomadic.
  • Wandering Desert: Like Atacama, but with ponds and Shore Fish in the middle and mountains on the edges. Based on the World Desert Championship version of Atacama.

Creating the Edge Terrain
All maps in this pack have an edge terrain such as a forest to prevent starting Villagers from being trapped between a woodline and the map’s edge. With the exception of Haboob, these edge features were created using a different method from Nomad Lakes’. Instead of setting base_terrain to the boundary terrain and filling the middle with the main terrain up to the defined borders, the base_terrain was instead set to be the main terrain and the edge terrain was generated using create_land commands. Here’s a diagram showing what’s happening:

(Obviously I’m not the first to use these edge forest creation methods. Nomad Lake’s center fill method was taken from Land Nomad, while the Nomad Hill’s create_land method was taken from Wolf Hill).

As I mentioned earlier in this thread while talking about Nomad Lakes, placing a border-defined land inside a previously created border-defined land causes weird protrusions, even if the two lands have different land_position values:

create_lands

By creating the edge terrain through manual placement instead of through center fill, future border-defined lands placed in the middle can avoid these protrusion problems.

But of course, there’s always a catch. For some reason near the corners, there usually is a small gap between the adjacent edge terrain with the create_land method.

I gave all Villagers the avoid_forest_zone 2 attribute, so they probably won’t get stuck in this gap when they spawn (in the screenshot above, the Stone and Forage Bushes nearly block access to the gap). But I’m not exactly sure how wide this gap can get (these gaps usually are 1 to 2 tiles wide, but I’ve seen bigger gaps). To prevent any chance of Villagers spawning in the gap, I decided to add edge lakes to Hill and Meadow, which in turn removed these gaps (the edge forest borders also had to be shrunk to avoid overlapping with the lakes).

Nomad Hills Notes

Like Wolf Hill, Nomad Hills’ hills are ripply. This is due to the elevation_generation spacing attribute, which defines the number of tiles between elevation levels (it is set to 4 on both maps).

Like Gold Rush, Nomad Hill contains a open Gold mine in the middle surrounded by a ridge. The surrounding ridge is generated using the border and land_percent attributes (i.e. it’s a border-defined land):

create_land
{
terrain_type TERRAIN_BUFFER
land_percent 80
if GIGANTIC_MAP
     left_border 30
     right_border 30
     top_border 30
     bottom_border 30
elseif LUDIKRIS_MAP
     left_border 30
     right_border 30
     top_border 30
     bottom_border 30
else
     left_border 29
     right_border 29
     top_border 29
     bottom_border 29
endif
     border_fuzziness 9
     clumping_factor 15
base_elevation 3
}

The central mine, on the other hand, is generated with a bunch of manually placed lands with base_size 9 and land_percent 0:

/* Just 1 of several create_land commands to create the central mine. Copied from Gold Rush */
create_land
{
terrain_type TERRAIN_GRAVEL
     land_percent 0
if GOLDRUSHLARGE
     land_position 43 47
     base_size 9
else
     land_position 45 48
     base_size 9
endif
     border_fuzziness 100
     land_id 3
}

Base_size lands will always be placed consistently. The only land that can paint over a previous base_size land is another base_size land. For example, with base_size 9, land_position 50 50 and land_percent 0, a 19x19 square will always be placed in the center of the map. You’ll never worry about unwanted protrusions even if this base_size land was placed in the middle of border-defined land. This base_size/land_percent 0 combo is why land patterns generated with the MadLands utility will always generate. With enough overlapping base_size squares, you can generate a roundish looking piece of land i.e. Gold Rush’s central Gold mine.

The downside with with the base_size method is that unlike border-defined lands, base_size does not scale up with map size; base_size 9 will always be a 19x19 square regardless if it’s a tiny map or a ludicrous map. In turn, making your base_size lands work for all map sizes will require far more lines of code compared to the border attribute method.

Haboob and Meadow notes

In both my version and the DE version of Haboob and Meadow, the behavior_version attribute is set to 1, which, according to the RMS guide, “changes land generation such that when specifying number_of_tiles or land_percent, the square amount covered by the base_size is included in the total, rather than being additive.” What that entails for Haboob and Meadow is that the central clumps of forests that create_player_land generates will look smaller and (maybe) rounder compared to their behavior_version 0 counterparts:

behavior_version 0 on the left, behavior_version 1 on the right

As mentioned earlier, Nomad Haboob, like default Haboob, uses Land Nomad’s fill-in-the-middle method to create edge forests. The base_terrain, though, is not a forest terrain but is instead a rock terrain (DLC_ROCK), given that edge forests are surrounded by 2 tiles of buildable buffer and 1 tile of unbuildable rock. Having base_terrain be DLC_ROCK is really convenient for the corner lakes. This is because for some reason everytime you create a lake with create_land, a 1 tile wide buffer of base_terrain always form around the lake.

Had base_terrain been forests, the corner lakes would’ve been surrounded by trees.

3 Likes

Thanks for posting your maps (and explanations)!

I believe land placement works like this:

  • Land bases (squares whose size is determined by the base_size command) are placed in the order they appear in the script. If possible, they avoid any bases that have already been placed (e.g. borders and land_position might prevent this).
  • Once all bases have been placed, lands grow simultaneously at the same rate, until they either reach their maximum size (specified by number_of_tiles/land_percent) or can’t grow any further (because of borders or other lands).

Thus I think the order lands appear in the code only affects where the bases are. In your case, I guess your crater rim is actually made mostly of land bases, so it’s present to act like a dam when the player lands are growing. This also explains why:

I think “overlapping lands” really means overlapping land bases. In my experience, this usually prevents land growth completely.

This is unexpected (to me). Do you know why not? I don’t think I’ve tried stacking start_random/end_random before.

You can also use min_distance_to_map_edge to keep Villagers (and any other objects) away from the edge. It’s measured in number of tiles, so you might need different values for different map sizes.

1 Like

I finally updated Nomad Lakes so that the edge terrains are now created using create_land commands. Let me tell you, this method so much better than the Haboob fill in the middle method that I originally used. Without overlapping create_land commands, you don’t have to worry about unwanted land protrusions in the lakes. Also, lake border_fuzziness and clumping_factor values don’t need to be 100 and 40 respectively anymore. In other words, lakes can now have an irregular looking shoreline without the worry of a a thin line of trees spawning on the water’s edge.

Here is the code I used to place the edge terrain (DLC_DRYROAD is the placeholder terrain):

/* Edge terrain for generations without any edge lakes */
if STYLE_NO_FOURLAKES
create_land /* NE forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	left_border 96
	right_border -2
	top_border -2
	bottom_border -2
	border_fuzziness 60
	land_position 99 50
}
create_land /* NW Forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	bottom_border 96
	top_border -2	
	right_border -2
	left_border -2
	border_fuzziness 60
	land_position 25 1
}

create_land /* SE Forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	top_border 96
	bottom_border -2	
	right_border -2
	left_border -2
	border_fuzziness 60
	land_position 75 99
}
create_land /* SW Forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	right_border 96
	left_border -2
	top_border -2
	bottom_border -2
	border_fuzziness 60
	land_position 1 50
}
/* Edge terrain for Cross-style lakes */
elseif STYLE_FOURLAKES
create_land /* NE forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	left_border 96
	right_border -2
	top_border 20
	bottom_border 20
	border_fuzziness 60
	land_position 99 50
}

create_land /* NW Forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	bottom_border 96
	top_border -2
	right_border 20
	left_border 20
	border_fuzziness 60
	land_position 25 1
}

create_land /* SE Forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	top_border 96
	bottom_border -2	
	right_border 20
	left_border 20
	border_fuzziness 60
	land_position 75 99
}
create_land /* SW Forest */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	right_border 96
	left_border -2
	top_border 20
	bottom_border 20
	border_fuzziness 60
	land_position 1 50
}
/* Edge terrain for Budapest-style lakes. Need 2 separate generations per corner */
elseif STYLE_BUDAPEST
create_land /* NE forest 1 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	left_border 96
	right_border -2
	top_border -2
	bottom_border 70
	border_fuzziness 60
	land_position 99 25
}
create_land /* NE forest 2 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	left_border 96
	right_border -2
	top_border 70
	bottom_border -2
	border_fuzziness 60
	land_position 99 75
}
create_land /* NW Forest 1 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	bottom_border 96
	top_border -2
	right_border -2
	left_border 70
	border_fuzziness 60
	land_position 75 1
}
create_land /* NW Forest 2 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	bottom_border 96
	top_border -2	
	right_border 70
	left_border -2
	border_fuzziness 60
	land_position 25 1
}
create_land /* SE Forest 1 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	top_border 96
	bottom_border -2	
	right_border 70
	left_border -2
	border_fuzziness 60
	land_position 25 99
}
create_land /* SE Forest 2 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	top_border 96
	bottom_border -2	
	right_border -2
	left_border 70
	border_fuzziness 60
	land_position 75 99
}
create_land /* SW Forest 1 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	right_border 96
	left_border -2
	top_border -2
	bottom_border 70
	border_fuzziness 60
	land_position 1 25
}
create_land /* SW Forest 2 */
{
	terrain_type DLC_DRYROAD
	land_percent 100
	right_border 96
	left_border -2
	top_border 70
	bottom_border -2
	border_fuzziness 60
	land_position 1 75
}
endif

And it turns out that gap between the edge terrain (see Nomad Meadows Map Pack) can easily be fixed with some base_size lands. Here’s the code I used to fill in those gaps (edge terrains are 4% thick):

create_land /* Left blob */
{
	terrain_type DLC_DRYROAD
	land_percent 0
	if LUDIKRIS_MAP
	base_size 18
	elseif TINY_MAP
	base_size 5
	elseif SMALL_MAP 
	base_size 6	
	elseif MEDIUM_MAP 
	base_size 7
	elseif LARGE_MAP 
	base_size 8
	else
	base_size 9
	endif
	land_position 1 1
}
create_land /* right blob */
{
	terrain_type DLC_DRYROAD
	land_percent 0
	if LUDIKRIS_MAP
	base_size 18
	elseif TINY_MAP
	base_size 5
	elseif SMALL_MAP 
	base_size 6	
	elseif MEDIUM_MAP 
	base_size 7
	elseif LARGE_MAP 
	base_size 8
	else
	base_size 9
	endif
	land_position 99 99
}
create_land /* top blob */
{
	terrain_type DLC_DRYROAD
	land_percent 0
	if LUDIKRIS_MAP
	base_size 18
	elseif TINY_MAP
	base_size 5
	elseif SMALL_MAP 
	base_size 6	
	elseif MEDIUM_MAP 
	base_size 7
	elseif LARGE_MAP 
	base_size 8
	else
	base_size 9
	endif
	land_position 99 1
}
create_land /* bottom blob */
{
	terrain_type DLC_DRYROAD
	land_percent 0
	if LUDIKRIS_MAP
	base_size 18
	elseif TINY_MAP
	base_size 5
	elseif SMALL_MAP 
	base_size 6	
	elseif MEDIUM_MAP 
	base_size 7
	elseif LARGE_MAP 
	base_size 8
	else
	base_size 9
	endif
	land_position 1 99
}

Finally, forests in the Asian-theme contain a mix of bamboo and bushes.

If you’re familiar with terrains, you’ll know that bush forests (terrain ID 89) contain gaps due to them only having an 88% percent tree density. To fill in these gaps, you simply need to spawn straggler trees on the bush terrain.

/* FOREST_SECOND is the bush forest constant in this example */
create_object STRAGGLER /* Bamboo straggler */
{
	number_of_objects 1024
	set_scaling_to_map_size
	terrain_to_place_on FOREST_SECOND
} 

This method was originally used in Land Madness.

1 Like