Tiled – General information

 


What is Tiled?


Tiled is an open source freeware map editor for placing objects (e.g. polygons, splines or images) in a two dimensional space. We use Tiled for placing our in-game objects on our maps of Railway Empire – and so you can, too.
The software can be downloaded here: http://www.mapeditor.org
If you want to learn more about Tiled in general, we would recommend to have a look at the documentation and forums found under the link mentioned above.


What are *.tmx files?


A *.tmx file basically contains information about cities and productions (plus some minor this that are not that important right now). It can be edited with Tiled, but if you have a closer look at the file within a text editor, you will notice that it is rather much the same as a *.xml file.


What can I find in those files and how does it work?


You will notice several Objectlayers within the Objects window of Tiled. Here is a quick guide on those:

  • indians
    This is for placement of Native Americans. The number of layers you will find here can vary and there is no required minimum for them (a maximum number has not been tested so far). The naming convention is “Indians[n]” while [n] is just consecutive numbering starting with 1. The representation is a square with 50*50 in size. (Sorry for using the term “indians” in this context, but it has been chosen for historical reasons and certainly does not reflect the opinions and values of us, the creators!)
  • critter
    This is for placement of herds of bison and golden eagles. The number of layers you will find here can vary and there is no required minimum for them (a maximum number has not been tested so far). The naming convention is “/assets/critter_bison0.asset” for creating a herd of bison and “/assets/critter_goldeneagle0.asset” for creating a golden eagle. In addition, it is important to define the type which can be found within the Objects window of Tiled. For bison it should be “land” and for an eagle it should be “bird”. The representation of the bison is a circle with 500 in diameter or 300 for the eagle.
  • city_[city_name]
    As you can probably imagine, those Objectlayers are representing the cities. The actual city name must be composed of small caps only without any special characters and an underline (the “_” sign; without quotation marks) instead of a space – just like the sub-headline of this paragraph.
    An important difference to all other Objectlayers is that each city needs a different point of origin
    (0, 0; top left corner of the grid that can be toggled on and off with CTRL+G within Tiled) that should be located exactly where you want the city’s centre to be. In the game, the city will grow and expand around that point.
    The Objectlayer contains the city’s streets which don’t need a name or type. If you would like to learn how to edit or how to create a city within Tiled, you should take a look at chapter Create/edit in-game assets. Furthermore, the Objectlayer itself has User defined properties which are the following:

foundedFounding year
nameidLocalisation ID
populationExact number of inhabitants when the game starts (results may vary, because the game will pre-simulate a certain amount of time depending on the setting within the gameplay.ini file)
production1This defines the first production in the city.
For a good balance it is recommended to have a corresponding rural production for supply of the raw material needed connected to the city. In addition, make sure that the
factory is available in the corresponding era.
production2/production3This defines the second and third production in the city.

