HowToUseTiledToCreateStendhalMaps: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin
No edit summary
imported>StephenIerodiaconou
No edit summary
Line 1: Line 1:
= How to Use Tiled =
= How to Use Tiled =
Tiled is a tile editor that support layers and different tilesets.
Tiled is a tile editor that supports layers and different tilesets.


= How to create a Map =
= How to create a Map =

Load template.tmx and resize the map to desired size.<br>
So open Tiled by double clicking in <b>tiled.jar</b> or by running it as:
To start Tiled double click on the <b>tiled.jar</b> file or use the following command line:
java -jar tiled.jar
java -jar tiled.jar


http://arianne.sourceforge.net/wiki_images/tiled_0.jpg
http://arianne.sourceforge.net/wiki_images/tiled_0.jpg <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>
Now click on File and now choose Open, find template.tmx and click Open
Click on <i>File</i> and now choose <i>Open</i>, find <b>template.tmx</b> and click <i>Open</i>


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


We are going to work on a 64x64 map. So click on Map and choose Resize.
We are going to work on a 64x64 (64 tiles by 64 tiles) map. So click on <i>Map</i> and choose <i>Resize</i>.
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
http://arianne.sourceforge.net/wiki_images/tiled_6.jpg <br><small>Figure 3: Map Menu</small><br>


As you see you can resize the map and make also bigger so you can create a bigger 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.


http://arianne.sourceforge.net/wiki_images/tiled_7.jpg
http://arianne.sourceforge.net/wiki_images/tiled_7.jpg <br><small>Figure 4: The resize dialog</small><br>


Now edit layers names, so that they are named like the zone we are going to create.<br>
Now you must edit the default layer names so that they are named like the zone we are going to create.<br>
We are going to create a small village, so we name them small_village:
So, for example, here we are going to create a small village, so we preceed each layer name by <b>small_village</b>:
* small_village_collision
* small_village_collision
* small_village_objects
* small_village_objects
Line 30: Line 31:
* small_village_0_floor
* small_village_0_floor


This step is very important because Stendhal use layers' name and not file name to generate game content. So please make sure you named them correctly.
<b>This step is very important</b> because Stendhal uses the layer's name and not the file name to generate game content. So please make sure you have renamed the layers correctly.


http://arianne.sourceforge.net/wiki_images/tiled_3.jpg
http://arianne.sourceforge.net/wiki_images/tiled_3.jpg <br><small>Figure 5: Rename the layers!</small><br>


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>. Don't forget to rename all the layers.
Don't forget to rename all the layers.


http://arianne.sourceforge.net/wiki_images/tiled_5.jpg <br><small>Figure 6: Save As...</small><br>
Now save this map as small_village.tmx by click on File and choose Save as.<br> You need to type the complete name with .tmx

http://arianne.sourceforge.net/wiki_images/tiled_5.jpg


Let's start


==Layers==
==Layers==
As you see there are five layers at the map. It is mandatory for all of them to exists. Although you can let them be empty.
As you have already seen there are five layers in the map. <b>They must all exist. However, they can be empty.</b>


The three firsts layers are the ones that hosts graphics:
The three first layers are the ones that host the game graphics:
* floor
* floor
* object
* object
Line 56: Line 52:
# roof
# roof


That means that everything will be draw as common games, and roof will be above everything. Right?
This basicly 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 will be above everything.

Ok, now let's edit.
Ok, now let's edit.


= Editing the map =
= Editing the map =
Choose floor Layer.
Choose the <i>floor</i> Layer.


Our village is a rich one, so let's look for a nice ground for it.<br>
Our village is going to be a rich one, so let's look for a nice ground tile for it.<br>
Now click on Fill and fill the floor. ok? It is too tiled, so let's add a few details like borders and a checked board at the main square.<br>
Notice that everything is still done at layer 0.


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>
http://arianne.sourceforge.net/wiki_images/tiled_13.jpg
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>
Yes? But the map still looks too simple.
So now let's add some details on the object layer, like walls and so.
Make sure you choose object layer.


Ok, but the map still looks too simple.
http://arianne.sourceforge.net/wiki_images/tiled_14.jpg
So now let's add some details to the object layer (walls and so on).
Make sure you choose <i>object</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>
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>
Again, we draw the basic and add more details.
See how to play with layers.


http://arianne.sourceforge.net/wiki_images/tiled_15.jpg
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


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


http://arianne.sourceforge.net/wiki_images/tiled_17.jpg
http://arianne.sourceforge.net/wiki_images/tiled_17.jpg <br><small>Figure 11: Adding flowers</small><br>


