RMS Tutorials: Unequal Player Starts – Part 1

Article written by Zetnus
Published on 07-04-2016; updated on 02-19-2017
Tags:

Preface

This tutorial assumes that you are familiar with the basic concepts of RM scripting — ie. you understand what all the parts of a standard ES map script do, and you are able to write your own basic scripts. If this is not the case, I suggest you read my Updated New RMS Guide or otherwise familiarize yourself with the basics of RM scripting.

Introduction

To begin with, I will quote part of the original RMSG by Ensemble Studios:

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.

As you might have guessed from the title of this tutorial, it is in fact possible to start different players with different resources and on different starting terrains. We will get to it in a moment.

First however, I would like to draw your attention to the rest of what I have quoted:

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.

This applies especially if you are creating map with unequal starting positions; people playing your map are trusting you to have designed something that is balanced and fair, and that is fun to play. Furthermore, by giving you the information to create unequal player starts, I am trusting you to use it appropriately.

So why might you want to design a map with unequal player starts?

  1. To create an AI-friendly single-player version of map that AIs would otherwise have a lot of trouble with. For example, you could create a land nomad map where only player 1 has a nomad start and any other players (ie. computer players) start with a TC. This is the example I will be using in this tutorial.
  2. To create a map for human players where different players have different resources and must actively trade and cooperate with each other to obtain the resources that they lack in their starting position. Such a map requires you to carefully consider the balance so that it is fair and fun to play for all the players.
  3. To create a map that allows players of different skill levels to play on somewhat equal footing. Once again, this requires play-testing and careful consideration of balance.
  4. To create an RPG using RM scripting. Be creative! There are all kinds of things you could try.
  5. To cheat your friends or random players online. Don’t do it. Let me tell you why: games are normally recorded and people will be able to quickly determine that you are using a cheat map. Furthermore, the map script is transferred to every player at the beginning of the game. People will be able to look at it and determine that you made an unfair map. You will very quickly ruin your reputation and people won’t want to play with you anymore — is that really what you want?

Lands

If you use the create_player_lands command, each player will get equal starting positions. However, there is a way to get around this by using the create_land command with the assign_to_player (1-8) attribute. This attribute lets you assign a single land to a specific player. The number corresponds to the order in which the player slots are filled in the lobby, rather than the player color/number selected. Whoever is in the first slot will always be player 1 for the purpose of this attribute. Note that if some players are not playing, their lands won’t be created at all and that you can’t assign the same land to more than one player. So let’s see how this works:


<LAND_GENERATION>
base_terrain WATER
create_land
{
  terrain_type GRASS2
  land_percent 15
  assign_to_player 1
}
create_land
{
  terrain_type DESERT
  number_of_tiles 150
  assign_to_player 2
}
create_land
{
  terrain_type DIRT
  number_of_tiles 300
  assign_to_player 2
}
create_land
{
  terrain_type LEAVES
  number_of_tiles 300
  assign_to_player 4
}

<OBJECTS_GENERATION>
create_object CASTLE
{
  set_place_for_every_player
}

If you place this into a blank random map script and then start up a 3 player game you will note the following: Player 1 gets a Castle on a massive grassy island. Player 2 gets a Castle on a small desert island and another Castle on a small dirt island. We did not create any lands for player 3, so player 3 gets the standard TC, villagers, and scout placed at random somewhere on the map (probably on the grassy island because it’s nice and big). Player 4 is not playing, so there is no leafy island. We’ve already managed to establish some basic asymmetry between the player lands.

What else can we do?

The create_land command can have the following attributes:


terrain_type  TYPE
land_percent %  /  number_of_tiles N
base_size N
base_elevation N(1-7) (requires UP/HD) 
left_border %,  right_border %,  top_border %,  bottom_border %
land_position %(0-100) %(0-99) 
border_fuzziness %
clumping_factor %
zone N  /  set_zone_randomly 
other_zone_avoidance_distance N
land_id N
assign_to_player N(1-8)

