DOC

Rmsg

By Jennifer Edwards,2014-09-10 20:24
9 views 0
Rmsg

    Random Map Scripting Guide

    Age of Empires II: The Conquerors Expansion

    Important: Age of Empires II: The Conquerors Expansion allows you to create your own random map scripts. You may share these custom random map scripts for the purposes of gameplay, but you may not sell or make other commercial uses of the custom random map scripts. Microsoft Corporation reserves all other rights to the editors and files.

COPYRIGHT NOTICE

    This information contained in this publication/document (the “Information”) may be redistributed only as permitted by the text below and provided that such Information and this copyright notice remain intact. No part of the Information may in any form or by any electronic, mechanical, photocopied, recorded or any other means be reproduced, stored in a retrieval system, broadcast or transmitted without the prior written permission of the publisher of the Information, Ensemble Studios Corporation. Neither the Information nor any portion thereof may be stored in a computer or other electronic storage device except for personal and non-commercial use.

    Users of the Information must seek permission from Ensemble Studios Corporation for all uses that are not allowed by fair use and other provisions of the U. S. Copyright Act, as amended from time to time (the “Act”). This Information

    may not, under any circumstances, be resold or redistributed for compensation of any kind without the prior written permission of Ensemble Studios Corporation, 10440 N. Central Expressway, Suite 1600, Dallas, TX 75231.

    The Information may only be used as a source of data and may only be used for non-commercial purposes. Any copy of this Information or portion thereof must include this copyright notice.

    Any published data contained in the Information, including URL and other Internet Web Site references, is subject to change from time to time without notice.

    The Information does not carry a warranty of any kind, whether express or implied. Although every effort is made to provide the most accurate and up-to-date information possible, Ensemble Studios Corporation acknowledges that this Information could include certain errors, including typographical errors and technical inaccuracies. Additions and changes will be made to the Information on an on-going basis; thus the Information contained herein is subject to change without prior notice. Complying with the Act and all other applicable federal or state copyright laws is the sole responsibility of the user. The user hereby is deemed to assume all such copyright law compliance responsibility by his or her use of the Information.

    Ensemble Studios Corporation may have U.S. federal and/or state patents, patent applications, trademarks, service marks, trade names, copyrights or other intellectual property rights covering subject matter in the Information. Except as RMSG.doc 1

    expressly provided in any written license agreement from Ensemble Studios Corporation, the furnishing of the Information does not give the user any license to such patents, patent applications, trademarks, service marks, trade names, copyrights or other intellectual property rights, which are expressly retained by Ensemble Studios Corporation.

    RMSG.doc 2

    Table of Contents

    Introduction ................................................................................................................................. 3

    Syntax......................................................................................................................................... 3

    Map sizes ................................................................................................................................ 4

    Global instructions....................................................................................................................... 4

    Local instructions ........................................................................................................................ 5

    Generation Instructions ............................................................................................................ 5

    Script writing tips ....................................................................................................................... 15

    Resources ............................................................................................................................. 15

    Setting zones ......................................................................................................................... 15

    Testing player start areas....................................................................................................... 15

    Scattering objects .................................................................................................................. 15

    Making it all fit ....................................................................................................................... 16

    Standard resources ................................................................................................................ 16

    Object names ............................................................................................................................ 16

    Annotated Random Map Script .............................................................................................. 23

    Introduction

    Random Map scripts are text files that can be composed in any text editor. They must end with *.RMS and must be placed in the RANDOM directory. Random Map scripts are automatically transferred in multiplayer games to players who do not have them.

    Random Map scripts place the same starting terrain and resources for every player. It is not possible to start different players with different resources. Thus, all scripts in theory will be fair to all players. However, knowledge of a map script can still help a player when playing on that map. Perhaps the player knows that there is a lot of gold generated in the center of the map (as in Gold Rush). When you play on someone else’s Random Map script, you are placing some trust in that person that the map is going to be interesting and fair.

    Computer Players should be able to play on any Random Map script, but unless you compose a new .AI file for that map, the Computer Player may not play with optimal efficiency. For example, the Computer Player may not build boats even if the map has ample water.

    Making Random Maps that can consistently give each player the resources they need can be difficult and may involve a lot of trial and error. Don’t get frustrated. Internet fan sites are a great resource for hints, tricks and other support for making maps that work.

    A Random Map starts with Land first, then Elevation, then Terrain, and finally Cliffs and Connections. The order is important.

    Syntax

