Please read Ensemble Studio's documentation on RMS before
this tutorial, you'll find it helps a lot. You can find it
in the 'docs' folder on the disc (not in the install
directory) it's called RMSG.doc. There is over a page of
copyright info in the file which I really cannot be
bothered to read so I will not supply the file to you, just
in case (:
Bultro from Heaven Games has re-written ES doc and added a
lot more info. It's called 'new random map scripting
guide' and is well worth a read. With his permission I may
add to download with this tutorial.
When learning RMS for the Conquerors I discovered, to my
disappointment, that there are very few tutorials written
on the subject. So I have decided to write my own.
A Random map script (RMS) is a script with a set of rules.
When the script is run it is seeded with a pseudo-random
number, a map is then generated based upon those rules and
seed number. The rules are not set in stone, they are
flexible. There can be hundreds or thousands of variations
that fit the same rules, this is what makes the maps
appear to be random. Imagine if I said "draw two dots on a
piece of paper at least 8cm apart and then draw a straight
line between them with each end of the line touching a
different edge of the paper". How many different
combinations could you come up with following those rules?
A lot I'm sure! RMS work in much the same way, only they
have a lot more rules.
In these tutorials we will create a script for an islands
map upon which team members will share an island. There
will be a few small islands with gold or stone on them. I
assume you have read the RMSG documentation so I will not
ellaborate on what commands do or their syntax, but rather,
why I have used them in the places I did. I might change my
mind and add something later, we'll see (;
First things first fire up your text editor of choice
(Crimson Editor for me, Notepad++ is great too and even
microsoft's Notepad will work fine) and slap a comment
right at the top.
Yupp, we're going to create lands. Lands isn't the best/* Tutorial 1: all about lands */
term to use, areas would have been better seeing as lands
can also be water. Lands are NOT terrain, but they have a
terrain assigned otherwise you wouldn't be able to see them
in the game. Lands create different areas on the map that
you can refer to later on. Lands either belong to a player
or to no-one. Before we get into setting the lands up we
have to do what we're told and add
*PLAYER_SETUP*Random_placement is the only option available for the
random_placement
player setup. Perhaps ES intended at one point to specify
other options, but they never materialised. Now we can move
on to creating our lands.
To begin we'll create the player lands, where players Town
Centres will be placed, and 5 smaller lands for some
treasure islands. Each with it's own ID so we can add the
gold later. If you count you'll find that the total percent
for all of the lands doesn't equal 100% Any percent that we
left off will be placed as the base_terrain, water in our
case. Please read the comments for more info.
*LAND_GENERATION*There we have our lands set up nicely. For now the small
base_terrain WATER/* because we're going to make islands it's easy to start with water */
create_player_lands
{
terrain_type GRASS
land_percent 42/* enough for people's towns */
other_zone_avoidance_distance 15/* plenty of space between lands for treasure islands */
base_size 12/* may create a square-ish section on the island, trade off to ensure boats can't hit TC */
left_border 5/* remove border if you don't mind your islands touching the edges of the map */
right_border 7
top_border 5
bottom_border 7
border_fuzziness 10/* lower the number, the more jagedy the edge */
clumping_factor 12/* avoid weird thin snaky bits */
set_zone_by_team
}
create_land
{
terrain_type DIRT
land_percent 1/* still large enough for a mine or two */
other_zone_avoidance_distance 4/* keep it away from other zones */
border_fuzziness 10/* make it rough edged, more natural that way */
zone 2/* distinct zone so each keep their distance */
land_id 1/* we will refer to this later to add mines to them */
}
create_land
{
terrain_type DIRT
land_percent 1
other_zone_avoidance_distance 3
border_fuzziness 10
zone 3
land_id2
}
create_land
{
terrain_type DIRT
land_percent 1
other_zone_avoidance_distance 3
border_fuzziness 10
zone 4
land_id 3
}
create_land
{
terrain_type DIRT
land_percent 1
other_zone_avoidance_distance 3
border_fuzziness 10
zone 5
land_id 4
}
create_land
{
terrain_type DIRT
land_percent 1
other_zone_avoidance_distance 3
border_fuzziness 1
zone 6
land_id 4
}
islands are set to dirt so that we can easily distinguish
them from the player islands. The majority of the smaller
islands tend to bunch up in the centre of the map which is
nice, if you wanted them all to do this you could add
borders to them (a large percent, 20ish, will squeeze them
into the centre of the map). Setting random borders and
other random features is for another tutorial, I'm too
tired right now. Why do I always write tutorials late?
hmmmm . . .
Save what you have as a plain text file with a .rms
extension in your \Microsoft Games\Age of Empires II\Random
folder and open up a new game and use your script. You must
set map style to custom to use custom scripts and set
visibility to reveal all. For now the only way to view your
script is by creating a new game each time, there is a way
to get it into the scenario editor but again I'm too tired
to explain now. One last thing, ignore where Town Centres
are placed because we failed to specify where to put them
the game places them totally randomly. Feel free to play
with the attributes in the script to see what effects they
can have. In the next tutorial we will add terrain but for
now marvel at your islands and good night (:
[This message has been edited by the_Wrath (edited 04-09-2010 @ 09:43 AM).]