HowToUseTiledToCreateStendhalMaps: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Kiheru m →Editing the map: Explicitly mention the layer(s) where tree tops should be |
imported>AntumDeluge →Parallax Background Support: how to specify multiple tilesets to ignore |
||
| (116 intermediate revisions by 6 users not shown) | |||
| Line 1: | Line 1: | ||
{{Navigation for Stendhal Top}} |
{{Navigation for Stendhal Top|Contributing}} |
||
{{Navigation for Stendhal Contributors}} |
{{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/. |
||
You can download our Stendhal's map tiles [http://downloads.sourceforge.net/arianne/stendhal_mapeditor-2.00.zip?modtime=1177281124&big_mirror=0&filesize=5113162 here], and you will need to update these tiles by double clicking the ''update.bat'' - be patient - it really takes some time to run! |
|||
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]] |
|||
| ⚫ | |||
| ⚫ | |||
{{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. |
|||
To start Tiled double click on the <b>tiled.jar</b> file or use the following command line: |
|||
java -jar tiled.jar |
|||
[[Image:Tiled1.png]] <br><small>Figure 1: The Tiled map editor</small><br> |
[[Image:Tiled1.png]] <br><small>Figure 1: The Tiled map editor</small><br> |
||
| Line 118: | Line 121: | ||
These five 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 ''optional layer'' |
* 4_roof_add ''(optional layer)'' |
||
The ''logic'' layers |
The ''logic'' layers |
||
| Line 166: | Line 170: | ||
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. |
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. |
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. |
||
First we add ''tileset/plant/tree/spruce.png'', and then draw the lower part of it to the ''1_terrain'' layer. |
|||
[[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. |
|||
We add the bottom of the tree, tile by tile.<br> Now switch to the roof layer. |
|||
Draw the upper part of the tree on roof layer. |
|||
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:Tiled13.png]] <br><small>Figure 11: The upper part of the tree on the roof layer</small><br> |
|||
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> |
|||
Let's practice this. Let's add another tree. |
Let's practice this. Let's add another tree. |
||
[[Image:Tiled14.png]] <br><small>Figure 12: The bottom of our second tree</small><br> |
|||
Remember how to deal with two layers? Make sure the top of the tree is on the roof layer. |
Remember how to deal with two layers? Make sure the top of the tree is on the roof layer. |
||
[[Image:Tiled15.png]] <br><small>Figure 13: The Top of our second tree</small><br> |
|||
A village would not be much of a village without houses. Let's draw one. Start with the wall. |
|||
[[Image:Tiled16.png]] <br><small>Figure 14: The start of a house - a wall</small><br> |
|||
The wall was drawn on terrain this time, so we can add some decorations to 2_object to make it a bit more interesting. |
|||
[[Image:Tiled17.png]] <br><small>Figure 15: Wall decorations added</small><br> |
|||
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. |
|||
[[Image:Tiled18.png]] <br><small>Figure 16: House with a roof</small><br> |
|||
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. |
|||
[[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! |
||
[[Image:Tiled20.png]] <br><small>Figure 18: The map with more details</small><br> |
|||
Complete the map yourself :) |
Complete the map yourself :) |
||
| Line 193: | 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> |
||
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%. |
|||
[[Image:Tiled21.png]] <br><small>Figure 19: Collision Tile selected and we have marked the house</small><br> |
|||
| ⚫ | |||
| ⚫ | Once you have completed this we have to add objects that are real entities in the Stendhal server. Things like NPCs, |
||
| ⚫ | |||
| ⚫ | |||
We'll add some sheep, sheep food, and a couple of chickens. |
|||
[[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 216: | 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 227: | 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 = |
||