Galaxy Editor
Galaxy Editor documentation

Galaxy Editor Random Map Scripts (RMS): Complete Reference

How to write .rms random map scripts for Galaxy Editor's Random Map Generator, for Total Annihilation.

On this page

This document explains how to write a random map script (.rms) for Galaxy Editor, a map editor for the 1997 real-time strategy game Total Annihilation (TA). It is written so that someone with no other context, including an AI language model, can write a working script from this page alone.

If you are an AI model asked to "write a Galaxy Editor RMS", read this page in full, follow the rules in Section 2, use only names from Section 9, Section 11 and Section 12, and start from one of the complete scripts in Section 15.


Contents

  1. What a Galaxy Editor RMS is
  2. The ten rules (read these first)
  3. Units and coordinates
  4. How the generator runs a script
  5. Script syntax
  6. Preprocessor: constants, conditions and randomness
  7. Conditions you can test with if
  8. Sections, commands and attributes
  9. Terrain names
  10. Which terrains can touch which
  11. Stamps: hills, pools, islands and other Tile Brush pieces
  12. Objects: features, resources and start positions
  13. Messages the generator gives you
  14. Design advice and common mistakes
  15. Complete example scripts
  16. Differences from Age of Empires II
  17. Quick reference card

1. What a Galaxy Editor RMS is

Galaxy Editor has a Random Map Generator window (File > Random Map Generator...). It holds a text box where you write a script, a Players count (1 to 10), a Seed, and a Generate button. Generate repaints the map that is open, using the script. Undo puts the map back.

  • The script language is the one Age of Empires II (AoE2) uses for its random maps: section headers like <LAND_GENERATION>, commands like create_land { ... }, /* comments */, #const, if ... endif, start_random ... end_random, and so on.
  • The meaning is adapted to Total Annihilation. Terrain names are Galaxy Editor's Tile Brush ground types (such as GREENWORLD_BASE-60). Objects are TA features: trees, rocks, metal deposits, geothermal vents and start positions.
  • A map must already be open. Its size comes from the open map, not from the script. To make a new map, use File > New Map first, pick a size, then generate.
  • The script is drawn with real tiles from Galaxy Editor's random map tileset (GE-Favorites-RandomMapGeneratorTiles.hpi). Coasts, cliffs, shallows and blends between ground types are filled in automatically.
  • The same script with the same Seed and Players count always gives the same map. Change the Seed for a different map.
  • Example button: loads one of 11 bundled example scripts, one per tileset family (GreenWorld, Lava, Mars, Ice, Crystal, Acid, Archipelago, Lush, Desert, Metal, Mixed).
  • The right-hand panel lists every terrain name and stamp name the installed tileset has, plus the doodad kinds. Click a name to copy it. That panel is the authority if this page and the editor ever disagree, because the tileset can gain new pieces.

The heights in names

Every terrain name ends in a height, such as the 60 in GREENWORLD_BASE-60. It is the ground's real height in the TA heightmap, on a 0 to 255 scale. Galaxy Editor's default sea level is 50:

  • Height 0 to 50: under water (deep water, shallows).
  • Height 51 and up: dry land. Plains stand around 52 to 61, and plateaus and mountain tops from about 114 up to 230.

2. The ten rules (read these first)

  1. Use only the terrain, stamp and object names listed on this page (Sections 9, 11 and 12). An unknown name is skipped with a message. Typos are the most common cause of a broken map.
  2. Terrain names are WORLD_BASE-HEIGHT, all capitals, using the current heights: GREENWORLD_BASE-60, not GREENWORLD_BASE-85. Older documents and older versions of the editor used heights 25 higher; those names no longer exist.
  3. One script tile is one "square" = 16 x 16 map tiles = 512 x 512 pixels. Maps are small in squares: a "16 x 16" map is only 16 squares across. AoE2 maps are 120 to 480 tiles across, so never copy AoE2 numbers like base_size 12 or number_of_tiles 500. Scale them down roughly 10x or more (see Section 3).
  4. Object distances are in feature cells, which are much smaller: 32 feature cells to a square. min_distance_to_players 16 is half a square.
  5. Start with <PLAYER_SETUP> then <LAND_GENERATION> with a base_terrain, usually a water such as GREENWORLD_BASE-0. Then add lands. Sections may appear in any order in the file, but each one always runs in this order: lands, elevation, cliffs, terrain, connections, objects.
  6. Keep neighbouring ground types joinable. Two ground types touch cleanly only when the tileset has transition pieces for them (Section 10). Inside one world, the generator adds any missing in-between ground for you. Between worlds, only certain pairs blend.
  7. Put a space after /* and before */. /*comment*/ written without spaces is not a comment.
  8. Write math in parentheses with spaces around each operator: (4 * 2). Write rnd(1,5) with no spaces. Math runs strictly left to right with no operator precedence.
  9. if tests only names, such as if TINY_MAP or if 4_PLAYER_GAME. There are no comparisons such as if PLAYERS > 4. Define your own flags with #define.
  10. Every create_land, create_terrain, create_elevation, create_object and create_connect_... command needs a { } block, even an empty one.

3. Units and coordinates

Unit Size Used by
Square (script tile, lattice node) 16 x 16 map tiles, 512 x 512 px Everything in <LAND_GENERATION>, <TERRAIN_GENERATION>, <ELEVATION_GENERATION>, <CLIFF_GENERATION>, <CONNECTION_GENERATION>: base_size, number_of_tiles, other_zone_avoidance_distance, spacing_to_other_terrain_types, cliff lengths, terrain_size, and so on
Percent of the map 0 to 100 land_percent, left_border / right_border / top_border / bottom_border, land_position, circle_radius
Feature cell 16 x 16 px, half a map tile. 32 feature cells = 1 square Everything in <OBJECTS_GENERATION>: min_distance_to_players, max_distance_to_players, group_placement_radius, min_distance_group_placement, min_distance_to_map_edge, avoid_cliff_zone
Map tile 32 x 32 px Only used to describe stamps (an "8x8" hill is 8 x 8 map tiles = half a square)

The lattice

The generator paints on a grid of nodes, one at every corner between squares. A map W x H squares across has (W + 1) x (H + 1) nodes. A 16 x 16 map has 17 x 17 = 289 nodes. A land or terrain "tile" in a script is one node. Each square between four nodes is then drawn with a piece of the tileset that matches its four corners: flat ground when all four corners are the same, or a coast, cliff, shallow or blend piece when they differ.

Coordinates run left to right (x) and top to bottom (y). land_position 0 0 is the top-left corner and land_position 100 100 the bottom-right.

Sizes in practice

Map game size Nodes Nodes in total Scale factor (nodes / 100) Map size condition
8 x 8 9 x 9 81 0.81 TINY_MAP
10 x 10 11 x 11 121 1.21 SMALL_MAP
12 x 12 13 x 13 169 1.69 MEDIUM_MAP
16 x 16 17 x 17 289 2.89 LARGE_MAP
20 x 20 21 x 21 441 4.41 HUGE_MAP
24 x 24 25 x 25 625 6.25 GIGANTIC_MAP
32 x 32 33 x 33 1089 10.89 MAPSIZE_GIANT
bigger LUDIKRIS_MAP

The map size condition is picked from the larger of the two sides.

How big things are. On a 16 x 16 map:

  • land_percent 10 is about 29 nodes.
  • base_size 1 is a 3 x 3 node block (9 nodes). base_size 2 is 5 x 5 (25 nodes), and base_size 3, the default, is 7 x 7 (49 nodes).

So keep base_size at 0 to 2 for most lands, and use 3 only for one big central land on a large map.

Feature cells on a 16 x 16 map: 512 x 512 feature cells. set_scaling_to_map_size on objects multiplies by (feature cells across x feature cells down) / 10,000, which is 26.2 on a 16 x 16 map and 6.6 on an 8 x 8 map. So scaled object counts should be small, for example number_of_groups 0.5.