Random map scripts are case sensitive.

    Braces {} enclose commands under specific instruction. Opening and closing braces must be on their own line.

    /* Slashes and asterisks enclose comments that the scripting system ignores, such as remarks, sub-headings, etc. Use /* to open a comment and */ to close it. Be sure to leave a space between the * and other characters.

RMSG.doc 3

    Brackets <> enclose variables. These are not used in the random map scripts themselves, only in the context of this document. If an instruction says “”, just type “35” not “<35>”. Instructions that begin with “set” do not require a variable.

Map sizes

    Map label Tiles on a side Total tiles Scaling factor

    tiny_map 72x72 5,184 0.5

    small_map 96x96 9,216 0.9

    medium_map 120x120 14,400 1.4

    large_map 144x144 20,736 2.1

    huge_map 200x200 40,000 4.0

    gigantic_map 255x255 62,025 6.2

    Scaling factor can be used to place more objects on a larger map relative to a smaller map. A Gigantic Map is 12.4 times larger than a Tiny Map, even though one side of each map is only 3.4 times larger. Map labels can be used in if-then statements.

Example:

If medium_map

     create_object STONE

    {

     number_of_objects 7

     number_of_groups 2

     group_placement_radius 3

    }

    endif

    Global instructions

    Global instructions are used to control script flow, make the script change from run to run, and make script control easier.

     #define

Defines a variable that you can use later on.

Example:

Start_random

    percent_chance 33

    #define DESERT_MAP

    end_random

    This instruction gives a 33% chance of the map being a “DESERT_MAP”. You could then say if DESERT_MAP later on to put down sand instead of grass or palm trees instead of oaks.

     #number

RMSG.doc 4

    Constants are used to tie a name, such as an object or terrain, with its identifier in the database. Ensemble Studios has already pre-defined all necessary constants in the random_map.def file so they do not need to be changed.

     if

     elseif

     else

     endif

    Conditional statements are used when there is more than one option. For example: If the map is gigantic, then add extra resources. If the map is a desert map, then use sand instead of grass. “If” initiates the conditional statement and “endif” completes it. Use “else” to specify all other conditions, or “elseif” to specify a single other condition.

Example:

if ALPINE_MAP

    base_terrain WATER

    elseif DESERT_MAP

     base_terrain DESERT

    else

     base_terrain GRASS2

    endif

     start_random

     percent_chance

     end_random

    Random statements are used to specify an instruction running only part of the time. The random chance is specified as a percent (1-100). If the percents do not add up to 100, then the remaining percentage will apply towards a default setting. Everything between start_random and end_random is considered part of the same random instruction. Random statements can be nested inside each other.

Example:

start_random

     percent_chance 20

     #define DESERT_MAP

     percent_chance 20

     #define ALPINE_MAP

    end_random

    The map will be a desert 20% of the time, an alpine map 20% of the time, and a normal (probably grass) map the remaining 60% of the time. Alternatively, the instruction could have had the line to define grass map at 60%, but this is not necessary.

    Local instructions

    The following instructions are used to create a random map. Some instructions require a variable, which is generally a number #, a number of tiles #tiles, or a terrain constant constant>. Instructions that begin with “set” do not require a variable.

Generation Instructions

RMSG.doc 5

    Before any specific instructions can be given, you must indicate what part of the random map the instructions refer to. For example, tells the random map generator that the instructions that follow refer to terrain. A Random Map starts with Land first, then Elevation, then Terrain and finally Cliffs and Connections. The order is important. The seven generation instructions are explained below along with their specific instructions.

Places players

     Creates types of land, such as islands and player lands

     Creates terrain, such as forests and desert

     Creates objects, such as trees, gold mines and villagers Connects different land zones such as shallows between

    islands

     Creates elevation to place hills

     Creates cliffs

random_placement

    Places players randomly. This is the only valid entry under . All maps must have this line in them.

    Land is used to create something aside from the default terrain type, most typically islands of grass in water. There are two types of land, normal lands (just called Lands) and Player Lands. In most random maps, Player Lands include a Town Center, Scout Cavalry, villagers, and the starting resources placed near the Town Center. Player Lands is also useful for telling terrain, such as forests, to avoid the player start areas. Land is all generated at the same time, so the order used in placing land is not important. (Terrain and objects, however, are placed in order.)