We change back to object layer to add tombs
We change back to the object layer now to add tombs to the graveyard.


http://arianne.sourceforge.net/wiki_images/tiled_18.jpg
http://arianne.sourceforge.net/wiki_images/tiled_18.jpg <br><small>Figure 12: Adding tomb objects</small><br>


Now let's add a house and a tree for our cementery. As you see adding elements isn't hard than just playing with layers.
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.


http://arianne.sourceforge.net/wiki_images/tiled_21.jpg
http://arianne.sourceforge.net/wiki_images/tiled_21.jpg <br><small>Figure 13: Starting to add the house</small><br>


http://arianne.sourceforge.net/wiki_images/tiled_22.jpg
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>


Now see the border of the house. The tileset is faulty, so we need to decorate the fault a bit.
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.


http://arianne.sourceforge.net/wiki_images/tiled_23.jpg
http://arianne.sourceforge.net/wiki_images/tiled_23.jpg <br><small>Figure 15: Covering up the fault</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.
See? I think you got the idea how to apply that trick.


http://arianne.sourceforge.net/wiki_images/tiled_24.jpg
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>


And now the tree. Trees are a bit more complex than houses because they are on two layers: 1 and 2. <br>Just make sure that the upper part of the tree is on layer 2 always, so it is drawn over player.
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.


http://arianne.sourceforge.net/wiki_images/tiled_25.jpg
http://arianne.sourceforge.net/wiki_images/tiled_25.jpg <br><small>Figure 17: The foot of the tree on the floor layer</small><br>


We add the bottom of the tree, tile by tile.
We add the bottom of the tree, tile by tile.<br> Now switch to the roof layer.


http://arianne.sourceforge.net/wiki_images/tiled_26.jpg
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>


And now we add the uppper part of the tree but on layer roof
Now we add the upper part of the tree on layer roof


http://arianne.sourceforge.net/wiki_images/tiled_27.jpg
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 train this. Let's add another tree.
Let's practice this. Let's add another tree.


http://arianne.sourceforge.net/wiki_images/tiled_28.jpg
http://arianne.sourceforge.net/wiki_images/tiled_28.jpg <br><small>Figure 20: 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.
Let's also add a path to the house and create a door on the wall.


http://arianne.sourceforge.net/wiki_images/tiled_31.jpg <br><small>Figure 21: The completed graveyard</small><br>
Did you noticed how to handle layers?


Still there? Good, now let's add lots of details to make a good map!
Let's add a path to the house and create a door at the wall.


http://arianne.sourceforge.net/wiki_images/tiled_31.jpg
http://arianne.sourceforge.net/wiki_images/tiled_34.jpg <br><small>Figure 22: The whole of our village with some extra details</small><br>

http://arianne.sourceforge.net/wiki_images/tiled_34.jpg

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

http://arianne.sourceforge.net/wiki_images/tiled_35.jpg


Complete the map yourself :)
Complete the map yourself :)


Finally we need to add two important things:
Finally we need to add two more important things:
* Objects (Entities, active game objects, this includes portals, signs, NPCs etc)
* Objects
* Collision
* Collision


Collision layer determines what is trespasable and what not.
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.
Draw in red everything that is not trespasable.

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>


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.
http://arianne.sourceforge.net/wiki_images/tiled_36.jpg


http://arianne.sourceforge.net/wiki_images/tiled_37.jpg <br><small>Figure 24: The completed collision map</small><br>
Now we add objects that are real entities in Stendhal server. Things like NPC, Portals, Creatures, zone change points, etc ...


Let's add a portal to our tomb and a few zone entries. And of course, a waiter for our Bar.
http://arianne.sourceforge.net/wiki_images/tiled_37.jpg


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>
Finally let's add a portal for tomb and a few zone entries. And of course a waiter for our Bar.


Note: zone changes go on the border of the map.
http://arianne.sourceforge.net/wiki_images/tiled_38.jpg


http://arianne.sourceforge.net/wiki_images/tiled_39.jpg <br><small>Figure 26: The completed graveyard and bar with collision and objects</small><br>
Notice the zone changes on the border of the map.


And you are done! :)
http://arianne.sourceforge.net/wiki_images/tiled_39.jpg


Now, go build your own maps.<br>
And done! :)


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.
Now build your own maps.<br>
Surely on your work you will find that some important tiles are missed, if you create a new tile please send it to us so that everyone get it and can see your tile.

Revision as of 15:03, 2 June 2005

How to Use Tiled

Tiled is a tile editor that supports layers and different tilesets.

How to create a Map

