HowToUseTiledToCreateStendhalMaps: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
imported>AntumDeluge
Parallax Background Support: how to specify multiple tilesets to ignore
 
(173 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Navigation for Stendhal Top|Contributing}}
{{Navigation for Stendhal Contributors}}

= How to Use Tiled =
= How to Use Tiled =
Tiled is a tile editor that supports layers and different tilesets.
Tiled is a tile editor that supports layers and different tilesets. You can download the latest version at http://www.mapeditor.org/.


If you don't have the map files from Stendhal already, please follow these instructions to setup a development environment with the latest source code and map files: [[Stendhal on Eclipse]]
= How to create a Map =
'''Always update your system so that you are in sync with CVS files'''


= How to create a new map =
To start Tiled double click on the <b>tiled.jar</b> file or use the following command line:
java -jar tiled.jar


{{TODO|update these screenshots to the most recent version of Tiled}}
http://arianne.sourceforge.net/wiki_images/tiled_0.jpg <br><small>Figure 1: The Tiled map editor</small><br>

Before you create a new map, I suggest, that you open some existing maps and look around how they are built. And there are many places in Stendhal already, that could use some improvements or additions.


[[Image:Tiled1.png]] <br><small>Figure 1: The Tiled map editor</small><br>


First you need to load the <b>template.tmx</b> map file and resize the map to the desired size.<br>
First you need to load the <b>template.tmx</b> map file and resize the map to the desired size.<br>
Click on <i>File</i> and now choose <i>Open</i>, find <b>template.tmx</b> and click <i>Open</i>
Click on <i>File</i> and now choose <i>Open</i>, find where you extracted the stendhal_mapeditor-2.00.zip find <b>template.tmx</b> and click <i>Open</i>


http://arianne.sourceforge.net/wiki_images/tiled_1.jpg <br><small>Figure 2: How to open the template map</small><br>
[[Image:Tiled2.png]] <br><small>Figure 2: How to open the template map</small><br>


We are going to work on a 64x64 (64 tiles by 64 tiles) map. First make sure all layers are visible, before you resize. Do this using the 'Show' tick boxes in the dialog at the side panel. Then click on <i>Map</i> and choose <i>Resize</i>.
We are going to work on a 64x64 (64 tiles by 64 tiles) map. '''First make sure all layers are visible, before you resize.''' Do this using the 'Show' tick boxes in the dialog at the side panel.

[[Image:Tiled3a.png]] <small>Figure 3: Layers view</small><br>

Then click on <i>Map</i> and choose <i>Resize</i>.
Note, a 64x64 map is not big (it will take a player around 40 seconds to move from one end to the other) but it is big enough for our example.
Note, a 64x64 map is not big (it will take a player around 40 seconds to move from one end to the other) but it is big enough for our example.


http://arianne.sourceforge.net/wiki_images/tiled_6.jpg <br><small>Figure 3: Map Menu</small><br>
[[Image:Tiled3.png]] <br><small>Figure 4: The Map Menu</small><br>


As you see in the resize dialog you can resize the map and even position the current map at any point in the new map size. Hence you can always resize your map later.
As you see in the resize dialog you can resize the map and even position the current map at any point in the new map size. Hence you can always resize your map later. '''Make sure all layers are visible before you resize any map.'''


http://arianne.sourceforge.net/wiki_images/tiled_7.jpg <br><small>Figure 4: The resize dialog</small><br>
[[Image:Tiled3b.png]] <br><small>Figure 4: The resize dialog</small><br>


Don't change the layer names from:
Don't change the layer names from:
* protection
* collision
* collision
* objects
* objects
* 4_roof_add
* 3_roof
* 3_roof
* 2_object
* 2_object
Line 32: Line 44:
* 0_floor
* 0_floor


