HowToUseTiledToCreateStendhalMaps: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
No edit summary
imported>AntumDeluge
Parallax Background Support: how to specify multiple tilesets to ignore
 
(83 intermediate revisions by 5 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. We use the official Java (not Qt) version from Mapeditor, and prefer version [http://sourceforge.net/projects/tiled/files/Tiled/0.6.1/tiled-0.6.1-bin.zip/download 0.6.1]. Download the zip and extract it.
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]]
= How to create a Map =

= 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.


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 245: 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 =