To start Tiled double click on the tiled.jar file or use the following command line:

 java -jar tiled.jar

http://arianne.sourceforge.net/wiki_images/tiled_0.jpg
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 template.tmx and click Open

http://arianne.sourceforge.net/wiki_images/tiled_1.jpg
Figure 2: How to open the template map

We are going to work on a 64x64 (64 tiles by 64 tiles) map. So 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.

http://arianne.sourceforge.net/wiki_images/tiled_6.jpg
Figure 3: 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.

http://arianne.sourceforge.net/wiki_images/tiled_7.jpg
Figure 4: The resize dialog

Now you must edit the default layer names so that they are named like the zone we are going to create.
So, for example, here we are going to create a small village, so we preceed each layer name by small_village:

  • small_village_collision
  • small_village_objects
  • small_village_2_roof
  • small_village_1_object
  • small_village_0_floor

This step is very important because Stendhal uses the layer's name and not the file name to generate game content. So please make sure you have renamed the layers correctly.

http://arianne.sourceforge.net/wiki_images/tiled_3.jpg
Figure 5: Rename the layers!

Now save this map as small_village.tmx by clicking on File and choosing Save as....
Note: You need to type the complete name with the extension .tmx. Don't forget to rename all the layers.

http://arianne.sourceforge.net/wiki_images/tiled_5.jpg
Figure 6: Save As...

Layers

As you have already seen there are five layers in the map. They must all exist. However, they can be empty.

The three first layers are the ones that host the game graphics:

  • floor
  • object
  • roof

The draw order is:

  1. roof
  2. object and sprites like players, monsters, etc... sorted from lowest y, lowest x
  3. roof

This basicly 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 will be above everything.

Ok, now let's edit.

Editing the map

Choose the 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.
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.
Notice that everything on the ground is still done on layer 0.

http://arianne.sourceforge.net/wiki_images/tiled_13.jpg
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 object layer (walls and so on). Make sure you choose object 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!
We are going to make a small cemetery.

http://arianne.sourceforge.net/wiki_images/tiled_14.jpg
Figure 8: Adding some walls

http://arianne.sourceforge.net/wiki_images/tiled_15.jpg
Figure 9: The completed walls

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

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

http://arianne.sourceforge.net/wiki_images/tiled_17.jpg
Figure 11: Adding flowers

We change back to the object layer now to add tombs to the graveyard.

http://arianne.sourceforge.net/wiki_images/tiled_18.jpg
Figure 12: Adding tomb objects

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.

http://arianne.sourceforge.net/wiki_images/tiled_21.jpg
Figure 13: Starting to add the house

http://arianne.sourceforge.net/wiki_images/tiled_22.jpg
Figure 14: The house is surrounded by brown due to faulty tileset

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.

http://arianne.sourceforge.net/wiki_images/tiled_23.jpg
Figure 15: Covering up the fault

To correct the problem we add some dirt (sand) around the building to make it look like this is part of the design.

http://arianne.sourceforge.net/wiki_images/tiled_24.jpg
Figure 16: More details to break up the large areas of the same tile

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 on layer 2 always. This will mean it is drawn over player when they stand 'behind' it.

http://arianne.sourceforge.net/wiki_images/tiled_25.jpg
Figure 17: The foot of the tree on the floor layer

We add the bottom of the tree, tile by tile.
Now switch to the roof layer.

http://arianne.sourceforge.net/wiki_images/tiled_26.jpg
Figure 18: The roof layer is for objects on top of everything

Now we add the upper part of the tree on layer roof

http://arianne.sourceforge.net/wiki_images/tiled_27.jpg
Figure 19: The upper part of the tree on the roof layer

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

http://arianne.sourceforge.net/wiki_images/tiled_28.jpg
Figure 20: 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. Let's also add a path to the house and create a door on the wall.

http://arianne.sourceforge.net/wiki_images/tiled_31.jpg
Figure 21: The completed graveyard

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

http://arianne.sourceforge.net/wiki_images/tiled_34.jpg
Figure 22: The whole of our village with some extra 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

The collision layer determines what is passable and what is not.
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.

http://arianne.sourceforge.net/wiki_images/tiled_36.jpg
Figure 23: Collision Tile selected and we have marked on of the walls

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.

http://arianne.sourceforge.net/wiki_images/tiled_37.jpg
Figure 24: The completed collision map

Let's add a portal to our tomb and a few zone entries. And of course, a waiter for our Bar.

http://arianne.sourceforge.net/wiki_images/tiled_38.jpg
Figure 25: The active objects have been added and can been seen in white

Note: zone changes go on the border of the map.

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

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.