etc etc seen on the template file. ''(the pictures here show renamed layers, but we shouldn't do this!)''
etc etc seen on the template file.


Now save this map as <b>small_village.tmx</b> by clicking on <i>File</i> and choosing <i>Save as...</i>.<br>Note: You need to type the complete name with the extension <b>.tmx</b>.
Now save this map as <b>Level 0/semos/small_village.tmx</b> by clicking on <i>File</i> and choosing <i>Save as...</i>.<br>Note: You need to type the complete name with the extension <b>.tmx</b>.


http://arianne.sourceforge.net/wiki_images/tiled_5.jpg <br><small>Figure 6: Save As...</small><br>
[[Image:Tiled5.png]] <br><small>Figure 6: Save As...</small><br>


==Tilesets==
==Tilesets==


The map <b>template.tmx</b> doesn't come with any tilesets preloaded. To load a tileset, click on <i>Tilesets</i> and choose <i>New Tileset ...</i>. Now tick the box next to <i>Reference tileset image ...</i> and Click on the <i>Browse</i> button. This lets you choose your tileset image. They are all located in the tiled/tileset/ folder. Any image not in tiled/tileset/ shouldn't be used. If you want to you can fill in a <i>Tileset name</i> to help you find it later, or just leave it Untitled. You can leave everything else as it is. Then click 'Ok' and your tileset is ready to use!
The map <b>template.tmx</b> doesn't come with any tilesets preloaded. To load a tileset, click on <i>Tilesets</i> and choose <i>New Tileset ...</i>. Now tick the box next to <i>Reference tileset image ...</i> and Click on the <i>Browse</i> button. This lets you choose your tileset image. They are all located in the tiled/tileset/ folder.


[[Image:Tiled6.png]]
Click on the square in the bottom left corner of the Tiled application to bring up the palette chooser. There's more on this later, so read on ...


Finding what you want should be easy as the tilesets are split into folders depending on what they are used for:
<b>Note</b> Loading tilesets is time consuming. So, if you're making a map which is going to have very similar tiles to another which is already made, you could open that map instead of <b>template.tmx</b>. And then Save As ... and name it with the new name and location. You can delete the stuff on each layer so you still start with an empty map if you like, but at least you have a lot of tilesets already loaded.

*building
:*window
:*column
:*decoration
:*door
:*entrance
:*fence
:*roof
:*stairs
:*wall
:*window
*ground
:*fire
:*ice
:*indoor
:*ladder
:*ridge
:*rock
:*water
*item
:*armor
:*banner
:*candle
:*chemistry
:*chest
:*corpse
:*drink
:*food
:*furniture
::*bathroom bed carpet chair clock crockery curtain light other picture shelve sink statue table
:*gothic
:*pot
:*statue
:*textile
:*weapon
*logic
:*creature
:*item
*object ''(for larger items that don't belong anywhere else)''
*plant
:*bush
:*flower
:*indoor
:*stump
:*tree
*sky
:*cloud

We are going to need grass, so we go to ''tileset/ground'' and select ground.png

[[Image:Tiled7.png]]

Any image not in ''tileset/'' shouldn't be used. If you want to you can fill in a <i>Tileset name</i> to help you find it later. You can leave everything else as it is. Then click 'Ok' and your tileset is ready to use!

[[Image:Tiled8.png]]

Click on the square in the bottom left corner of the Tiled application to bring up the palette chooser. There's more on this later, so read on ...


==Layers==
==Layers==
As you have already seen there are at least five layers in the map. <b>They must all exist. However, they can be empty.</b>
The map layers must not be renamed and must all exist, apart from ''4_roof_add'' which is optional. However, any of the layers can be empty.


The five first layers are the ones that host the game graphics:
These five layers are the ones that host the game graphics:
* 0_floor
* 0_floor
* 0_floor_parallax ''(optional alternate floor layer for clients that support parallax backgrounds)''
* 1_terrain
* 1_terrain
* 2_objects
* 2_objects
* 3_roof
* 3_roof
* 4_roof_add
* 4_roof_add ''(optional layer)''


the layers
The ''logic'' layers
*objects
*objects
*collision
*collision
Line 80: Line 151:
Our village is going to be a rich one, so let's look for a nice ground tile for it.<br>
Our village is going to be a rich one, so let's look for a nice ground tile for it.<br>


Click on <i>Fill</i> and fill the floor with your chosen tile. <br>You will notice it looks too tiled (i.e. not good), so let's add a few details like borders and a checkered board in the main square.<br>
Click on <i>Fill</i> and fill the floor with your chosen tile.
Notice that everything on the ground is still done on layer 0.


http://arianne.sourceforge.net/wiki_images/tiled_13.jpg <br><small>Figure 7: The ground on the floor layer</small><br>
[[Image:Tiled9.png]] <br><small>Figure 7: The ground on the floor layer</small><br>


Ok, but the map still looks too simple.
Ok, but the map still looks too simple.

So now let's add some details to the terrain layer (walls and so on).
So now let's add some details to the terrain layer (flowers, and bushes). We need to load those tiles, so repeat the steps to load ground tiles, but look for ''tileset/plant/bush/bushes.png'' and ''tileset/plant/flower/daisy_white.png''.
Make sure you choose <i>1_terrain</i> layer. <br>Then in the <b>bottom left hand corner</b> you will see a small square with a tile in it. Click this and a <b>tile selecter dialog</b> will open. On the right you will see the available Tilesets for Stendhal and on the left all the tiles. Tip: if you drag the pallet out and make it bigger you can eventually get all the like tiles to align (so for example the tiles that make up a tree will all be together) and it will make your life a lot easier!<br>
Make sure you choose <i>1_terrain</i> layer. <br>Then in the <b>bottom left hand corner</b> you will see a small square with a tile in it. Click this and a <b>tile selecter dialog</b> will open. On the right you will see the available Tilesets for Stendhal and on the left all the tiles. Tip: if you drag the pallet out and make it bigger you can eventually get all the like tiles to align (so for example the tiles that make up a tree will all be together) and it will make your life a lot easier!<br>
Dot some bushes and flowers around
We are going to make a small cemetery.

http://arianne.sourceforge.net/wiki_images/tiled_14.jpg <br><small>Figure 8: Adding some walls</small><br>

http://arianne.sourceforge.net/wiki_images/tiled_15.jpg <br><small>Figure 9: The completed walls</small><br>

Now we change to the floor layer to add grass and flowers.

http://arianne.sourceforge.net/wiki_images/tiled_16.jpg <br><small>Figure 10: Adding grass to the floor layer</small><br>


http://arianne.sourceforge.net/wiki_images/tiled_17.jpg <br><small>Figure 11: Adding flowers</small><br>
[[Image:Tiled10.png]] <br><small>Figure 8: Adding some plants</small><br>


We need a path, so we add ''tileset/ground/green_paving_3.png'' to our palette, and draw one on the ''1_terrain'' later.
We change to the <i>2_object</i> layer now (or terrain is ok too) to add tombs to the graveyard.
We change to the <i>2_object</i> layer now (or terrain is ok too) to add tombs to the graveyard.


http://arianne.sourceforge.net/wiki_images/tiled_18.jpg <br><small>Figure 12: Adding tomb objects</small><br>
[[Image:Tiled11.png]] <br><small>Figure 9: adding a path</small><br>


Now let's add a house and a tree to our cemetery. As you can see adding elements isn't hard, you simply must flip between layers.
Now let's add houses and a tree to our village. As you can see adding elements isn't hard, you simply must flip between layers.


And now for the tree. Trees are a bit more complex than houses because they are split over two layers: 1 and 2. <br>Make sure that the <b>upper part</b> of the tree is <b>always</b> on either <b>3_roof or 4_roof_add</b>. This will mean it is drawn over player when they stand 'behind' it.
http://arianne.sourceforge.net/wiki_images/tiled_21.jpg <br><small>Figure 13: Starting to add the house</small><br>


First we add ''tileset/plant/tree/spruce.png'', and then draw the lower part of it to the ''1_terrain'' layer.
http://arianne.sourceforge.net/wiki_images/tiled_22.jpg <br><small>Figure 14: The house is surrounded by brown due to faulty tileset</small><br>
[[Image:Tiled12.png]] <br><small>Figure 10: The foot of the tree on the terrain layer</small><br>


Now switch to the roof layer. The roof layer is for objects that are drawn on top of players and creatures in the game.
As you can see there is a border around the house. The tileset is faulty, so we need to do something to patch this fault and make it look better.


Draw the upper part of the tree on roof layer.
http://arianne.sourceforge.net/wiki_images/tiled_23.jpg <br><small>Figure 15: Covering up the fault</small><br>


[[Image:Tiled13.png]] <br><small>Figure 11: The upper part of the tree on the roof layer</small><br>
To correct the problem we add some dirt (sand) around the building to make it look like this is part of the design.


Let's practice this. Let's add another tree.
http://arianne.sourceforge.net/wiki_images/tiled_24.jpg <br><small>Figure 16: More details to break up the large areas of the same tile</small><br>


[[Image:Tiled14.png]] <br><small>Figure 12: The bottom of our second tree</small><br>
And now for the tree. Trees are a bit more complex than houses because they are split over two layers: 1 and 2. <br>Make sure that the <b>upper part</b> of the tree is on <b>layer 2 always</b>. This will mean it is drawn over player when they stand 'behind' it.


Remember how to deal with two layers? Make sure the top of the tree is on the roof layer.
http://arianne.sourceforge.net/wiki_images/tiled_25.jpg <br><small>Figure 17: The foot of the tree on the floor layer</small><br>


[[Image:Tiled15.png]] <br><small>Figure 13: The Top of our second tree</small><br>
We add the bottom of the tree, tile by tile.<br> Now switch to the roof layer.


A village would not be much of a village without houses. Let's draw one. Start with the wall.
http://arianne.sourceforge.net/wiki_images/tiled_26.jpg <br><small>Figure 18: The roof layer is for objects on top of everything</small><br>


[[Image:Tiled16.png]] <br><small>Figure 14: The start of a house - a wall</small><br>
Now we add the upper part of the tree on layer roof


The wall was drawn on terrain this time, so we can add some decorations to 2_object to make it a bit more interesting.
http://arianne.sourceforge.net/wiki_images/tiled_27.jpg <br><small>Figure 19: The upper part of the tree on the roof layer</small><br>


[[Image:Tiled17.png]] <br><small>Figure 15: Wall decorations added</small><br>
Let's practice this. Let's add another tree.


The roof can be drawn on 3_roof, so that a player walking behind the house will be covered by it.
http://arianne.sourceforge.net/wiki_images/tiled_28.jpg <br><small>Figure 20: The bottom of our second tree</small><br>
For our map we also add the top of the door there, as the window borders already used the space in 2_object.


[[Image:Tiled18.png]] <br><small>Figure 16: House with a roof</small><br>
Remember how to deal with two layers? Make sure the top of the tree is on the roof layer.
Let's also add a path to the house and create a door on the wall.


The front of the blue roof does not have a border like the rest of it. Also we have another problem:
http://arianne.sourceforge.net/wiki_images/tiled_31.jpg <br><small>Figure 21: The completed graveyard</small><br>
the longhorn skull got partially covered by the door top. Fortunately there is one more map layer remaining.
So we draw the missing border to 4_roof_add, and move the skull there too.


[[Image:Tiled19.png]] <br><small>Figure 17: Finished house</small><br>
Still there? Good, now let's add lots of details to make a good map!
Still there? Good, now let's add lots of details to make a good map!


http://arianne.sourceforge.net/wiki_images/tiled_34.jpg <br><small>Figure 22: The whole of our village with some extra details</small><br>
[[Image:Tiled20.png]] <br><small>Figure 18: The map with more details</small><br>


Complete the map yourself :)
Complete the map yourself :)
Line 148: Line 217:
* Objects (Entities, active game objects, this includes portals, signs, NPCs etc)
* Objects (Entities, active game objects, this includes portals, signs, NPCs etc)
* Collision
* Collision
* Protection (to define non pvp areas)


