HowToUseTiledToCreateStendhalMaps2: Difference between revisions

From Arianne
Jump to navigation Jump to search
imported>Kymara
Animations: updated
imported>Kymara
Animations: updated
(No difference)

Revision as of 15:31, 3 November 2007

This additional tutorial extends Miguel's tutorial, since it is a bit outdated and contains things that has been changed... I will mainly focus on the changes made to the map format, and a few techniques aswell.

Start by opening template.tmx file, resize it to the size you want, then save it with the new map name, in the directory it's supose to be in (level 0 - level -7 and semos, nalwor. orril etc... depending on wich it is closest to). Just save it in one of those folders, and it should be ready to edit. Also please read zone naming before naming the zone.

Best zone size is 128x128.

We may accept 256x128 on some specials cases ( infrequently visited areas ), but we will force you to split it in smaller zones if it is any bigger ( it is really easy to split the zone anyway ). The template.tmx file has all the layers, and tilesets in the correct order (if you add them wrong, tiles and animations will become wrong in the game), thus I sugest you always use the template.tmx file to create new maps.

Now when you have your clean map, it's just to start drawing... some things you need to know is about the changed layers we have, im going to start from the bottom and move up.

Zone naming

Zones are split based on its level:

  • Level 0
  • Level -1
  • Level -2
  • Level -3
  • Level -4
  • Level -5
  • Level -6
  • Level -7
  • Interiors

Zones have a name that denotes their spacial location.
Every relevant geographical location has its unique name like:

  • Orril
  • Semos
  • Nalwor
  • Ados
  • Kotoch
  • ...

So the central point of that area has a simple name like dungeon, city, castle or whatever. And around it we build the whole map using n,e,w and s keywords to denote cardinal positions. So for example

 0_semos_city is the central point of this area.
 0_semos_forest_nw is the forest of semos that is on the north west position of semos central point.
 0_semos_forest_n2_w is the forest of semos above the previous forest.

Layers

0_floor

The bottom of it all. This layer is used to draw different kinds of land, like sand, grass, water or anything else of that kind. Make sure you draw one "full tile" (a "full tile" is a tile that dosnt have any transparent pixels in it) on every tile in this layer (even if it's just a black tile) othervise if nothing else is drawn here, the play field wont update after you walk near it, making a blur effect, until that spot comes out of the screen.

1_terrain

The "mix" layer. This layer is mainly used to bind grass, sand, water or ony other terrain togheter, making the different terrains blend togheter. This layer is also used to give the map a "personality"... If you open the orril_forest map there is a place on that map you find a portal (position 60,90). Near that portal you have statues surrounding it. Now on those statues you see vines growing on them, those statues is placed in the mix layer while the vines is actually placed in next layer, creating the feeling of that the statues is very old, and have been standing there for ages.

2_objects

This layer is mainly intended for placing bushes, flowers, tree bases and other small things that might exist in the world.This layer can actually be used just like the 1_terrain layer thou, for mixing small objects into the world. My main rule for using the 1_terrain layer and the 2_object layer is that: "it should look correct", and thats all you have to think of aswell.

3_roof

Anything you place in this layer will be drawn "above" the player, making an effect of walking behind it (comonly used for the tree tops).

==4_roof_add== Just like the 3_roof layer you walk behind this, however this is also drawn above the 3_roof layer, so you can draw small enteties and gadgets on houses your supose to be able to walk behind (take a look on how our tower in the nalwor_city map is done).

Objects

This layer is a bit more advanced then the other layers. So I take it ferther down.


Collision

Probably the most important layer of all. This layer tells where you can move or not in the map, just place the red tiles in the collision tileset wherever you don't want players to be able to walk, make sure no other tiles is placed here, cause they will work as collision tiles aswell.

Protection

This layer is used to create protection zones, ie non pvp (player versus player) zones, use the green tile in the collision tileset to place these zones. The protection zone is done on a tile per tile basis.

Objects revisited

Ok back to the objects layer. This layer is used to place monsters, food and portals.

In the objects tileset you have alot of black and white monsters, all the tile id's of these are used in the creatures.xml file to describe what monster should be placed there. Just place a few monsters from this tileset in the object layer, and they will be there ingame later when server, update.

On the last tile of the object tileset, you have a tile that says food. This is food for the sheeps you can place on the bushes (or on any other place actually... but don't confuse the players!... or our poor sheeps :P ).

The last thing that is important in this layer is the portals. Most of the portals need to be coded using Java ( or Python now ) to set the destination. The exception are the portals that has a colored door, is used to create "standard house" entrances... if you place it in the map the player will teleport to the standard interior house we have on the server ( house_000.tmx ). The two portals with stairs on, is used to go up or down in the "world layers" (check world.tmx file) you have to place them on the exact same coordinate in the world, in order for them to work thou.

If you want to create a portal leading to a specific interior house or something alike, you need to edit the java files for the different maps ( src\games\stendhal\server\maps\semos.java for the semos map) TODO: Explain how to add portals using Pyhton config


Animations

Most tiles we use in stendhal now which should be animated, are animated already. For example the white daisy, the flames, etc. We document here how it's done.

The animations are configured in a file at tiled/tileset/animation.seq. Lets look at a simple example, the flames. T

tileset/item/furniture/light/flames.png 0       0:1
tileset/item/furniture/light/flames.png 1       0:1

The flames.png has two tiles, counting from 0 they are numbered 0, 1. There is an entry for each tile which should be animated. 0:1 tells the order they should animate in.

Lets try a more complicated example, the white daisy. That is a file with both a double daisy and a single daisy in it. We want the double daisies animated in a sequence, and the single in a sequence, and never the twain shall meet.

tileset/plant/flower/daisy_white.png    0       0:2:4:6@3500
tileset/plant/flower/daisy_white.png    2       2:4:6:0@3500
tileset/plant/flower/daisy_white.png    4       4:6:0:2@3500
tileset/plant/flower/daisy_white.png    6       6:0:2:4@3500
tileset/plant/flower/daisy_white.png    1       1:3:5:7@3500
tileset/plant/flower/daisy_white.png    3       3:5:7:1@3500
tileset/plant/flower/daisy_white.png    5       5:7:1:3@3500
tileset/plant/flower/daisy_white.png    7       7:1:3:5@3500

The even numbers tiles, 0:2:4:6, are the double daisy. So for example tile 0 in daisy_white.png animates 0->2->4->6, through all the 'double daisies' in sequence. Same for the other double tiles. The odd numbers tiles, 1:3:5:7, are the single daisy. As you've probably now guessed, tile 1 is told to animate through 1:3:5:7, all the single daisy frames.

In the white daisy example, notice the extra @3500 after the sequence order. This tells the (somewhat slow) speed that daisies are animated at. If you don't want to use the default speed, try adding a speed like this and do 'trial and error' till you achieve a realistic effect.

If you have any unanswered questions after this, please join our IRC channel irc.freenode.net #arianne, and we will answer them with the best of our abilities. Just ask and wait around for someone to answer :)


Miguels beginner map tutorial
Back to stendhal main wiki page