4. How the generator runs a script

  1. Read. The script is read once. Comments are removed. #define, #const, if, start_random and rnd() are all settled now, using the Seed. The result is a plain list of commands.
  2. Lands (<LAND_GENERATION>). The whole map is filled with base_terrain. Every land picks an origin node, claims its base_size block, then all lands grow at the same time, one node per land per round, until each reaches its size or runs out of room. Later lands are painted over earlier ones where their edges meet.
  3. Elevation (<ELEVATION_GENERATION>). Each create_elevation is set aside. Its hills are stamped at the end (step 8).
  4. Cliffs (<CLIFF_GENERATION>). Short ridges of a higher ground (for example GREENWORLD_BASE-194 on GREENWORLD_BASE-60) are drawn. The tileset gives them cliff faces.
  5. Terrain (<TERRAIN_GENERATION>). Each create_terrain grows clumps of a terrain over the existing ground, in script order. A create_terrain that names a stamp is set aside for step 8.
  6. Connections (<CONNECTION_GENERATION>). Paths are found between land origins, and terrain along each path is replaced (for example water to shallows, making a ford).
  7. Objects (<OBJECTS_GENERATION>). Start positions, metal, vents, trees, rocks and other features are placed.
  8. Tiles and stamps. Every square is drawn with a tileset piece. Squares with no matching piece are repaired, or filled with their most common corner (a message says how many). Then the stamps from steps 3 and 5 are placed on flat ground of their base.

When a script has <OBJECTS_GENERATION>, every feature on the map is replaced. When it makes player lands or places START_POSITION, the map's start positions are replaced. Trees on sloped tiles, and metal or vents on uneven ground, are removed after the ground is built.

Painting is smart. When a node is painted next to a ground it cannot join directly, the brush also changes the neighbouring nodes into the in-between grounds. For example, a GREENWORLD_BASE-194 plateau painted in GREENWORLD_BASE-0 water joins by a sea cliff, and ICE_BASE-145 painted in ICE_BASE-0 water gets a ring of ICE_BASE-60 around it, because Ice has no piece from water straight up to its plateau. You do not have to write those rings yourself.


5. Script syntax

Words

The script is split into words at spaces, tabs and new lines. { and } are always words of their own, even when they touch other text. Everything else must be separated by whitespace.

Comments

/* A comment. Comments may span lines and may be /* nested */ like this. */

/* and */ must be separate words. /*like this*/ is not a comment.

Section headers

A word in angle brackets: <PLAYER_SETUP>. Every command must come after a header and belongs to the section of the last header before it. The known sections are:

<PLAYER_SETUP>, <LAND_GENERATION>, <ELEVATION_GENERATION>, <CLIFF_GENERATION>, <TERRAIN_GENERATION>, <CONNECTION_GENERATION>, <OBJECTS_GENERATION>

A header may appear more than once. An unknown section is skipped whole, with a message.

Commands and blocks

command_name argument {
  attribute value
  attribute value value
  flag_attribute
}
  • Command and attribute names are lower case and must be spelled exactly.
  • Terrain names and object names are not case sensitive (greenworld_base-60 works), but write them in capitals by convention.
  • A command in the wrong section is skipped with a message.
  • An attribute that does nothing in that command is skipped with a message.
  • If an attribute is given twice, the later one wins. The exceptions are replace_terrain, terrain_cost, terrain_size and spacing_to_specific_terrain, which repeat to list several terrains.
  • Blocks cannot be nested.

6. Preprocessor: constants, conditions and randomness

#define NAME

Makes NAME true for later if NAME tests.

#define WATER_MAP

#const NAME value

Defines a constant. Use the name anywhere a value is expected, including inside math.

#const ISLAND_SIZE 3
#const CENTRE_PERCENT (ISLAND_SIZE * 4)

A #const set from math in parentheses cannot be changed later. There are no built-in constants such as map width or player count; use conditions instead (Section 7).

if / elseif / else / endif

if TINY_MAP
  base_size 1
elseif SMALL_MAP
  base_size 1
else
  base_size 2
endif
  • The condition is a single name, true when it is a built-in condition (Section 7) or was #defined.
  • There are no operators: no !, no and, no >. Nest if blocks instead.
  • if blocks may wrap whole commands or single attributes inside a block, and may be nested.

start_random / percent_chance / end_random

Picks one branch at random:

start_random
  percent_chance 30
    #define SNOWY
  percent_chance 70
    #define GRASSY
end_random

One number from 0 to 99 is rolled. Each percent_chance takes the next slice of the range. If the percentages add up to less than 100, sometimes no branch is taken. Random blocks can be nested and can appear inside blocks.

rnd(min,max)

A random whole number from min to max, inclusive. No spaces inside: rnd(2,5).

land_percent rnd(8,14)

Math in parentheses

#const A 6
land_percent (A * 2 + 1)
  • Operators are + - * / %, each separated by spaces.
  • Math runs strictly left to right: (2 + 3 * 4) is 20, not 14.
  • Division by zero gives 0.
  • Values may be numbers or #const names.
  • Whole-number attributes drop the fraction (2.9 becomes 2).

#include, #include_drs

These are not supported. Paste the content in instead.


7. Conditions you can test with if

These are set before the script is read:

Condition True when
RANDOM_MAP always
GALAXY_EDITOR always (use it to keep AoE2-only parts out)
DE_AVAILABLE always
0_TEAM_GAME always (there are no teams)
1_PLAYER_GAME ... 10_PLAYER_GAME the Players count in the window
TINY_MAP, MAPSIZE_TINY the map's larger side is 8 squares or less
SMALL_MAP, MAPSIZE_SMALL 9 to 10 squares
MEDIUM_MAP, MAPSIZE_MEDIUM 11 to 12 squares
LARGE_MAP, MAPSIZE_NORMAL 13 to 16 squares
HUGE_MAP, MAPSIZE_LARGE 17 to 20 squares
GIGANTIC_MAP, MAPSIZE_HUGE 21 to 24 squares
MAPSIZE_GIANT 25 to 32 squares
LUDIKRIS_MAP, MAPSIZE_LUDICROUS more than 32 squares

Only one map size condition is true at a time. For "this size or bigger", list each size in an if / elseif chain.


8. Sections, commands and attributes

Each command lists its arguments, its attributes and their defaults in Galaxy Editor. "Skipped" means the name is accepted but has no effect; a message says so.

8.1 <PLAYER_SETUP>

Command Effect
random_placement Accepted. Player lands are always placed in a random order around a circle.
direct_placement Player lands that have land_position are placed exactly there instead of on the circle.
grouped_by_team, nomad_resources, force_nomad_treaty, override_map_size N, set_gaia_civilization N, water_definition N, ai_info_map_type A B C D, effect_amount A B C D, effect_percent A B C D, guard_state A B C D, terrain_state A B C D, weather_type A B C D Accepted and ignored. The map size always comes from the open map.
behavior_version N (any section) With 1 or more, number_of_tiles on a land is the land's total size; otherwise it is added to the base.

A minimal setup is just:

<PLAYER_SETUP>
random_placement

8.2 <LAND_GENERATION>

Command Effect
base_terrain TERRAIN Fills the whole map first. Without it the map is GREENWORLD_BASE-60. Usually a water.
create_player_lands { ... } One land per player. Its size is shared out among the players.
create_land { ... } One land.
base_layer, enable_waves Skipped.

Attributes of create_land and create_player_lands:

