Map Editor

Andor's Trail uses Tiled as map editor.

The map editor produces files with extension “.tmx”, that are XML files containing one map each. These files are loaded directly into the game. That's part of what's happening when the loading screen is visible.

To edit the maps used in Andor's Trail, open the TMX files from “res/xml” in the source code distribution directly into Tiled. They should load the tilesets correctly if you have the paths the same way as in the Git repository.

Additionally, see the Map Guidelines for making new maps.

Also, see the Mapmaking Tutorial and the Advanced Mapmaking Tutorial for a guide with screenshots on how to make maps for Andor's Trail.

Layers

Tiled uses a concept of layers to place image tiles on top of other image tiles. The drawing process in Andor's Trail is roughly as follows:

  1. Draw the “Ground” layer.

  2. Draw the “Objects” layer.

  3. Draw the player and monsters.

  4. Draw the “Above” layer.

This way, you can for example choose to place a rock in the Object layer above a grass tile in the Ground layer. The Above layer is used for tiles which should lie over the player (e.g. treetops or shadows).

Please keep in mind that all objects placed on the map cause the rendering to be slowed down somewhat.

Maps in Andor's Trail also use another special layer called the “walkable” layer. Any tiles are filled (with any image) in this layer will be non-walkable. Currently, a transparent purple image is used as marker on this layer in the maps that are distributed.

Object Layers

TMX files from Tiled also has a concept of “object layers”. Object layers can be mostly anything you want them to be, it's up to the implementation to decide what to do with them. Each object in an object layer has a name, type, and properties. The properties are key/value pairs.

Remember to enable snap to grid in menu/view in Tiled to make the selection box have the exact size as the tiles!

Andor's Trail uses the following object layers types:

Spawn layer

Spawn object type

Spawn areas are used for indicating where there should be monsters.

Other properties that are possible to set on objects of this type are:

Mapevents

Mapchange object type

Mapchange areas are used for transitions to another map. The mapchange object actually serves two purposes:

  • Determines in what map the player should end up on when walking onto one of these tiles.

  • Gives a name on “this” map that other maps can refer to, when the player wants to return to “this” map.

If the following properties are set, the player will change map when stepping onto an object of this type:

Sign object type

Sign object areas are used for giving the player a popup dialog box with a custom message when he steps on the area.

Container object type

Container object areas are used for making the selected area “lootable”, hence giving the player a popup dialogue box containing dropped items.

Rest object type

Rest object areas are used for making the player “sleep” and recover all health points once he steps on the object area. Only the bottom tile of the bed contains such a “rest” area.

Script object type

A script object area basically triggers a dialogue hidden to the player that can be used for activating a trap, changing a map without displaying a quest in the quest log etc. The script areas only run when the player stands inside the script area's rectangular area.

The following properties set:

A dialogue phrase can either give a reward or lead to a reply (with requirements).

  • A reward can be a quest progress, a drop, a skill increase, an actor condition or an alignment/ faction change.

  • A reply can lead to another phrase, a trading screen, a combat,the conversation ends or a npc is removed from the map.

  • A requirement can be a quest progress, an item from the inventory will be removed, an item in the inventory, a worn item, a skill level or a killed monster.

Key layer

Key object type

Key object areas are used for restricting the player's movement unless the player meets a specific requirement. The player cannot move into a keyarea unless the player has fulfilled the things specified by the keyarea.

Requirements (keys, quest stages) are, for example, given by quests, and not really visible to the player.

If the player does not meet the required requirements, a conversation box will be shown to the player, starting at the phraseid specified by the “phrase” property.

Replace layer

Replace object type

The replace area is a property of the “Replace” layer which is used for changing the look of the map when reaching a certain queststage.

Up to now, the “Replace” layer can only change tile layers (Ground, Objects, Above and Walkable) but no object layers (Mapevents, Spawn, Key and Replace). To change any tile layer, you have to create one new layer for every single layer you want to replace with other tiles and give it a custom name. The new layer should be always on top of the layer you want to modify. You can raise or lower the layers by right clicking the layer window. Only redraw the tiles in the selection box and leave the rest of the layer blank. To delete several layers, you can create one new layer for all these layers and leave it blank.

The following properties can be set:

This small tutorial shows four examples of how to use the “Replace” layer:

1. Let's simply add a stone to the map. I have to duplicate the “Objects” layer because a stone is a semi-transparent tile. I called it “layer1”. Select the new layer and draw a stone. Now, I draw a rectangle over it with “Replace”. I edited the properties.

I added a new stone in “Objects” which I want to delete. I can reuse the layer1 because it's blank at that place and I used th same properties.

Now, I want to place an old chest and its shadow. I place the chest in layer1 and I added a new layer called layer2 because the shadow should be over the player and not under him.

The last small tutorial shows how to delete multiple things cleverly with only one layer. I drew a bush and made it unwalkable. Afterwards I used layer1 which is blank at this tile to delete both layers.

Tilesets

The current tileset that is used is a modified version of this and additional images. This large image is spit up into several smaller parts (to speed up the loading process), which you can find in the “res/drawable” directory of the source code.

Last updated