base_terrain

    Specifies what default terrain to start with. An island map probably uses water, while a grassland map uses grass.

Example:

base_terrain WATER

create_player_lands {instructions}

    Starts creating Player Lands. The percentage of land allotted to player lands is divided among all the players. Therefore, if player lands were specified to take up 20% of the map, then 2 players would each get 10%, but 4 players would each get 5%. It is important that player lands be large enough to contain a player’s town. If player lands on an island map are too small, then the Town Center might be susceptible to fire from boats. On a hill country map, hills might be placed too close to the Town Center. Player lands are always set at a constant elevation of 2.

Example:

create_player_lands

    {

     terrain_type grass

     base_size 10

     land_percent 20

    RMSG.doc 6

}

Creates an area for each player that is 10 tiles of grass in size.

create_land {instructions}

    Creates an area of land that is not for players. What type of lands are there to make? In an island map, you might want to lay down bonus islands that contain gold. You might want to create a mountain range in the middle of a map.

terrain_type

    Specifies what type of terrain to make the land. For Player Lands, this must be grass or desert to avoid goofy results.

land_percent

    Defines what percent of the map is taken up by the land area. For Player Lands, this area will be divided by the number of players, so if the number is set to 60% and there are 6 players, each will start with about 10% of the map. Best results seem to occur when using 60-80%.

number_of_tiles <# tiles>

    An alternate way of specifying land area size, in this case by number of tiles. Unlike Land_percent, these areas will not scale with map size. It is necessary to use only Land_percent or Number_of_tiles.

base_size <# tiles>

    Specifies a minimum radius that the land grows from. This instruction is useful for insuring that each player has an area large enough to build a town and keep at least some buildings free from naval bombardment. If Base_size is not specified, Player Lands may be thin and snaky.

left_border

    right_border

    top_border

    bottom_border

    Percent from edge to stop land growth. This instruction recognizes the distance to the map border, so it is useful for placing terrain near the middle of the map. For example, defining a border of 25 will place land near the center of the map, while a border of 5 will place land almost to the edge of the map. In Mediterranean and Baltic maps, this instruction places the inland sea near the center of the map. In Continental maps, this instruction insures there is a border of water. “Top” is random on the maps, so just specifying Top and Bottom but not Left or Right can create a narrow strip of terrain. Note that the map land had a hard-coded feature to round off edges to make land look more natural. As maps get smaller (border > 20%) they may look less like rectangles and more like circles or octagons.

border_fuzziness

    The percent chance per tile of stopping at a border. If this instruction is not used, borders will be straight lines. Specifying a low number, 5-20, will make edges ragged and more like real geography.

zone <# zone>

    RMSG.doc 7

    This is a descriptive command, used to assign a label to a certain land area. Zones with the same zone id can overlap, while land areas with different id’s are distinct. If no zone is specified, each player will be on their own island (though it will only look like an island if the base terrain is water).

land_id <# id>

    Assigns a label to a certain land area that can be used to assign objects only to that land.

set_zone_by_team

    Will keep all players on a certain team in the same zone. For example, on an island map this will allow a team to share an island. To keep everyone on their own island, do not include this command.

set_zone_randomly

    Will randomly determine zones, so that some players may be on the same island, while others may not be.

other_zone_avoidance_distance <# tiles>

    This instruction is the one that specifies how large a land should be, so if it is not included, the land will not appear. Zone avoidance is used to specify the width of rivers between player lands.

assign_to_player <# player>

    Assigns a land area to a certain player. Note, this does not work with player lands.

clumping_factor <# factor>

    Clumping affects how much land tends to form squares instead of rectangles. The default value is 8, and the range is 1 to 15. Lower numbers tend to produce snaky islands while higher numbers tend to produce squares. Note that clumping_factor for land and for terrain have different ranges and defaults.

    Terrain is different from Land. Land is used to create something aside from the default terrain type, most typically islands of grass in water. Terrain includes features on that land, such as desert and forests. An important distinction is that land is placed down before elevation, but terrain is placed down after elevation. The order terrain is placed is also important. If you place palm desert on desert terrain before you place any desert terrain on the map, then you aren’t going to see any palm trees. Remember, land is placed all at once. Terrain and objects are placed in order.

