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:
- 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.
- Moving to the terrain_generation section, I used a create_terrain command to change one random player’s land from BEACH to DLC_ROCk.
- 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.
- 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
- 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.