The collision layer determines what is passable and what is not.<br>
The collision layer determines what is passable and what is not.<br>
Use the tile pallet and in the collision Tileset choose the red square. To define what cannot be travelled over draw a red square in the Collision layer on each non passable tile.
You need to add the new tileset ''tileset/logic/collision.png'' and in then choose the red square. To define what cannot be travelled over draw a red square in the Collision layer on each non passable tile. It is helpful to drag the opacity of this collision layer to about 30%.


http://arianne.sourceforge.net/wiki_images/tiled_36.jpg <br><small>Figure 23: Collision Tile selected and we have marked on of the walls</small><br>
[[Image:Tiled21.png]] <br><small>Figure 19: Collision Tile selected and we have marked the house</small><br>


[[Image:Tiled22.png]] <br><small>Figure 20: The completed collision map</small><br>
Once you have completed this we have to add objects that are real entities in the Stendhal server. Things like NPCs, Portals, Creatures, zone change points, and so on ... Notice what layer we are working on. The active objects can be found in the Objects Tileset in the tile pallet. If you want to add monsters, add them from the Objects Tileset NOT the monsters one. The monsters one is not used yet.


Once you have completed this we have to add objects that are real entities in the Stendhal server. Things like NPCs, some portals, creatures and so on ... Notice what layer we are working on. To add monsters, select them from ''tileset/logic/creature/'' in the ''objects'' layer.
http://arianne.sourceforge.net/wiki_images/tiled_37.jpg <br><small>Figure 24: The completed collision map</small><br>


