HowToUseTiledToCreateStendhalMaps2

From Arianne
Revision as of 08:20, 2 February 2006 by imported>MiguelAngelBlanchLardin
Jump to navigation Jump to search

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 folder it's supose to be in (level 0 - -7). Be sure to copy first the template file to the correct location before opening or it won't work.
Also please read zone naming before naming the zone.

Best zone size if 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 that to create a new map.

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

TODO

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 atleast something in every tile on 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.

Navigation

This was intended to be used for monster navigations, I sugest that you check the other maps on how they should be placed... just leave them othervise and we will add them... miguel was talking about that we probably aint using this layer right now thou... since we are experimenting with monster pathfinding alot.

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.



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... im not sure if all portals is used anymore, but 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) I don't know the exact process, since im no java master... but I can make small changes to it... usually I tell miguel to fix it thou, and thats what I sugest you to do aswell.

Animations

Ok, map is done, ready to comitt... but there is still one more thing we need to do to have some movement in the world... Animations.

Animations is a bit troblesome to do right now. If you look in the bottom of the src\games\stendhal\client\TileRenderer.java file you have a rather long list, this is a list of tiles that should be animated, and what order it should be animated in. Im gona take the Double white daisy as example (the white flower having two flowers on one tile)

// Double white daisy
addAnimatedTile(22,new int[]{22,52,82,112,112,112,112,112,112,112});
addAnimatedTile(52,new int[]{52,82,112,22,22,22,22,22,22,22});
addAnimatedTile(82,new int[]{82,112,22,52,52,52,52,52,52,52});
addAnimatedTile(112,new int[]{112,22,52,82,82,82,82,82,82,82});

Now the double daisy has 4 animation tiles in the outside_0 tileset, what we do is count to these tile positions from the start in the tileset to the tile we want, starting in the upper left corner, going towards right, then jump to the next row in the tileset, until we encounter the tile we want (math is a good friend here....) then we write that tileid down at the first place (outside the {} parantheses). This will tell that this tile will have an animation, that goes in the order described inside the {} parantheses. Repeat this process for all the tiles you want animated, and they will be animated ingame later when server resets. If the lines for the tiles you want animated already exist, you don't need to bother about animations thou, cause those tiles will already be animated.

If you have any unanswered questions after this, please join our IRC channel irc.freenode.net #arianne, and I will answer them with the best of my abileties.


Anders Asplund aka Danter @ irc.freenode.net #arianne



Miguels beginner map tutorial
Back to stendhal main wiki page