Attribute Default Meaning
terrain_type TERRAIN GREENWORLD_BASE-60 The land's ground.
land_percent N 100 Size as a percent of all nodes. For create_player_lands it is the total for all players together, divided evenly.
number_of_tiles N Size in nodes, instead of land_percent; whichever of the two comes last wins. By default it is added to the base; with behavior_version 1 it is the total.
base_size R 3 The square block, R nodes in each direction from the origin, that the land always claims: 0 is 1 node, 1 is 3 x 3, 2 is 5 x 5. Use 0 to 2 on most maps.
set_circular_base off Rounds the base. It only has an effect when base_size is more than 3.
land_position X Y random Origin as percent of width and height (0 0 is top-left). It always applies to non-player lands. It applies to player lands only with direct_placement.
left_border, right_border, top_border, bottom_border N 0 Keep the land N percent away from that edge. They also set where a random origin may be.
border_fuzziness N 20 How strictly borders hold: 0 ignores them, 100 holds them exactly, and values in between let the land spill a little past them.
clumping_factor N 8 Shape: higher values (up to about 30) grow rounder, more compact lands; lower values are ragged; negative values grow snaking shapes.
generate_mode 1 0 Lets random origins go into the map's corners, which are avoided by default.
circle_radius R [V] For player lands: the circle's radius as a percent of map width, and its variance (percent wobble). The default radius is 36% of the bordered area, with 20% variance.
zone N each player's land has its own zone; every other land shares zone -10 Lands in the same zone may touch and merge.
set_zone_randomly Random zones among the players' lands, so some players may share a continent.
set_zone_by_team Accepted. There are no teams, so each player keeps a zone of their own.
other_zone_avoidance_distance N 0 Keeps N nodes of base_terrain between this land and lands of other zones. Both lands need it; the smaller value is used. This is how you make islands.
min_placement_distance N as other_zone_avoidance_distance Minimum distance in nodes from this land's origin to earlier lands' origins.
assign_to_player N Makes a create_land belong to player N; it is skipped when fewer players are playing.
assign_to 0 N 0 0 Same as assign_to_player N. Assigning by colour or team is read as unassigned.
land_id N A number objects can target with place_on_specific_land_id N.
base_elevation, land_conformity, base_layer Skipped.

How origins are chosen

  • Player lands sit evenly around a circle in the bordered area, in random order, starting at a random angle.
  • Lands with land_position start exactly there.
  • Other lands pick a random node inside their borders. It must keep clear of earlier lands by their base sizes plus the avoidance distance, and keep out of the corners unless generate_mode 1 is set. If there is no room, the land starts in the middle of the map and you get a message.

Player lands also make start positions. A start is placed at each player land's origin, unless an <OBJECTS_GENERATION> START_POSITION command places them some other way.

8.3 <ELEVATION_GENERATION>

In TA, hills are tileset pieces, not raised heightmap blobs. create_elevation scatters the hill stamps of a ground type.

create_elevation 3 {
  base_terrain GREENWORLD_BASE-60
  number_of_clumps 5
  set_scale_by_groups
}
Part Meaning
create_elevation N N below 4 uses only the small hills (8 x 8 map tiles or less). N of 4 or more also uses the bigger ones.
base_terrain TERRAIN Required. Only flat squares of this ground get hills. Its world must have hill stamps (Section 11): any stamp on that ground whose name contains HILL.
number_of_clumps N Number of hills (default 1).
set_scale_by_size or set_scale_by_groups Multiplies the count by the scale factor (nodes / 100).
set_avoid_player_start_areas [N] Hills stay this many nodes from player origins. By default they always stay about a ninth of the map away.
spacing_to_other_terrain_types N Every square within N squares of the hill must be the same ground.
number_of_tiles, spacing, enable_balanced_elevation, base_layer Accepted, no effect.

Grounds with hills for create_elevation:

  • Any N works (they have small hills): GREENWORLD_BASE-60, LAVA_BASE-61, LUSH_BASE-52, ICE_BASE-60, MARS_BASE-60, ARCHIPELAGO_BASE-53, EVERGREEN_BASE-60 and EVERGREEN2_BASE-60.
  • N must be 4 or more (all their hills are bigger than 8 x 8 tiles; with a smaller N you get "found no hills"): DESERT_BASE-55, ACID_BASE-60, CRYSTAL_BASE-60 and ARCHIPELAGO_BASE-169.

8.4 <CLIFF_GENERATION>

Draws short ridges of a world's next higher ground across open ground of that world, joined by cliff faces. These commands take one number each and no block:

Command Default Meaning
min_number_of_cliffs N 3 Fewest cliffs, before scaling.
max_number_of_cliffs N 8 Most cliffs. The count is picked between the two, then multiplied by the scale factor (nodes / 100, at least 1).
min_length_of_cliff N 2 Shortest ridge, in nodes.
max_length_of_cliff N 4 Longest ridge, in nodes.
cliff_curliness N 36 Percent chance at each step to turn left or right.
min_distance_cliffs N 2 Nodes between cliffs.
min_terrain_distance N 1 Every node within N must be the same ground as the start (keeps cliffs off coasts and other grounds).
cliff_type X Skipped: each ground has its own cliffs.

Cliffs stay away from player origins (about a ninth of the map) and the map edge. Connections go around them unless you price them with terrain_cost.

Which ground a cliff raises, by the ground it starts on:

Starts on Raises to
GREENWORLD_BASE-60 GREENWORLD_BASE-194
LAVA_BASE-61 LAVA_BASE-165
LAVA_BASE-51 LAVA_BASE-61
LUSH_BASE-52 LUSH_BASE-158
MARS_BASE-60 MARS_BASE-230
ICE_BASE-60 ICE_BASE-145
METAL_BASE-60 METAL_BASE-114
METAL_BASE-114 METAL_BASE-230
DESERT_BASE-55 DESERT_BASE-130
DESERT_BASE-130 DESERT_BASE-205
ARCHIPELAGO_BASE-53 ARCHIPELAGO_BASE-169
EVERGREEN_BASE-60 EVERGREEN_BASE-165
EVERGREEN_BASE-165 EVERGREEN_BASE-230
EVERGREEN_BASE-0 (water) EVERGREEN_BASE-165 (a sea stack)
EVERGREEN2_BASE-60 EVERGREEN2_BASE-165
EVERGREEN2_BASE-165 EVERGREEN2_BASE-230
SNOWYEVERGREEN_BASE-60 SNOWYEVERGREEN_BASE-164
SNOWYEVERGREEN_BASE-164 SNOWYEVERGREEN_BASE-230
SNOWYEVERGREEN_BASE-50 (frozen water) SNOWYEVERGREEN_BASE-164
SNOWYEVERGREEN_BASE-0 (water) SNOWYEVERGREEN_BASE-164 (a sea stack)

The other grounds, such as Acid, Crystal, Quagmire, any shallows and most waters, get no cliffs. If the map has only those grounds, the section draws nothing and gives a message.

8.5 <TERRAIN_GENERATION>

create_terrain TERRAIN {
  base_terrain GREENWORLD_BASE-60
  land_percent 4
  number_of_clumps 3
  spacing_to_other_terrain_types 1
}

create_terrain grows clumps of TERRAIN over existing ground. The argument may also be a stamp name (Section 11), which places whole tileset pieces instead.

Attribute Default Meaning
base_terrain TERRAIN any ground Only grows over this ground.
land_percent N Total size, percent of all nodes.
number_of_tiles N 0.85% of the nodes Total size in nodes. Of land_percent and number_of_tiles, whichever comes last wins.
number_of_clumps N 1 The total is split into this many clumps.
set_scale_by_size Multiplies the total by the scale factor.
set_scale_by_groups Multiplies both the total and the clump count by the scale factor.
spacing_to_other_terrain_types N 0 Stays N nodes away from any other ground. Use 1 for clean patches.
spacing_to_specific_terrain TERRAIN N Stays N nodes from that terrain. It may be repeated.
set_avoid_player_start_areas [N] off Stays N nodes from player origins. Without N, about a ninth of the map.
clumping_factor N 20 Shape, as for lands.
height_limits, set_flat_terrain_only, beach_terrain, terrain_mask, base_layer Skipped.

Terrains run in script order, and each sees the result of the ones before it. To make patches inside patches, for example a plateau with a lake on top, write the outer one first.

For a stamp name, create_terrain places that many whole pieces on flat squares of the stamp's own ground (Section 11):

  • number_of_clumps N is how many pieces (default 1).
  • land_percent and number_of_tiles instead set an area to cover: number_of_tiles counts squares, and the count is the area divided by the average piece size.
  • set_scale_by_size or set_scale_by_groups multiplies the count by the scale factor.
  • spacing_to_other_terrain_types N keeps N squares of the same ground around each piece.
  • set_avoid_player_start_areas works as above.
  • base_terrain, if given, must be the stamp's own ground; any other is ignored.
  • Pieces never overlap.