Let's add a portal to our tomb and a few zone entries. And of course, a waiter for our Bar.
We'll add some sheep, sheep food, and a couple of chickens.


http://arianne.sourceforge.net/wiki_images/tiled_38.jpg <br><small>Figure 25: The active objects have been added and can been seen in white</small><br>
[[Image:Tiled23.png]] <br><small>Figure 21: The active objects have been added and can been seen in white</small><br>


We want to make the whole area protected, to we add the tileset ''tileset/logic/protection.png'' and fill on the ''protection'' layer
Note: zone changes go on the border of the map.
[[Image:Tiled24.png]] <br><small>Figure 22: The finished map with the protection layer.</small><br>

http://arianne.sourceforge.net/wiki_images/tiled_39.jpg <br><small>Figure 26: The completed graveyard and bar with collision and objects</small><br>


And you are done! :)
And you are done! :)
Line 171: Line 240:


Please note that, if during your work you find that some important tiles are missing please create the tile and send it to us so that everyone get it and can see your tile.
Please note that, if during your work you find that some important tiles are missing please create the tile and send it to us so that everyone get it and can see your tile.

Note also that you don't generally need to use the protection layer or navigation layers. Protection's for semos city say - where PVP is forbidden. The navigation layer is not used in stendhal.


==Some suggestions when making interiors maps==
==Some suggestions when making interiors maps==
Line 182: Line 249:
* When you put the portals in for new levels, interiors need only the plain white tile saying 'Portal' (even if you are going upstairs). This is because all interior portals are coded by hand so they need the plain white one, not an arrow pointing up or down.
* When you put the portals in for new levels, interiors need only the plain white tile saying 'Portal' (even if you are going upstairs). This is because all interior portals are coded by hand so they need the plain white one, not an arrow pointing up or down.
* To help you understand and to have similar approach, take a look on similar dungeons, outside houses or interiors
* To help you understand and to have similar approach, take a look on similar dungeons, outside houses or interiors

