Map Example, "Testtown"

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Locked
pateame

Map Example, "Testtown"

Post by pateame »

This post will be used as a map creation example on eAthena (or TMWserv), our map will be called "Testtown" while some better name and placement be founded after create all.
I will try to explain how to get all procedure, at end of post there will be an example of the result modded files to can add our map on server with update packet.
At same way, I will post any update on that map, so... I accept suggestions of any kind for development.

UPDATE: FULL MAP PICTURE:
http://pateame.googlepages.com/save.jpg
---------------------------------------------------------------------------------------
Creating a map
1) Creation of a Tile:
First you need a Tile, a group of images than build your mapset. For that you can do it on PNG with any graphic editor:
Tile Example: (based on post from rip to redraw)
Image
Image
[+] EDIT: If you want to add a second floor as on map example, you can add a new layer an put it over the rest of layers to can have our object over the old "over" layer.
---------------------------------------------------------------------------------------
2) Creation of a map (TMX & WLK):
After having a tile, you must need to use a program called Tiled to can build your own map
Image
Tiled lets you add your own tileset image to can build a complete map using layers according to objects order (from floor to over)
Once you have your set complete, Tiled lets you save your map on .TMX and .WLK extensions.
.TMX will be used on update packets (is the map information)
.WLK will be used on TMWserv, in /data/file.WLK (is the information of the collitions on map)
--------------------------------------------------------------------------------------
3) Creation of Custom Update Packets
Custom .ZIP Update
Update .ZIP file: ---> Download: test-map.zip 05037fba
That packet contains the following files to be added:
l-----/graphics/tiles/town.png (The PNG tile data)
l----- /maps/testtown.tmx (The TMX map data)
l-----/graphics/tiles/town1.png (The 2nd floor roof and a new window as updates)

Its simple, you only need to do a custom .ZIP packet with the needed files to load map. Two paths should be also included:
/graphics/tiles
/maps/
And inside every path, there should be the update file we are going to use:
/graphics/tiles/town.png
/maps/testtown.tmx
To can validate the packet on Update server, you need to find the ADLER32 checksum of the .ZIP file, yo can do it with a simple program as hashcalc.
Image
After you know the ADLER32 checksum of the custom .ZIP update, you can edit the resources2.txt file on server with the proper information of packet to be readed.
Example: ZIPNAME.ZIP ADLER32
test-map.zip 754cc75f
---------------------------------------------------------------------------------------
MAP CREATED! Now we need to modify some files on server to can be able to load new map when map-server starts.
----------------------
4) Server Modifications:
It´s the harder part, but if you know how the file structure is, you wont have any problem. On this example those files were edited:
** /npc/ = That directory will work to add all our map functions (as respawn, npc players, warps, etc). We will need to create a new folder with our map name (/npc/testtown/) and add all our stuff there.
[+] /npc/_import.txt (It vinculate the map files to can be loaded by map-server)
[+] /npc/testtown/_mobs.txt (Note that /npc/newfolter should be created to host all map files, in _mob.txt there´s the moster respawn data)
[+] /npc/testtown/_import.txt (There´s the list of things to be loaded by map-server on that map)
** /data/ = That directory has the map collision files and also the resources name table.
[+] /data/resnametable.txt (It says to server what files are vinculated)
[+] /data/testtown.wlk (It´s the file were map-server read the collitions on map)
** [+] /resources2.txt (It´s the file were update server read the new packets to be updated)
Just see the data example for this map, somethings are easy to understand, other things need practica to can be assimilated.
---------------------------------------------------------------------------------------
Server File Modifications
[+] New File: /data/resnametable.txt (we update the resources table to let map-server find files)

Code: Select all

testtown.gat#testtown.wlk#
[+] Add lines to File: /npc/_import.txt (here we link our file to can be imported on map-server load)

Code: Select all

import: npc/testtown/_import.txt
[+] New File: /npc/testtown/_mobs.txt (Supposing that 1038 is the Squirrel ID, we will do a respawn at spots 15,26 and 27,27 on map, every spot with 5 squirrels)

Code: Select all

// test town
testtown.gat,15,26,5,5    monster    Squirrel    1038,5,0,0,Mobtesttown::On1038
testtown.gat,27,27,5,5    monster    Squirrel    1038,5,0,0,Mobtesttown::On1038
testtown.gat,0,0,0    script    Mobtesttown    -1,{
On1038:
    set @mobID, 1038;
    callfunc "MobPoints";
    break;
    end;
}
[+] New File: /npc/testtown/_import.txt (here we load the map and functions inside our map, only mobs or "monster respawn" in this case)