8.6 <CONNECTION_GENERATION>

Finds the cheapest path between land origins and repaints terrain along it, for example to make fords or land bridges.

Command Connects
create_connect_all_players_land { } every pair of player lands
create_connect_all_lands { } every pair of lands
create_connect_same_land_zones { } every pair of lands (same as above)
create_connect_land_zones Z1 Z2 { } lands in zone Z1 or Z2
create_connect_to_nonplayer_land { } each player land to each non-player land
create_connect_teams_lands { } nothing (no teams), with a message
accumulate_connections (no block) later connections see the terrain earlier ones changed; otherwise every connection reads the map as it was before connections
Attribute Meaning
terrain_cost TERRAIN N Cost of crossing that ground (default 1). 0 makes it impassable. Cliff ridges cost 25 unless you price their ground.
replace_terrain FROM TO Along the path, FROM becomes TO. It may be repeated.
default_terrain_replacement TO Everything along the path becomes TO. It cancels replace_terrain lines written before it, but not ones after.
terrain_size TERRAIN R V Width of the path where it crosses TERRAIN: a round brush of radius R nodes, ± random V (default radius 1). Radius 0 changes only the path's own nodes.

Example: shallow fords across a sea between player islands.

create_connect_all_players_land {
  replace_terrain GREENWORLD_BASE-0 GREENWORLD_BASE-43
  terrain_cost GREENWORLD_BASE-0 5
  terrain_cost GREENWORLD_BASE-60 1
  terrain_size GREENWORLD_BASE-0 0 0
}

8.7 <OBJECTS_GENERATION>

create_object NAME {
  number_of_objects 3
  set_place_for_every_player
  min_distance_to_players 10
  max_distance_to_players 30
}

NAME is START_POSITION, a doodad kind, a world-limited kind, or an exact TA feature name (Section 12). All distances are in feature cells (32 to a square).