= Parallax Background Support =

A parallax background is an image that scrolls at a different rate relative to normal map layers. It is drawn under map layers and visible where tile image data is not used (fully transparent through all layers). The image can be specified in a zone's XML config using the attribute name "parallax" (example: {{StendhalFile|9c0315793a16907c83d3e0dce761e8e6a66ae115|data/conf/zones/kikareukin.xml#L58|6_kikareukin_islands}}). The value should be a path relative the ''data/maps/parallax'' directory. For example, the value "semos_surrounds" would tell the client to use the image ''data/maps/parallax/semos_surrounds.png''.

However, when adding parallax backgrounds to maps, there are some things to consider for maintaining backward compatibility with the classic Java client. Transparent areas in a map will simply be black in the Java client. So, unless specifically desired, map data should not contain fully transparent areas. But there are two methods that can be used to instruct supporting clients on where to draw transparency on the map:
# You can specify tilesets to be ignored by the client when building map data. Use the attribute "parallax_ignore_tiles" in the zone's XML config. An example of how to do so can be found in the configuration of {{StendhalFile|9c0315793a16907c83d3e0dce761e8e6a66ae115|data/conf/zones/kikareukin.xml#L18|7_kikareukin_clouds}}. Multiple tilesets can be defined using a comma-delimited value (example: image1,image2,...).
# An additional layer named "0_floor_parallax" can be added the TMX map file. The layer should be identical to "0_floor" excluding the portions that should be transparent. An example of how this is done can be found in map of {{StendhalFile|9c0315793a16907c83d3e0dce761e8e6a66ae115|data/maps/Level%206/kikareukin/islands.tmx|6_kikareukin_islands}} ([https://www.mapeditor.org/ Tiled Map Editor] needed to view).


