利用者:Nwkkkou

提供: ArtWiki
ナビゲーションに移動 検索に移動

Dear readers, this is going to be the first in a series of few articles which will all have one thing in common: they are technically oriented, so I'd recommend you to have some programming background - otherwise you might find it hard to understand some aspects of this article. I must mention something concerning this and other articles of mine: some content of these articles could be used to create hacking tools and bots. I am aware of this fact, but it is like with all tools: they can be used for good and for bad things. With a hammer you can either build a house or kill your neighbour, then please: do something good for the community and don't misuse your knowledge! Another side note: the entire code you will see in here is written in Delphi XE2. It shouldn't be hard to port it though. In this article I will give you a detailed explanation of the Tibia map format (C++ client).

You can find the map data at "%AppData%TibiaAutomap" for Windows or "~/.tibia/automap" for Linux. You will find a hell lot of files inside that folder - this is your automap. The automap is broken down into 256x256 big pieces. The file name consists of: "xxxyyyzz.map" where x is the x coordinate, y the y coordinate and z the height of the map piece (7 is the regular ground level, 0 stands for deepest underground and 15 for the topmost floor). These numbers are filled up with zeros. They range from "000000000.map" to "25525515.map". If an area has not been explored yet, the file does not exist. As soon as you visit even a tiniest part of it, the file gets created.

It is actually a really easy system, just the details get a bit tricky:

-65536 bytes: 256x256 bytes, each byte representing 1 visible pixel of the map -65536 bytes: 256x256 bytes, each byte representing the walking speed on a specific tile -4 bytes: the amount of markers on the map The following section appears once for each marker on the map, if there are no markers the file ends here. -1 byte: x position -1 byte: map tile the marker is on on the x axis -2 bytes: blank, they are always zero -1 byte: y position -1 byte: map tile the marker is on on the y axis -2 bytes: blank, they are always zero -4 bytes: the image ID of the marker -2 bytes: length of the description that follows -n bytes: the description of the marker, each byte representing 1 ANSI character, not zero terminated