create_terrain {instructions}

Creates a clump of terrain

Example:

create_terrain PALM_DESERT

    {

    RMSG.doc 8

     base_terrain DESERT

     spacing_to_other_terrain_types 3

     land_percent 1

     number_of_clumps 3

     set_avoid_player_start_areas

     }

    Creates 3 clumps of Palm Desert on Desert terrain. These clumps will take up a total of 1% of all tiles and will be placed away from Player Start Areas.

base_terrain

    Specifies what terrain type the new terrain will be placed on. For example, palm desert could be placed on desert, or grass3 could be placed on grass1.

land_percent <#percent of map to cover>

    The percent of total land that this terrain will cover. It is best to use small percentages (1-10) for terrain if many different types of terrain are going to be laid down.

number_of_tiles <#size of terrain clump in tiles>

    The size of terrain can be placed in terms of tiles instead of as a percent. Percent is generally more useful as it will automatically scale with map size.

number_of_clumps <#number of clumps to place>

    The percent or number of tiles of terrain are evenly distributed into clumps. If number of clumps=3 and number of tile=18, the terrain will be appear as 3 clumps of 6 tiles each.

spacing_to_other_terrain_types <#distance from other terrain types>

    Specifies how far terrain should be from other terrain (including terrain of the same type). This command is useful for preventing trees from becoming connected walls, or keeping forests away from water. It is a good idea to specify some distance for terrain that blocks movement, but is not necessary for terrain such as desert and grass.

set_scale_by_groups

    Scales number of terrain clumps with map size (base 100x100 map). So, if 2 clumps are specified, then a large map would have 2 (2 x 1.4) clumps, but a Gigantic map would have 13 (2 x 6.5) clumps.

set_scale_by_size

    Scales size of terrain patch with map size. So, if 10 tiles are specified, then a large map would have 140 (10 x 1.4) tiles, but a Gigantic map would have 650 (10 x 6.5) tiles.

set_avoid_player_start_areas

    Most terrain, like forests and water, will avoid player start areas by default, but this instruction can be used, for example, if you want desert to avoid Town Centers.

clumping_factor <#factor>

RMSG.doc 9

    Clumping affects how much land tends to form squares instead of rectangles. The default value is 20. Lower numbers tend to produce snaky patches while higher numbers tend to produce squares. Note that clumping_factor for land and for terrain have different ranges and defaults.

height_limits <#minimum tile height> <#maximum tile height>

    Specifies on what elevation terrain can be placed (from 0-8). This instruction can be used to place grass on hill tops or place water only in depressions.

set_flat_terrain_only

Instructs terrain to avoid hills. Useful for making sure ponds don’t cross more than one elevation.

    Once land, elevation and terrain are placed, you are ready to place objects. Note that some objects may already be placed by terrain. Forests, for example, will be filled with tree objects. However, you will need to specify starting units, resources and other objects needed to make a map have more character and detail. Remember, land is placed all at once. Terrain and objects are placed in order.

create_object {instructions}

Places an object.

Example:

create_object GOLD

    {

     number_of_groups 2

     number_of_objects 3

     group_placement_radius 2

     set_tight_grouping

     set_gaia_object_only

     min_distance_to_players 40

     min_distance_group_placement 9

    }

    Gives every player 2 piles of gold with 3 gold objects in each pile. The pile is confined to a radius of 2 tiles and is placed from 9 to 40 tiles from the center of a player’s lands.

min_distance_to_players <#number of tiles>

    max_distance_to_players <#number of tiles>

    Specifies the limits where the object can be placed relative to the center of a piece of land. The object will appear at random anywhere between the minimum and maximum. For example, a Town Center placed at minimum 0 and maximum 0 will appear in the center of each player’s lands. A gold mine placed at 10 to 12 will appear about one screen away from the Town Center, but not too far away. The defaults for these instructions are 0 and infinity, respectively, so if no distance is specified, the object will appear somewhere on that land. Be careful not to specify a minimum that is greater than the land radius, or the object may not appear or may appear in the wrong location. Remember that when used with place_on_specific_land_id instead of set_place_for_every_player that the distances refer to the center of that piece of land and not to the players.

set_scaling_to_map_size

    RMSG.doc 10

Report this document

For any questions or suggestions please email
cust-service@docsford.com