= How to use the map in Stendhal =
= How to use the map in Stendhal =
Line 202: Line 277:
----
----
[[ Stendhal | Back to stendhal main Wiki page ]]
[[ Stendhal | Back to stendhal main Wiki page ]]

[[Category:Stendhal]]

Latest revision as of 08:33, 8 June 2024



How to Use Tiled

Tiled is a tile editor that supports layers and different tilesets. You can download the latest version at http://www.mapeditor.org/.

If you don't have the map files from Stendhal already, please follow these instructions to setup a development environment with the latest source code and map files: Stendhal on Eclipse

How to create a new map

TODO: update these screenshots to the most recent version of Tiled

Before you create a new map, I suggest, that you open some existing maps and look around how they are built. And there are many places in Stendhal already, that could use some improvements or additions.



Figure 1: The Tiled map editor

First you need to load the template.tmx map file and resize the map to the desired size.
Click on File and now choose Open, find where you extracted the stendhal_mapeditor-2.00.zip find template.tmx and click Open


Figure 2: How to open the template map

We are going to work on a 64x64 (64 tiles by 64 tiles) map. First make sure all layers are visible, before you resize. Do this using the 'Show' tick boxes in the dialog at the side panel.

Figure 3: Layers view

Then click on Map and choose Resize. Note, a 64x64 map is not big (it will take a player around 40 seconds to move from one end to the other) but it is big enough for our example.


Figure 4: The Map Menu

As you see in the resize dialog you can resize the map and even position the current map at any point in the new map size. Hence you can always resize your map later. Make sure all layers are visible before you resize any map.


Figure 4: The resize dialog

Don't change the layer names from:

  • protection
  • collision
  • objects
  • 4_roof_add
  • 3_roof
  • 2_object
  • 1_terrain
  • 0_floor

etc etc seen on the template file.

Now save this map as Level 0/semos/small_village.tmx by clicking on File and choosing Save as....
Note: You need to type the complete name with the extension .tmx.


Figure 6: Save As...

Tilesets

The map template.tmx doesn't come with any tilesets preloaded. To load a tileset, click on Tilesets and choose New Tileset .... Now tick the box next to Reference tileset image ... and Click on the Browse button. This lets you choose your tileset image. They are all located in the tiled/tileset/ folder.