Code: Select all

map: testtown.gat
npc: npc/testtown/_mobs.txt
[+] New File: /data/testtown.wlk (This file is generated by tiled, we add it to data folder on server)

Code: Select all

File = http://pateame.googlepages.com/testtown.wlk
[+] /resources2.txt (adding our custom .zip packet to resource list)

Code: Select all

test-map.zip 05037fba
----------------------------------------------
And well... that´s all!. there´s our map, with our tile and some squirrel respawn to get fun.the idea is clear now to try yourselve. :)
Last edited by pateame on 13 May 2009, 02:54, edited 9 times in total.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Map creation example

Post by Jaxad0127 »

http://wiki.themanaworld.org/index.php/Mapping_Tutorial

Knowing how to make an update zip isn't required to be a mapper.
Image
pateame

Re: Map Example, "Testtown"

Post by pateame »

Wiki documentation is quite good too, It help me a lot. The explanation about .zip updates could be useful if people is planning to setup their own eAthena and update server, but of course all tests can be done in local avoiding the checksum validation or update server connections.
.........................................
TestTown Last Update (07/04/2009)
- Added NPCs and some warps examples
- Added Animated Water fountain NPC

Downloads:
[+] Map .zip packet: test-map.zip 500806cd
.WLK for map: http://pateame.googlepages.com/testtown.wlk
[+] NPC update (Water Fountain): npcfountain.zip bea96c7d

--------------------------- Guide Corner ----------------------
Part II: Adding NPCs & Warps on map

We can manage the graphics part on tiled, but we cann´t directly program over map. The vital information that Tiled give us is the map placement.
On map, there´s coordinates than let us place our things on map. Those coordinates (20,21. 10,5, etc) will be used to place our objects on map from code.
Image
-----------------------------------------------------------------
Server Modifications
[+] Adding existent NPCs on map
We create a new file with the NPC name we want to add, or we can add several NPCs on the same file if those aren´t too complex scripts.
File creation: npc/testtown/npcs.txt
After we use the map coordinates to place the NPC on a position we like, also we assing the ID from the NPC we are going to use.
Image

As a script example, there´s the NPCs added to TestTown
[+] Outis & Eyda script: http://pateame.googlepages.com/npcs.txt
After create the file, we should add the reference to it on the npc/testtown/_import.txt file (Adding a line as: "npc: npc/testtown/npcs.txt")

Code: Select all

map: testtown.gat
npc: npc/testtown/_mobs.txt
npc: npc/testtown/npcs.txt
-------------------------------
[+] Adding new NPCs on map
To add a new NPC, we should update the file named /npcs.xml and place the ubication of the .xml of our new NPC
File Addition: /npcs.xml

Code: Select all

<npc id="203"><sprite>npc-fountain.xml</sprite></npc><!-- Water Fountain test -->
</npc>
After that, we can make a .zip packet adding our NPC data, And add also the new npcs.xml modified inside the packet, as an example:
[+] Download: npcfountain.zip bea96c7d
In this case, we have the following files inside the update packet:
[+] /npcs.xml
[+] /graphics/sprites/npc-fountain.png
Image
[+] /graphics/sprites/npc-fountain.xml

After get the update working, we can setup the Server configuration and create a new file for the NPC (/npc/testtown/fountain.txt).
This is the programmed routine of the Water fountain
[+] NPC Fountain script: http://pateame.googlepages.com/fountain.txt

After we program the NPC, we should add it to map imports on npc/testtown/_import.txt:

Code: Select all

map: testtown.gat
npc: npc/testtown/_mobs.txt
npc: npc/testtown/fountain.txt
npc: npc/testtown/npcs.txt
-------------------------------
[+] Adding warps on map
Its even more simple, We place a warp on a map coordinate and after we say where we want to be warped (can be a new position on a new map, or a position inside the same map). So, we create a new file called npc/testtown/_warps.txt and add our warps there.
Image
[+] Warps Script: http://pateame.googlepages.com/_warps.txt
After get our warps script, we add it on map imports on npc/testtown/_import.txt:

Code: Select all

map: testtown.gat
npc: npc/testtown/_mobs.txt
npc: npc/testtown/fountain.txt
npc: npc/testtown/npcs.txt
npc: npc/testtown/_warps.txt
Last edited by pateame on 13 May 2009, 02:52, edited 2 times in total.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Map Example, "Testtown"