Note: The User defined properties are not used by the game itself, but they can be a great help if you want to minimise mistakes while carrying the data over to Tome.

  • citylinks
    This Objectlayer contains layers representing the connections between two cities. Each of those layers contains a line (straight A to B line) which starts on one city’s centre and leads directly to another city’s centre. Those connections will enable the two cities to trade the commodities produced there. The naming convention of each layer is pretty similar to cities: [city_name]_[city_name] (The name must be composed of small caps only without any special characters and a “_” sign instead of each space (even between two city’s names or within one city name). Example for Los Angeles to San Diego would be named “los_angeles_san_diego”.
  • pro_[commodity]
    These Objectlayers are for creating rural productions. Here is the full list of possible types of productions with their corresponding commodities:
pro_grain
pro_corn
pro_cattle
pro_wood
pro_wool
pro_sugar
pro_milk
pro_vegetables
pro_fruits
pro_coal
pro_iron
pro_salt
pro_clay
pro_concrete
pro_oil

Note: It is not necessary, but recommendable to distribute even those productions which are not needed in your desired era, because it will enable you to switch the era later.

Each of those Objectlayers contains several things. For each production you want to create, you will need at least two things: the production and the fields/pits – connections are optional.
Here are some details (in this example I will use the commodity “grain”):

pro_[commodity][n][n] is just consecutive numbering starting with 1. Each production requires a type which must be named [Commodity]Factory (e.g. “GrainFactory” – note the case sensitivity). Furthermore, User defined properties will allow you to set the SiteStatus which could be:
Active (default)a regular production
Inactiveappears like a regular production, but does not produce anything; must have a connection to a city; becomes active once the connected city (required!) grows to >20,000 inhabitants
Passive(not working) unlocked by storyline
Unusedproduction will appear at all
[commodity][n]_ [field/pit][m]With [n] in correspondence to pro_grain[n] (for visual appearance it is recommended to keep those fields/pits close to the production). [m] is an indicator for the consecutive numbering starting with 1 for the corresponding pro_[commodity][n]. The reason why I mentioned “pits” before, is that the productions of coal, clay, concrete and iron need to be named (e.g.) coal[n]_pit[m] (as opposed to grain[n]_field[m] for example) as those products need to have pits instead of fields.
[commodity][n]_[city_name]Not necessary as not every production needs to be connected to a city, but if you chose to do so the naming convention is pretty much the same as explained for cities. With [n] correspondence to pro_[commodity][n]. This layer must contain a connection between a city’s centre and a production’s centre similar to those in "citylinks" ("Insert Polyline [L]" tool).

Templates for productions and fields/pits identical to those currently used in the game can be copied and pasted from here: production_templates.tmx (background image)
If you want to use those, you should make sure that you don’t forget to adjust the consecutive numbering.

  • turntable
    Contains a layer with a triangular object (pointing towards the camera) that represents the position of the turntable (the scene where you can buy trains). A template can be found here: other_templates.tmx (background image). It is possible to move it, but it is not recommended as the area around the initial position will be blocked and cannot be edited.

Furthermore, you will notice several Imagelayers within the Layers window of Tiled. Here is a quick guide on those:

helperContains an image which shows you several layers of information:

  • Contour of land and water (shown with thin white lines)

  • State borders and names (you might encounter slight differences comparing to the real world as certain things had to be adjusted to reflect a good scale for a game) and sometimes the flag(s) of adjacent countries.

  • Terrain features such as mountains or special geographical features (e.g. desert dunes, Badlands or the Grand Canyon)

  • Blocked areas (e.g. on large waters) are shown with red stripes

  • Height and type of terrain are shown with three colours:

pinkdifferent types of meadows/steppes
greendifferent types of woods
yellowdifferent types of deserts/beaches
With those colours in mind, differences in the colour shade can be noted and those are representing the different height (the brighter, the higher).
screenshotContains an image which shows you a screenshot of the terrain (without clouds and their shadows).

All of those Imagelayers have no impact on the game. However, they probably come in handy while creating or editing any of the existing maps. Within the Properties window of Tiled, you can adjust things like transparency in order to create a workflow suitable to you.


How to create a map in an at least somehow balanced state?


Well, besides from following the guidelines mentioned above, there are several things you should keep in mind. However, if you like to challenge yourself, you can feel free to intentionally edit some things in a slightly unbalanced way.

    • Number of cities/ number of productions
      In order to create a balanced map you should set them into relation, because you can roughly guess or even exactly calculate the outcome in a city’s growth by the dependency on the productions connected or close to it. More below…
    • Size of a city
      First of all, you should know that a city’s level will not change as long as there is no station in that city. After a station has been added to the city, it will enable it to grow or decline. This will depend on the variety and quantity of commodities arriving in that city. If you already have played the game, you will know that with an increasing number of inhabitants, a demand on a wider variety of commodities will be created. That in mind will allow you to carefully adjust a city’s initial productions, initial city links and initial connections to rural businesses.
  • Within the templates (other_templates.tmx [background image]) you will find some layers (mentioned below) that will help you to understand how to achieve a balanced state for a city. This is only for a visual aid. You will find 3 objects (note: they might be invisible by default) with different meanings for a balanced level design if placed on a city centre (definitions of “Group0 to Group2” in the Glossary):
    city_city_rangeThis is the range in which cities should be connected. A connection is only working when instructions under Create/edit in-game assets are followed. Radius: 2,5km (a level in Tiled has a size of 10000m²).
    G0-2-3_G1-2-3_G2-1Within this range there should be 2 or 3 commodities of “Group 0”, 2 or 3 commodities of “Group 1” and one of “Group 2” (note: if a city is connected directly to another city, only the produced goods will be exchanged as long there is a demand – but you can’t send them further to yet another city). Radius: 2km (a level in Tiled has a size of 10000m²).
    G0-rest_G1-rest_G2-1Within this range there should be all “Group 0” and “Group 1” commodities that are not distributed within G0-2-3_G1-2-3_G2-1 plus one commodity of “Group 2”. Radius: 4km (a level in Tiled has a size of 10000m²).