Finding what you want should be easy as the tilesets are split into folders depending on what they are used for:

  • building
  • window
  • column
  • decoration
  • door
  • entrance
  • fence
  • roof
  • stairs
  • wall
  • window
  • ground
  • fire
  • ice
  • indoor
  • ladder
  • ridge
  • rock
  • water
  • item
  • armor
  • banner
  • candle
  • chemistry
  • chest
  • corpse
  • drink
  • food
  • furniture
  • bathroom bed carpet chair clock crockery curtain light other picture shelve sink statue table
  • gothic
  • pot
  • statue
  • textile
  • weapon
  • logic
  • creature
  • item
  • object (for larger items that don't belong anywhere else)
  • plant
  • bush
  • flower
  • indoor
  • stump
  • tree
  • sky
  • cloud

We are going to need grass, so we go to tileset/ground and select ground.png

Any image not in tileset/ shouldn't be used. If you want to you can fill in a Tileset name to help you find it later. You can leave everything else as it is. Then click 'Ok' and your tileset is ready to use!

Click on the square in the bottom left corner of the Tiled application to bring up the palette chooser. There's more on this later, so read on ...

Layers

The map layers must not be renamed and must all exist, apart from 4_roof_add which is optional. However, any of the layers can be empty.

These five layers are the ones that host the game graphics:

  • 0_floor
  • 0_floor_parallax (optional alternate floor layer for clients that support parallax backgrounds)
  • 1_terrain
  • 2_objects
  • 3_roof
  • 4_roof_add (optional layer)

The logic layers

  • objects
  • collision
  • protection

are special. The objects layer must ONLY contain tiles from objects tileset (like monsters and food) NOT other graphics. The collision tileset uses ONLY the red square in the collisions tileset and the proection layer uses the green square from the collision tileset.

The draw order is:

  1. 0_floor
  2. 1_terrain
  3. 2_objects
  4. object and sprites like players, monsters, etc... sorted from lowest y, lowest x
  5. 3_roof
  6. 4_roof_add

This basically means that any objects closer to the bottom of the screen, ie the foreground in our pseudo 3D world will be on top of other objects, and roof and roof add will be above everything.

Ok, now let's edit.

Editing the map

Choose the 0_floor Layer.

Our village is going to be a rich one, so let's look for a nice ground tile for it.

Click on Fill and fill the floor with your chosen tile.


Figure 7: The ground on the floor layer

Ok, but the map still looks too simple.

So now let's add some details to the terrain layer (flowers, and bushes). We need to load those tiles, so repeat the steps to load ground tiles, but look for tileset/plant/bush/bushes.png and tileset/plant/flower/daisy_white.png. Make sure you choose 1_terrain layer.
Then in the bottom left hand corner you will see a small square with a tile in it. Click this and a tile selecter dialog will open. On the right you will see the available Tilesets for Stendhal and on the left all the tiles. Tip: if you drag the pallet out and make it bigger you can eventually get all the like tiles to align (so for example the tiles that make up a tree will all be together) and it will make your life a lot easier!
Dot some bushes and flowers around


Figure 8: Adding some plants

We need a path, so we add tileset/ground/green_paving_3.png to our palette, and draw one on the 1_terrain later. We change to the 2_object layer now (or terrain is ok too) to add tombs to the graveyard.


Figure 9: adding a path

Now let's add houses and a tree to our village. As you can see adding elements isn't hard, you simply must flip between layers.

And now for the tree. Trees are a bit more complex than houses because they are split over two layers: 1 and 2.
Make sure that the upper part of the tree is always on either 3_roof or 4_roof_add. This will mean it is drawn over player when they stand 'behind' it.

First we add tileset/plant/tree/spruce.png, and then draw the lower part of it to the 1_terrain layer.
Figure 10: The foot of the tree on the terrain layer

Now switch to the roof layer. The roof layer is for objects that are drawn on top of players and creatures in the game.

Draw the upper part of the tree on roof layer.


Figure 11: The upper part of the tree on the roof layer

Let's practice this. Let's add another tree.


Figure 12: The bottom of our second tree

Remember how to deal with two layers? Make sure the top of the tree is on the roof layer.


Figure 13: The Top of our second tree

A village would not be much of a village without houses. Let's draw one. Start with the wall.


Figure 14: The start of a house - a wall

The wall was drawn on terrain this time, so we can add some decorations to 2_object to make it a bit more interesting.


Figure 15: Wall decorations added

The roof can be drawn on 3_roof, so that a player walking behind the house will be covered by it. For our map we also add the top of the door there, as the window borders already used the space in 2_object.


Figure 16: House with a roof

The front of the blue roof does not have a border like the rest of it. Also we have another problem: the longhorn skull got partially covered by the door top. Fortunately there is one more map layer remaining. So we draw the missing border to 4_roof_add, and move the skull there too.


Figure 17: Finished house

Still there? Good, now let's add lots of details to make a good map!


Figure 18: The map with more details

Complete the map yourself :)

Finally we need to add two more important things:

  • Objects (Entities, active game objects, this includes portals, signs, NPCs etc)
  • Collision
  • Protection (to define non pvp areas)