Post by Jaxad0127 »

Please look at the maps we already have. All warps are defined in the TMX files. All mobs should be too (many still need to be ported). There is a converter in tmw-eathena-data that makes all NPC files that start with _ (_import.txt, _mobs.txt, _warps.txt).
Image
sabata
Peon
Peon
Posts: 2
Joined: 08 Apr 2009, 15:51

Re: Map Example, "Testtown"

Post by sabata »

Hi, ok so I am new...

And I was wondering... we have floor layer thats where all ground tiles are placed yes?

Then we have Fringe thats where we place, trees, houses, statues, yes?

Then we have Over thats if we have a 3 tiles tall image, say a tree, you still want to walk behind it...so you mark the tiles behind with Over, yes??

And then we have collision thats all tiles that users cant walk on, yes?

Also all map is build by cutting one big image by parts...I mean like a house, to build it you need to draw it then cut by tiles and join later on Tiled, yes?

Ok thank you, hope someone can answer this ones just so I can be sure.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Map Example, "Testtown"

Post by Jaxad0127 »

sabata wrote:Hi, ok so I am new...

And I was wondering... we have floor layer thats where all ground tiles are placed yes?

Then we have Fringe thats where we place, trees, houses, statues, yes?

Then we have Over thats if we have a 3 tiles tall image, say a tree, you still want to walk behind it...so you mark the tiles behind with Over, yes??

And then we have collision thats all tiles that users cant walk on, yes?

Also all map is build by cutting one big image by parts...I mean like a house, to build it you need to draw it then cut by tiles and join later on Tiled, yes?

Ok thank you, hope someone can answer this ones just so I can be sure.
http://wiki.themanaworld.org/index.php/Mapping_Tutorial
Image
sabata
Peon
Peon
Posts: 2
Joined: 08 Apr 2009, 15:51

Re: Map Example, "Testtown"

Post by sabata »

I've read that, before asking.... not exactly self explanatory in some parts... but thanks
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Map Example, "Testtown"

Post by Jaxad0127 »

sabata wrote:
I've read that, before asking.... not exactly self explanatory in some parts... but thanks
The only layers that are required are "Fringe" and "Collision" (some older clients require the capitalization, newer ones don't, but they must have those names). Their purposes are explained in the tutorial article. Any (reasonable) number of extra layers can also be used.
Image
pateame

Re: Map Example, "Testtown"

Post by pateame »

Adding Cementery to testtown
TestTown Last Update (12/05/2009)
- Added Cementery and zombie respawn points

Downloads:
[+] Map .zip packet:
map_graveyard.zip 70167019
[+] NPC files:
http://pateame.googlepages.com/npcs_testown.zip

I used some posted graphics as:
Church by i: http://forums.themanaworld.org/viewtopi ... &start=210
Dead tree: http://forums.themanaworld.org/viewtopi ... ree#p45622
Tombs by yosuhara: http://forums.themanaworld.org/viewtopi ... 065#p29065

Also draw some sketch of elements as gates (fences) and change the rooft color from church and color from dea tree. I´m not sure if its the desired concept, its just a simple example and need much more work.
As map is now bigger and on a different map X & Y position, so.... as the NPC, mobs and warps were changed of position, I include a .ZIP with the script files for server configuration with their new position on map.

Full map view: http://pateame.googlepages.com/save.jpg
[+]Preview of Cementery:
http://pateame.googlepages.com/prev_cementery.png
Last edited by pateame on 15 May 2009, 03:03, edited 2 times in total.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Map Example, "Testtown"

Post by Crush »

*sigh*

I thought you learned about our copyright policies. And now you are doing it again.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Hykaro
Novice
Novice
Posts: 108
Joined: 02 Apr 2009, 23:55

Re: Map Example, "Testtown"

Post by Hykaro »

very creative the map
...
User avatar
triggs
Peon
Peon
Posts: 37
Joined: 11 Aug 2010, 00:24
Contact:

Re: Map Example, "Testtown"

Post by triggs »

put the Woodland_x3.png on the forums
--J Triggs
Image
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Map Example, "Testtown"

Post by Crush »

triggs wrote:put the Woodland_x3.png on the forums
Triggs:

1. This thread is from 2009
2. We already told you how to access the TMWdata git repository via the web http://gitorious.org/tmwdata/mainline/trees/master
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Locked