Attribute Default Meaning
number_of_objects N 1 Objects in total, or per group when number_of_groups is given.
number_of_groups N Makes groups: N groups of number_of_objects each. It may be a fraction before scaling (0.5).
group_variance N 0 Each group's size ± up to N.
group_placement_radius N 3 Loose groups spread within this radius.
set_tight_grouping / set_loose_grouping loose Tight groups grow outward from member to neighbour (for groves and forests).
set_scaling_to_map_size Multiplies the groups (or the objects, without groups) by (feature cells across x down) / 10,000, which is 26.2 on a 16 x 16 map.
set_scaling_to_player_number Multiplies by the number of players.
set_place_for_every_player Repeats the command once for each player. Distances are then measured from that player alone. Without max_distance_to_players, objects stay on that player's own land.
min_distance_to_players N At least N from player land origins (from every player, or from the round's player).
max_distance_to_players N At most N.
terrain_to_place_on TERRAIN any dry flat ground Only on this ground. This is the only way to place in water, which also requires an underwater feature.
place_on_specific_land_id N Only on the land with land_id N.
min_distance_group_placement N 0 Keeps N away from every object already placed, by this command or earlier ones.
temp_min_distance_group_placement N 0 Keeps N away from this command's own earlier groups.
min_distance_to_map_edge N 0 Keeps N away from the map edge.
avoid_cliff_zone [N] off; 4 if no N Stays N from any coast, cliff or blend square.
layer_to_place_on, avoid_forest_zone, find_closest, resource_delta, second_object, generate_for_first_land_only Skipped.
set_gaia_object_only, set_gaia_unconvertible, make_indestructible Accepted, no effect.

9. Terrain names

Format: WORLD_BASE-HEIGHT. Each world is one TA tileset family. Water is height 0. "Liquid" grounds (water, shallows, lava, frozen water) get no dry-land features; objects only go there with terrain_to_place_on and an underwater feature.

World Terrain name Height What it is
GreenWorld (temperate grass) GREENWORLD_BASE-0 0 deep water (liquid)
GREENWORLD_BASE-43 43 shallow water (liquid)
GREENWORLD_BASE-60 60 grass plain
GREENWORLD_BASE-194 194 high grass plateau (cliffs)
Lava LAVA_BASE-16 16 molten lava sea (liquid)
LAVA_BASE-51 51 cracked low ground
LAVA_BASE-61 61 rock plain
LAVA_BASE-165 165 high rock plateau
Mars (red desert) MARS_BASE-0 0 water (liquid)
MARS_BASE-60 60 red plain
MARS_BASE-230 230 high red mesa
Ice ICE_BASE-0 0 icy water (liquid)
ICE_BASE-60 60 snow and ice plain
ICE_BASE-145 145 ice plateau
Crystal CRYSTAL_BASE-0 0 water (liquid)
CRYSTAL_BASE-60 60 crystal plain
Acid ACID_BASE-0 0 acid sea (liquid)
ACID_BASE-60 60 acid plain
Archipelago (tropical) ARCHIPELAGO_BASE-0 0 deep sea (liquid)
ARCHIPELAGO_BASE-43 43 shallows (liquid)
ARCHIPELAGO_BASE-53 53 sand
ARCHIPELAGO_BASE-169 169 high rocky ground
Lush (jungle) LUSH_BASE-7 7 swampy water (liquid)
LUSH_BASE-52 52 jungle floor
LUSH_BASE-158 158 jungle highland
LUSH_BASE-230 230 jungle peak plateau
Desert DESERT_BASE-0 0 water (liquid)
DESERT_BASE-43 43 shallows / oasis water (liquid)
DESERT_BASE-55 55 sand plain
DESERT_BASE-130 130 mesa
DESERT_BASE-205 205 high mesa
Metal (industrial) METAL_BASE-0 0 water (liquid)
METAL_BASE-43 43 shallows (liquid)
METAL_BASE-60 60 metal plating
METAL_BASE-114 114 raised plating
METAL_BASE-194 194 high plating
METAL_BASE-230 230 top plating
Metal2 (Metal's second, darker water) METAL2_BASE-0 0 dark water (liquid)
METAL2_BASE-43 43 dark shallows (liquid)
Evergreen (forest grass) EVERGREEN_BASE-0 0 water (liquid)
EVERGREEN_BASE-40 40 shallows (liquid)
EVERGREEN_BASE-60 60 forest grass
EVERGREEN_BASE-165 165 plateau
EVERGREEN_BASE-230 230 high plateau
Evergreen2 (Evergreen's second grass, has no water of its own) EVERGREEN2_BASE-60 60 second grass
EVERGREEN2_BASE-165 165 plateau
EVERGREEN2_BASE-230 230 high plateau
SnowyEvergreen (snow-covered forest) SNOWYEVERGREEN_BASE-0 0 water (liquid)
SNOWYEVERGREEN_BASE-40 40 shallows (liquid)
SNOWYEVERGREEN_BASE-50 50 frozen water (liquid)
SNOWYEVERGREEN_BASE-60 60 snow
SNOWYEVERGREEN_BASE-164 164 snow plateau
SNOWYEVERGREEN_BASE-230 230 snow peak plateau
Quagmire (bog) QUAGMIRE_BASE-0 0 water (liquid)
QUAGMIRE_BASE-60 60 bog ground (often used as "dirt" patches on other worlds)
WaterWorld (sea floor) WATERWORLD_BASE-0 0 open water (liquid)
WATERWORLD_BASE-1 1 sea floor (counts as dry ground for features)
WATERWORLD_BASE-45 45 reef shallows (counts as dry ground for features)

Mixing worlds is allowed. A script may use grounds of several worlds, and every base of every world it names becomes available to the painter.


10. Which terrains can touch which

Two neighbouring nodes of different ground need a transition piece in the tileset. These are the pairs that join directly. Any other pair inside one world is joined automatically through the grounds in between. For example, GREENWORLD_BASE-0 next to GREENWORLD_BASE-60 passes through a coast, and ICE_BASE-0 next to ICE_BASE-145 gets an ICE_BASE-60 ring.

10.1 Inside one world

World Direct joins (low — high: kind)
GreenWorld 0—43 shallows · 0—60 coast · 0—194 sea cliff · 43—60 shallow coast · 43—194 sea cliff · 60—194 cliff
Lava 16—61 lava coast · 51—61 cliff · 61—165 cliff
Mars 0—60 coast · 60—230 cliff
Ice 0—60 coast · 60—145 cliff
Crystal 0—60 coast
Acid 0—60 coast
Archipelago 0—43 shallows · 0—53 coast · 43—53 shallow coast · 53—169 cliff
Lush 7—52 coast · 52—158 cliff · 52—230 cliff
Desert 0—43 shallows · 0—55 coast · 43—55 shallow coast · 55—130 cliff · 130—205 cliff
Metal 0—43 shallows · 0—60 coast · 43—60 shallow coast · 60—114 cliff · 60—194 cliff · 114—230 cliff (water reaches 194 through 60)
Metal2 0—43 shallows · with Metal's land: METAL2_BASE-0—METAL_BASE-60 coast, METAL2_BASE-43—METAL_BASE-60 shallow coast, METAL2_BASE-0—METAL_BASE-114 sea cliff
Evergreen 0—40 shallows · 0—60 coast · 0—165 sea cliff · 40—60 shallow coast · 60—165 cliff · 165—230 cliff
Evergreen2 60—165 cliff · 165—230 cliff · it uses Evergreen's water: EVERGREEN_BASE-0—EVERGREEN2_BASE-60 coast, EVERGREEN_BASE-40—EVERGREEN2_BASE-60 shallow coast, EVERGREEN_BASE-0—EVERGREEN2_BASE-165 sea cliff, EVERGREEN_BASE-60—EVERGREEN2_BASE-165 cliff, EVERGREEN_BASE-60—EVERGREEN2_BASE-60 blend
SnowyEvergreen 0—40 shallows · 0—60 coast · 0—164 sea cliff · 40—60 shallow coast · 50—60 frozen shore · 50—164 frozen cliff · 60—164 cliff · 164—230 cliff
Quagmire 0—60 coast
WaterWorld 0—1 and 0—45 only; it has no dry land

10.2 Between worlds

Water beside water. These water pairs blend into each other:

  • Base-0 waters: GREENWORLD_BASE-0, MARS_BASE-0, ICE_BASE-0, CRYSTAL_BASE-0, ACID_BASE-0, ARCHIPELAGO_BASE-0, DESERT_BASE-0, METAL_BASE-0, METAL2_BASE-0, EVERGREEN_BASE-0, QUAGMIRE_BASE-0, SNOWYEVERGREEN_BASE-0, WATERWORLD_BASE-0. They blend with each other in most pairs. These pairs have no water blend:
  • GreenWorld with Ice
  • GreenWorld with Metal
  • Ice with Metal
  • Archipelago with Desert
  • SnowyEvergreen with any water except WaterWorld's
  • LUSH_BASE-7 blends with every Base-0 water above except SnowyEvergreen's.
  • Lava has no water. Its lava sea LAVA_BASE-16 blends with nothing, but it does join METAL_BASE-60 by a lava coast.

Land beside land. These plains blend into each other:

  • GREENWORLD_BASE-60, MARS_BASE-60, ICE_BASE-60, CRYSTAL_BASE-60, ACID_BASE-60, METAL_BASE-60, QUAGMIRE_BASE-60, EVERGREEN_BASE-60, EVERGREEN2_BASE-60, SNOWYEVERGREEN_BASE-60, LAVA_BASE-61, LUSH_BASE-52, ARCHIPELAGO_BASE-53 and DESERT_BASE-55.
  • Almost every pair of them blends. These pairs do not:
  • QUAGMIRE_BASE-60 with DESERT_BASE-55
  • QUAGMIRE_BASE-60 with LUSH_BASE-52
  • QUAGMIRE_BASE-60 with ARCHIPELAGO_BASE-53
  • QUAGMIRE_BASE-60 with LAVA_BASE-61

Painting QUAGMIRE_BASE-60 against Archipelago sand or Lava ground still works: the brush puts a ring of water between them, because their waters do blend. If you don't want that moat, keep them apart with a plain both blend with, such as GREENWORLD_BASE-60.

Plateaus, shallows and cliffs never cross worlds. A GREENWORLD_BASE-194 plateau must stand on GreenWorld ground, DESERT_BASE-43 shallows must sit in Desert ground or water, and so on. Here is how the cross-world plains reach water:

  • A plain beside another world's water joins through its own world's water. GreenWorld grass beside Mars water gets a strip of GreenWorld water first, which then blends with the Mars water.
  • Evergreen2 grass has no water of its own. Its coasts run into Evergreen's water, EVERGREEN_BASE-0 and EVERGREEN_BASE-40.
  • Metal2 water meets Metal's land directly (coast, shallow coast and sea cliff, see 10.1), and blends with METAL_BASE-0.

Squares that end up with no matching piece are filled with their most common corner. The generator reports how many squares, and which pieces were missing, in its messages.


11. Stamps: hills, pools, islands and other Tile Brush pieces

Stamps are hand-made tileset pieces placed whole: hills, craters, pools, islands, rough patches, arms of land, mountains. Use a stamp name as the argument of create_terrain; create_elevation uses the HILL stamps of its ground.

  • Each stamp goes only on flat squares of its own ground (the "Sits on" column). That ground must cover every square under the piece.
  • Pieces never overlap.
  • An "8X8" piece is 8 x 8 map tiles, half a square. "16X16" is one square, "32X32" is 2 x 2 squares. Stamps without a size mix several sizes.
Stamp name Sits on What it is
GREENWORLD_HILL-60_8X8 GREENWORLD_BASE-60 small hill
GREENWORLD_HILL-60_16X16 GREENWORLD_BASE-60 hill
GREENWORLD_ROUGH-60 GREENWORLD_BASE-60 rough patch
GREENWORLD_MOUNTAINS-60 GREENWORLD_BASE-60 big mountains and craters (16x14 to 43x48 tiles)
GREENWORLD_POOL_SMALL GREENWORLD_BASE-60 small pond (5x5 to 14x14 tiles)
GREENWORLD_ISLAND_8X8 GREENWORLD_BASE-0 islet
LAVA_HILL-61_8X8 LAVA_BASE-61 small hill
LAVA_HILL-61_16X16 LAVA_BASE-61 hill
LAVA_POOL-61_8X8 LAVA_BASE-61 lava pool
LAVA_POOL-61_16X16 LAVA_BASE-61 lava pool
LAVA_POOL-61_32X32 LAVA_BASE-61 big lava pool
LAVA_ISLAND_48X48 LAVA_BASE-16 island in the lava sea (3 x 3 squares)
MARS_HILLS-60_8X8 MARS_BASE-60 small hill
MARS_POOL-60_8X8 MARS_BASE-60 pool
MARS_POOL-60_16X16 MARS_BASE-60 pool
MARS_ROUGH-60_16X16 MARS_BASE-60 rough patch
MARS_FEATURE-60 MARS_BASE-60 crater or rock feature
MARS_ISLAND-0_8X8 MARS_BASE-0 islet
MARS_ISLAND-0_16X16 MARS_BASE-0 island
MARS_ISLAND-0_32X32 MARS_BASE-0 big island
ICE_HILLS-60_8X8 ICE_BASE-60 small hill
ICE_HILLS-60_16X16 ICE_BASE-60 hill
ICE_POOLS-60 ICE_BASE-60 frozen pool
ICE_ISLAND-0_8X8 ICE_BASE-0 ice floe
ICE_ISLAND-0_16X16 ICE_BASE-0 island
CRYSTAL_CRATER-60_8X8 CRYSTAL_BASE-60 small crater
CRYSTAL_CRATER-60_16X16 CRYSTAL_BASE-60 crater
CRYSTAL_HILLS-60_16X16 CRYSTAL_BASE-60 hill
CRYSTAL_HILLS-60_32X32 CRYSTAL_BASE-60 big hill
CRYSTAL_POND-60 CRYSTAL_BASE-60 pond
CRYSTAL_ROUGH-60 CRYSTAL_BASE-60 rough patch (mixed sizes)
CRYSTAL_ISLAND-60_16X16 CRYSTAL_BASE-0 island
CRYSTAL_ISLAND-60_32X32 CRYSTAL_BASE-0 big island
CRYSTAL_REEF-60_16X16 CRYSTAL_BASE-0 reef
CRYSTAL_REEF-60_32X32 CRYSTAL_BASE-0 big reef
ACID_POOLS-60 ACID_BASE-60 acid pool
ACID_HILLS-60_16X16 ACID_BASE-60 hill
ACID_MOUNDS-60_16X16 ACID_BASE-60 mound
ACID_PUDDLES-60_16X16 ACID_BASE-60 puddles
ACID_TRAILS-60_16X16 ACID_BASE-60 trails
ACID_ACID-0_16X16 ACID_BASE-0 acid patch
ACID_ISLANDS-0_16X16 ACID_BASE-0 island
ACID_ISLANDS-0_32X32 ACID_BASE-0 big island
ARCHIPELAGO_HILLS-53_8X8 ARCHIPELAGO_BASE-53 small dune hill
ARCHIPELAGO_HILLS-53_16X16 ARCHIPELAGO_BASE-53 dune hill
ARCHIPELAGO_HILL-169_16X16 ARCHIPELAGO_BASE-169 hill on the high ground
ARCHIPELAGO_ISLAND-0_8X8 ARCHIPELAGO_BASE-0 islet
ARCHIPELAGO_ROCKY-0_8X8 ARCHIPELAGO_BASE-0 rocky islet
ARCHIPELAGO_ISLAND-0_MEDIUM ARCHIPELAGO_BASE-0 island (mixed medium sizes)
ARCHIPELAGO_ISLAND-0_LARGE ARCHIPELAGO_BASE-0 large island (mixed sizes)
LUSH_POOLS_8X8 LUSH_BASE-52 pool
LUSH_HILL-52_8X8 LUSH_BASE-52 small hill
LUSH_HILL-52_16X16 LUSH_BASE-52 hill
LUSH_SWAMP-52 LUSH_BASE-52 swamp
LUSH_POND-52_16X16 LUSH_BASE-52 pond
LUSH_FEATURE-230 LUSH_BASE-230 feature on the peak plateau
LUSH_ISLAND-7_16X16 LUSH_BASE-7 island in the swamp water
DESERT_HUGE-HILL-55 DESERT_BASE-55 huge hill (mixed sizes up to 4 x 4 squares)
DESERT_HILL-55_16X16 DESERT_BASE-55 hill
DESERT_PLATEAUS-55 DESERT_BASE-55 small plateau
DESERT_ROUGHS-55_8X8 DESERT_BASE-55 rough patch
WATERWORLD_ARM-60_MEDIUM WATERWORLD_BASE-0 arm of land rising from the sea
WATERWORLD_ARM-60_LARGE WATERWORLD_BASE-0 large arm of land
WATERWORLD_BASE-1_MISC_16X16 WATERWORLD_BASE-1 sea-floor decoration
EVERGREEN_HILL EVERGREEN_BASE-60 hill
EVERGREEN_HILL_LARGE EVERGREEN_BASE-60 large hill
EVERGREEN_POOL EVERGREEN_BASE-60 pool
EVERGREEN_ISLAND EVERGREEN_BASE-0 island
EVERGREEN_ISLAND_LARGE EVERGREEN_BASE-0 large island
EVERGREEN2_HILL EVERGREEN2_BASE-60 hill
EVERGREEN2_HILL_LARGE EVERGREEN2_BASE-60 large hill
EVERGREEN2_POOL EVERGREEN2_BASE-60 pool

Some Tile Brush tools are not stamps and cannot be used from a script: Lush's Horizontal/Vertical Mtn, WaterWorld's Horizontal/Vertical Reef, Desert's Dunes, rivers, ridges, slopes and bridges.

How many stamps actually fit. Stamps need whole flat squares of their ground, plus spacing_to_other_terrain_types squares around them. Small lands fill up quickly. If you ask for more than fit, the generator places what it can and gives a message.


12. Objects: features, resources and start positions

TA features are defined by the game's and add-ons' TDF files, which Galaxy Editor loads (including TA_Features_2013.ccx). A create_object name can be one of four things, tried in this order:

12.1 START_POSITION (or TOWN_CENTER)

Places one commander start for each player.

create_object START_POSITION {
  set_place_for_every_player
  max_distance_to_players 0
}
  • max_distance_to_players 0: each start goes on its player land's origin, or the nearest spot with room.
  • Without player lands, or with other distance rules, starts are spread as far apart as possible. min_distance_group_placement N keeps them N apart. terrain_to_place_on, place_on_specific_land_id, min_distance_to_map_edge and avoid_cliff_zone also apply.
  • A start needs a 6 x 6 feature-cell patch of flat, dry, empty ground. Later objects keep 6 cells away from it.
  • Only the first START_POSITION command counts.
  • If a script makes player lands but has no START_POSITION, starts are put on the land origins automatically.

12.2 Doodad kinds (follow the ground)

These pick, at each spot, features that suit the ground under it. For example, TREES gives GreenWorld trees on GreenWorld grass, snow trees on Ice and palms on Archipelago sand.

Kind Picks
TREES trees (and palms)
PALMS palm trees
ROCKS rocks and boulders (Acid uses Lush rocks)
PLANTS plants
SHRUBS shrubs and bushes
FOLIAGE foliage
FRONDS fronds
VINES vines
ICECHUNKS ice chunks (Ice)
LAVA_NODES lava rocks (Lava)
LAVA_SPIRES lava spires (Lava)
METAL_TOWERS metal towers (Metal)
PIPES pipes (Metal)
CRYSTAL_SPIRES crystals (Crystal)
SPIRES any spires
METAL_NODES metal deposits: the resource players mine. Each ground gets its own deposits; grounds without their own use the all-worlds deposits.
GEO_VENTS geothermal vents: the energy resource.
  • Desert has no trees of its own, so Archipelago's trees and palms are its TREES and PALMS.
  • Trees may stand on gentle blends between two dry grounds, and on the dry side of coasts.
  • At most one tree stands on a map tile, and no two trees stand side by side.
  • Metal deposits and vents are removed if the ground under them is not perfectly level.

12.3 World-limited kinds: WORLD_KIND

Put a world name before a kind to use only that world's features, on any dry ground. For example, ARCHIPELAGO_PALMS puts palms on GreenWorld grass, and LUSH_TREES puts jungle trees on other grounds.

World words:

  • GREENWORLD, LAVA, MARS, ICE, METAL, DESERT, ARCHIPELAGO, LUSH, ACID, CRYSTAL
  • Any TDF world name in capitals, with spaces and dashes turned into _, such as EVERGREEN.

12.4 Exact feature names

Any feature's own TDF name, not case sensitive. Examples:

  • From the bundled scripts: AERATION01S, AERATION02S, Tower04Scar, Tower07Scar.
  • Typical Cavedog names: RockMetal1, Tree1.

The Features tab in Galaxy Editor lists every loaded name. Exact names are placed exactly as named, on any dry, flat ground, unless terrain_to_place_on says otherwise.

12.5 Underwater features

Features made for the sea floor are recognised by name (aqua, coral, kelp, seaweed, underwater, uw...). They are placed only on liquid ground, and only when terrain_to_place_on names that water. Everything else only goes on dry ground.

/* Underwater metal in the shallows. */
create_object METAL_NODES {
  number_of_objects 4
  terrain_to_place_on GREENWORLD_BASE-43
  set_scaling_to_player_number
}

12.6 Typical resource layout per player

create_object METAL_NODES {
  number_of_objects 4
  set_place_for_every_player
  min_distance_to_players 10
  max_distance_to_players 26
  temp_min_distance_group_placement 6
}
create_object GEO_VENTS {
  number_of_objects 1
  set_place_for_every_player
  min_distance_to_players 12
  max_distance_to_players 32
}

13. Messages the generator gives you

After Generate, the window lists messages with their line numbers. For example:

  • "X" is not a terrain. Terrain names look like GREENWORLD_BASE-60. A typo, or an old height. Check Section 9.
  • "X" is not a command the script reader knows. or "X" is not an attribute of create_land. A misspelling, or an AoE2-only name.
  • create_land belongs under <LAND_GENERATION>, so it was skipped. The command is in the wrong section.
  • create_terrain X found no room on this map. Its base_terrain is missing, or the spacing is too strict.
  • create_terrain X placed 2 of 6: there was no more room. Too many stamps for the flat ground available.
  • <CLIFF_GENERATION> drew 0 of 4 cliffs No open ground with a higher ground of its own (see the cliff table in 8.4).
  • There was no room for this land's origin Borders, avoidance or base sizes leave no space.
  • N cells had no piece in the tileset (...) Two grounds that cannot touch were painted side by side (Section 10).
  • X is skipped: it has no meaning for Total Annihilation ... Harmless.

14. Design advice and common mistakes

Think in squares. A 16 x 16 map has 17 x 17 nodes. A player island of 10 to 15 nodes is plenty, and a central continent of 30 to 60 nodes is big.

Islands: use a water base_terrain, create_player_lands with other_zone_avoidance_distance 1 or 2, and borders of 5 to 10 percent so the sea wraps the edge. Each player land is its own zone by default, so other_zone_avoidance_distance keeps them apart.

One continent: use set_zone_randomly, or give every land the same zone, or leave other_zone_avoidance_distance at 0, so the lands merge.

Land map without water: set base_terrain GREENWORLD_BASE-60, or another plain, and grow lands of other plains. Remember the blend rules in Section 10.2.

Plateaus: use create_terrain GREENWORLD_BASE-194 { base_terrain GREENWORLD_BASE-60 ... spacing_to_other_terrain_types 1 }. The cliff faces are added for you. On Ice, use ICE_BASE-145 on ICE_BASE-60, and so on.

Lakes: use create_terrain GREENWORLD_BASE-43 (shallows) or GREENWORLD_BASE-0 (deep water) with base_terrain GREENWORLD_BASE-60. A deep lake gets its coast automatically.

Shallows at sea: use create_terrain GREENWORLD_BASE-43 { base_terrain GREENWORLD_BASE-0 ... }.

Fords between islands: see the create_connect_all_players_land example in 8.6.

Forests: use TREES with groups, tight grouping, a radius and scaling. For example:

number_of_objects 40
number_of_groups 0.4
set_tight_grouping
group_placement_radius 12
set_scaling_to_map_size

This gives about 10 groves of 40 trees on a 16 x 16 map. Add min_distance_to_players 16 to keep the start areas clear.

Mistakes to avoid:

  • AoE2 terrain names such as GRASS, WATER, DESERT, FOREST, PALM_DESERT. Use Section 9 names. Forests are objects (TREES), not terrain.
  • AoE2 object names such as GOLD, STONE, FORAGE, DEER, TOWN_CENTER with resources, SCOUT, VILLAGER. Use METAL_NODES, GEO_VENTS, TREES, SHRUBS and START_POSITION.
  • AoE2-sized numbers: base_size 15, number_of_tiles 900, min_distance_to_players 40 (40 feature cells is only 1.25 squares, which is fine for objects, but land numbers must be tiny).
  • Heights from older documents: _BASE-85, _BASE-219, _BASE-27. Those are pre-2026 names. Use _BASE-60, _BASE-194 and _BASE-7.
  • Placing a plateau of one world on another world's ground. It gets no cliff pieces.
  • Forgetting spaces in comments or math, or putting spaces inside rnd( 1, 5 ).
  • Expecting if to compare numbers.

15. Complete example scripts

These are complete scripts in the format above. Paste one into the Random Map Generator and press Generate.

15.1 GreenWorld islands with fords (2 to 8 players, best on 12 x 12 or larger)

/* Green Isles: every player on a grass island, joined by shallow fords. */

<PLAYER_SETUP>
random_placement

<LAND_GENERATION>
base_terrain GREENWORLD_BASE-0

create_player_lands {
  terrain_type GREENWORLD_BASE-60
  land_percent 40
  if TINY_MAP
    base_size 0
  else
    base_size 1
  endif
  left_border 8
  right_border 8
  top_border 8
  bottom_border 8
  border_fuzziness 40
  clumping_factor 15
  other_zone_avoidance_distance 2
}

/* A neutral island in the middle with extra metal. */
create_land {
  terrain_type GREENWORLD_BASE-60
  land_position 50 50
  land_percent 4
  base_size 1
  other_zone_avoidance_distance 2
  zone 50
  land_id 7
}

<ELEVATION_GENERATION>
create_elevation 2 {
  base_terrain GREENWORLD_BASE-60
  number_of_clumps 2
  set_scale_by_groups
}

<TERRAIN_GENERATION>
/* Shallows scattered at sea. */
create_terrain GREENWORLD_BASE-43 {
  base_terrain GREENWORLD_BASE-0
  land_percent 6
  number_of_clumps 4
  spacing_to_other_terrain_types 1
}
/* Lava-coloured dirt patches inland. */
create_terrain QUAGMIRE_BASE-60 {
  base_terrain GREENWORLD_BASE-60
  land_percent 2
  number_of_clumps 3
  spacing_to_other_terrain_types 1
  set_avoid_player_start_areas 1
}
/* A few small ponds. */
create_terrain GREENWORLD_POOL_SMALL {
  number_of_clumps 2
  set_scale_by_size
}

<CONNECTION_GENERATION>
create_connect_all_players_land {
  replace_terrain GREENWORLD_BASE-0 GREENWORLD_BASE-43
  terrain_cost GREENWORLD_BASE-0 4
  terrain_cost GREENWORLD_BASE-43 1
  terrain_size GREENWORLD_BASE-0 0 0
}

<OBJECTS_GENERATION>
create_object START_POSITION {
  set_place_for_every_player
  max_distance_to_players 0
}
create_object METAL_NODES {
  number_of_objects 4
  set_place_for_every_player
  min_distance_to_players 10
  max_distance_to_players 28
  temp_min_distance_group_placement 6
}
create_object GEO_VENTS {
  number_of_objects 1
  set_place_for_every_player
  min_distance_to_players 12
  max_distance_to_players 32
}
create_object METAL_NODES {
  number_of_objects 6
  place_on_specific_land_id 7
  temp_min_distance_group_placement 5
}
create_object METAL_NODES {
  number_of_objects 3
  terrain_to_place_on GREENWORLD_BASE-43
  set_scaling_to_player_number
}
create_object TREES {
  number_of_objects 30
  number_of_groups 0.4
  group_placement_radius 10
  set_tight_grouping
  set_scaling_to_map_size
  terrain_to_place_on GREENWORLD_BASE-60
  min_distance_to_players 16
}
create_object ROCKS {
  number_of_objects 3
  number_of_groups 1
  set_scaling_to_map_size
  min_distance_to_players 12
}

15.2 Desert mesas, land map (2 to 4 players)

/* Mesa Flats: open desert with mesas, oases and two-level plateaus. */

<PLAYER_SETUP>
random_placement

<LAND_GENERATION>
base_terrain DESERT_BASE-55

create_player_lands {
  terrain_type DESERT_BASE-55
  land_percent 20
  base_size 1
  left_border 10
  right_border 10
  top_border 10
  bottom_border 10
}

<CLIFF_GENERATION>
min_number_of_cliffs 2
max_number_of_cliffs 4
min_length_of_cliff 2
max_length_of_cliff 4
cliff_curliness 30

<TERRAIN_GENERATION>
/* Two big mesas, round so they have an inside for the high mesas. */
create_terrain DESERT_BASE-130 {
  base_terrain DESERT_BASE-55
  land_percent 12
  number_of_clumps 2
  clumping_factor 30
  spacing_to_other_terrain_types 1
  set_avoid_player_start_areas
}
/* High mesas on top: they need mesa ground all round them. */
create_terrain DESERT_BASE-205 {
  base_terrain DESERT_BASE-130
  number_of_tiles 2
  number_of_clumps 2
  spacing_to_other_terrain_types 1
}
/* Oases. */
create_terrain DESERT_BASE-43 {
  base_terrain DESERT_BASE-55
  number_of_tiles 2
  number_of_clumps 2
  spacing_to_other_terrain_types 1
  set_avoid_player_start_areas 2
}
create_terrain DESERT_ROUGHS-55_8X8 {
  number_of_clumps 4
  set_scale_by_size
}
create_terrain DESERT_HUGE-HILL-55 {
  number_of_clumps 1
  spacing_to_other_terrain_types 1
}

<OBJECTS_GENERATION>
create_object START_POSITION {
  set_place_for_every_player
  max_distance_to_players 0
}
create_object METAL_NODES {
  number_of_objects 5
  set_place_for_every_player
  min_distance_to_players 10
  max_distance_to_players 30
  temp_min_distance_group_placement 6
}
create_object GEO_VENTS {
  number_of_objects 1
  set_place_for_every_player
  min_distance_to_players 14
  max_distance_to_players 34
}
create_object PALMS {
  number_of_objects 8
  number_of_groups 0.15
  group_placement_radius 5
  set_tight_grouping
  set_scaling_to_map_size
  min_distance_to_players 14
}
create_object ROCKS {
  number_of_objects 2
  number_of_groups 1
  set_scaling_to_map_size
  min_distance_to_players 10
}

15.3 Mixed worlds: a frozen north and a volcanic south

/* Fire and Ice: an Ice glacier in the north and a Lava field in the south,
   joined by GreenWorld grassland, in a GreenWorld sea. */

<PLAYER_SETUP>
random_placement

<LAND_GENERATION>
base_terrain GREENWORLD_BASE-0

create_land {
  terrain_type ICE_BASE-60
  land_position 50 18
  land_percent 18
  base_size 1
  top_border 6
  left_border 8
  right_border 8
  bottom_border 60
  border_fuzziness 25
}
create_land {
  terrain_type GREENWORLD_BASE-60
  land_position 50 50
  land_percent 20
  base_size 2
  top_border 30
  bottom_border 30
  left_border 8
  right_border 8
}
create_land {
  terrain_type LAVA_BASE-61
  land_position 50 82
  land_percent 18
  base_size 1
  top_border 60
  bottom_border 6
  left_border 8
  right_border 8
  border_fuzziness 25
}
create_player_lands {
  terrain_type GREENWORLD_BASE-60
  land_percent 12
  base_size 1
  left_border 12
  right_border 12
  top_border 12
  bottom_border 12
}

<TERRAIN_GENERATION>
create_terrain ICE_BASE-145 {
  base_terrain ICE_BASE-60
  land_percent 3
  number_of_clumps 2
  spacing_to_other_terrain_types 1
}
create_terrain LAVA_BASE-165 {
  base_terrain LAVA_BASE-61
  land_percent 2
  number_of_clumps 1
  spacing_to_other_terrain_types 1
}
create_terrain LAVA_POOL-61_16X16 {
  number_of_clumps 2
}
create_terrain GREENWORLD_HILL-60_16X16 {
  number_of_clumps 2
  set_avoid_player_start_areas
}

<OBJECTS_GENERATION>
create_object START_POSITION {
  set_place_for_every_player
  max_distance_to_players 0
}
create_object METAL_NODES {
  number_of_objects 4
  set_place_for_every_player
  min_distance_to_players 10
  max_distance_to_players 28
  temp_min_distance_group_placement 6
}
create_object GEO_VENTS {
  number_of_objects 1
  set_place_for_every_player
  min_distance_to_players 12
  max_distance_to_players 32
}
create_object GEO_VENTS {
  number_of_objects 4
  terrain_to_place_on LAVA_BASE-61
}
create_object TREES {
  number_of_objects 25
  number_of_groups 0.3
  group_placement_radius 8
  set_tight_grouping
  set_scaling_to_map_size
  min_distance_to_players 14
}
create_object ICECHUNKS {
  number_of_objects 6
  number_of_groups 0.2
  set_scaling_to_map_size
  terrain_to_place_on ICE_BASE-60
}
create_object LAVA_SPIRES {
  number_of_objects 4
  number_of_groups 0.2
  set_scaling_to_map_size
  terrain_to_place_on LAVA_BASE-61
}

16. Differences from Age of Empires II

AoE2 Galaxy Editor
Terrains such as GRASS, WATER, FOREST Tile Brush grounds such as GREENWORLD_BASE-60 (Section 9). There are no forest terrains; trees are objects.
Tiles of about 1 unit; maps of 120 to 480 tiles Script tiles are 16 x 16 map tiles; maps are 8 to 32+ squares across. Numbers must be about 10x smaller.
Player count, teams and map size set the conditions Conditions come from the Players box and the open map's size. There are no teams.
create_elevation raises the heightmap It places the ground's hill stamps.
cliff_type picks cliffs Each ground has its own cliffs; it raises the world's next ground up.
Objects are units, resources, animals Objects are TA features: doodad kinds, METAL_NODES, GEO_VENTS and START_POSITION.
Object distances in tiles In feature cells, 32 to a square.
assign_to by team or colour Player only.
Many attributes, such as height_limits, base_elevation, layer_to_place_on, resource_delta Accepted and skipped, with a message.

17. Quick reference card

<PLAYER_SETUP>
  random_placement | direct_placement | behavior_version N

<LAND_GENERATION>
  base_terrain T
  create_player_lands { ... }      create_land { ... }
    terrain_type T   land_percent N | number_of_tiles N   base_size R(0-2)
    land_position X Y   left_border/right_border/top_border/bottom_border N
    border_fuzziness N(20)   clumping_factor N(8)   generate_mode 1
    circle_radius R V   zone N | set_zone_randomly   other_zone_avoidance_distance N
    min_placement_distance N   assign_to_player N   land_id N   set_circular_base

<ELEVATION_GENERATION>
  create_elevation N { base_terrain T  number_of_clumps N  set_scale_by_groups
                       set_avoid_player_start_areas [N]  spacing_to_other_terrain_types N }

<CLIFF_GENERATION>
  min_number_of_cliffs N  max_number_of_cliffs N  min_length_of_cliff N
  max_length_of_cliff N  cliff_curliness N  min_distance_cliffs N  min_terrain_distance N

<TERRAIN_GENERATION>
  create_terrain T|STAMP { base_terrain T  land_percent N | number_of_tiles N
    number_of_clumps N  set_scale_by_size | set_scale_by_groups
    spacing_to_other_terrain_types N  spacing_to_specific_terrain T N
    set_avoid_player_start_areas [N]  clumping_factor N(20) }

<CONNECTION_GENERATION>
  accumulate_connections
  create_connect_all_players_land | create_connect_all_lands | create_connect_same_land_zones
  | create_connect_land_zones Z1 Z2 | create_connect_to_nonplayer_land {
    terrain_cost T N(0 = blocked)  replace_terrain FROM TO
    default_terrain_replacement TO  terrain_size T R V }

<OBJECTS_GENERATION>      (distances in feature cells: 32 per square)
  create_object START_POSITION | KIND | WORLD_KIND | FeatureName {
    number_of_objects N  number_of_groups N  group_variance N  group_placement_radius N
    set_tight_grouping | set_loose_grouping  set_scaling_to_map_size
    set_scaling_to_player_number  set_place_for_every_player
    min_distance_to_players N  max_distance_to_players N
    terrain_to_place_on T  place_on_specific_land_id N
    min_distance_group_placement N  temp_min_distance_group_placement N
    min_distance_to_map_edge N  avoid_cliff_zone [N] }

Kinds: TREES PALMS ROCKS PLANTS SHRUBS FOLIAGE FRONDS VINES ICECHUNKS LAVA_NODES
       LAVA_SPIRES METAL_TOWERS PIPES CRYSTAL_SPIRES SPIRES METAL_NODES GEO_VENTS

Preprocessor: /* ... */  #define N  #const N V  if N / elseif N / else / endif
              start_random / percent_chance P / end_random  rnd(a,b)  (A * B + C)