The collision layer determines what is passable and what is not.
You need to add the new tileset tileset/logic/collision.png and in then choose the red square. To define what cannot be travelled over draw a red square in the Collision layer on each non passable tile. It is helpful to drag the opacity of this collision layer to about 30%.


Figure 19: Collision Tile selected and we have marked the house


Figure 20: The completed collision map

Once you have completed this we have to add objects that are real entities in the Stendhal server. Things like NPCs, some portals, creatures and so on ... Notice what layer we are working on. To add monsters, select them from tileset/logic/creature/ in the objects layer.

We'll add some sheep, sheep food, and a couple of chickens.


Figure 21: The active objects have been added and can been seen in white

We want to make the whole area protected, to we add the tileset tileset/logic/protection.png and fill on the protection layer
Figure 22: The finished map with the protection layer.

And you are done! :)

Now, go build your own maps.

Please note that, if during your work you find that some important tiles are missing please create the tile and send it to us so that everyone get it and can see your tile.

Some suggestions when making interiors maps

Please if you are going to create maps for Stendhal, follow these simple guidelines:

  • The walls have two tiles. The main and the bricks. The bricks goes inside.
  • Put a black space between rooms like in semos hall
  • On buildings Look from outside the building. If it's wide and small for example 10 tiles width and 5 height, make the interior wide and smallX2 like close to 20X10
  • If you enter the map from the south, make the door of the interior also at the south, etc.
  • When you put the portals in for new levels, interiors need only the plain white tile saying 'Portal' (even if you are going upstairs). This is because all interior portals are coded by hand so they need the plain white one, not an arrow pointing up or down.
  • To help you understand and to have similar approach, take a look on similar dungeons, outside houses or interiors

Parallax Background Support

A parallax background is an image that scrolls at a different rate relative to normal map layers. It is drawn under map layers and visible where tile image data is not used (fully transparent through all layers). The image can be specified in a zone's XML config using the attribute name "parallax" (example: 6_kikareukin_islands). The value should be a path relative the data/maps/parallax directory. For example, the value "semos_surrounds" would tell the client to use the image data/maps/parallax/semos_surrounds.png.

However, when adding parallax backgrounds to maps, there are some things to consider for maintaining backward compatibility with the classic Java client. Transparent areas in a map will simply be black in the Java client. So, unless specifically desired, map data should not contain fully transparent areas. But there are two methods that can be used to instruct supporting clients on where to draw transparency on the map:

  1. You can specify tilesets to be ignored by the client when building map data. Use the attribute "parallax_ignore_tiles" in the zone's XML config. An example of how to do so can be found in the configuration of 7_kikareukin_clouds. Multiple tilesets can be defined using a comma-delimited value (example: image1,image2,...).
  2. An additional layer named "0_floor_parallax" can be added the TMX map file. The layer should be identical to "0_floor" excluding the portions that should be transparent. An example of how this is done can be found in map of 6_kikareukin_islands (Tiled Map Editor needed to view).

How to use the map in Stendhal

To add the map to Stendhal you need to code a bit of XML, but don't worry. It is simple!.

Add the zone to data/conf/zones.xml as explained in How to add new maps to server

Finally if you want to fine tunning the map by adding NPC, or something else, just create a new file name base name of your map.java ( in our example that is your area ) and edit it. See other files on the same folder to know how to do it, and more explanation in How to add new maps to server

Trouble shooting

  • If you are submitting this for inclusion in the game, please edit the path for the tilesets so it is correct. usually "../../tileset/XX/YY.png". It is easiest to do this by opening the .tmx file in a text editor.
  • Tiled will only resize visible layers. If you want to resize a map, make sure all layers are visible (the tick box 'Show' is selected) before you resize. But don't worry, if you forget to do this, you can open the .tmx file in a text editor and manually change the sizes of the layers which have been missed out.



Danter Has made an extended tutorial, that focuses on changes made to the stendhal map format and a few techniques he uses, check that out aswell:
How To Use Tiled To Create Stendhal Maps: Continued



Back to stendhal main Wiki page