However, if you use assign_to_player, then land_position will not work. Furthermore, the border attributes (top, left, right, bottom) will apply globally to ALL lands that belong to players. So you CANNOT create unequal positioning of the lands that belong to players — they will always be in a circle/oval and the border attributes will shift the entire oval.

This still leaves you with many options to create unequal starts in terms of land size, shape, zone, avoidance distance, and most importantly, terrain (the focus of this guide). Part 2 of this guide discusses using land_id instead.

Terrains

One of the best ways to give players unequal starting resources/buildings/units is to make sure the players have different terrains in their starting lands. In the above example, I used GRASS2 and DESERT to make the differences abundantly clear; however you can be much more subtle about it too. Let’s create an AI-friendly single-player version of land nomad to illustrate how to do this:


<LAND_GENERATION>
base_terrain GRASS
/* for the human player */
create_land
{
  terrain_type GRASS2
  land_percent 10
  base_size 15
  other_zone_avoidance_distance 5
  assign_to_player 1
}
/* for the computer players */
create_land
{
  terrain_type GRASS
  land_percent 10
  base_size 15
  other_zone_avoidance_distance 5
  assign_to_player 2
}  
create_land
{
  terrain_type GRASS
  land_percent 10
  base_size 15
  other_zone_avoidance_distance 5
  assign_to_player 3
}  
/* repeat for players 4-8 */

How is this going to let us create unequal starts if they look almost the same? That is where we need to move to the objects section.

Objects

While you could theoretically use differences in the sizes of lands to unequally place objects, the easiest way is to create and use differences in the terrains of the lands. You can use terrain_to_place_on to specifically place objects on to certain terrains. For example, If you specify that every player gets a TC, but the TC needs to be placed on GRASS, then any player who doesn’t have GRASS in their land won’t get a TC.

Let’s take our previous example of creating an AI-friendly land nomad and add an objects section after the land_generation from above.


<OBJECTS_GENERATION>
create_object TOWN_CENTER
{
  terrain_to_place_on GRASS
  set_place_for_every_player
  group_placement_radius     18
  min_distance_to_players    0
  max_distance_to_players    0
}
create_object VILLAGER
{
  set_place_for_every_player
  min_distance_to_players       6
  max_distance_to_players       21
}

What this will do is place a TC for players 2-7 because they have GRASS in the center of their lands. Player 1 will not get a TC, because player 1 has GRASS2 instead of GRASS. All players will get their villagers as usual.

Thus we have a basic script that shows how you can use unequal player starts to make an AI-friendly Single-player version of a map. Of course you would still need to add in all the other objects and terrains from the land nomad map in order to make it complete, but that is simply a matter of copy-and-paste for the most part.

Examples

Above, I’ve used a simple example to illustrate this concept, but once you’ve got a grasp of it you can make some quite impressive maps:

Frontier and Lake Nomad

For both of these maps I created AI-friendly single-player versions.

Specialists

In this map Bultro gives the players randomized unequal starting positions to provide for some unusual yet surprisingly balanced gameplay.

PTC15 – Tortuga

In this one, I’ve made extensive use of unequal player starts to create an entry for the Pretty Town Contest. It’s a showcase map rather than something you actually play a match on.

The Overlord

It will generate great 1vX games (with X from 2 to 5), where the Overlord (P1) is alone versus everyone else but he has as many TCs as opponents.

There are other things you can try too. For example, you can use can create 2 set of player lands — one using create_player_lands and one using create_land and assign_to_player. Player objects would not necessarily have to be placed on both of them, instead you could use the second set to scale the number of unoccupied lands in the map to the number of players. Be creative!

Concluding Thoughts

Since writing this, I have been told that land_id is also useful for creating unequal player starts. If you are interested in learning about this, you can read RMS Tutorials: Unequal Player Starts – part 2

This is my first University submission and I hope you learned something from it. Let me know if you have any questions or find any mistakes or need clarification about something.


Do you want to comment on this article? Thank the author? Tribute resources for its improvement? Raze it to the ground?

Come by and visit its thread in the University Forum!