• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Tibia maps-how they really works?

Sir Juncan

New Member
Joined
Feb 28, 2010
Messages
15
Reaction score
3
I'm not a programmer in any way (yet) and I'm just curious-let's say we 'translate' coded map file of rl/ot map into something we can understand, how it really would looks like? I just want to know how the things work.
My idea is that there are coordinates of every sqm and there's unlimited array for every of it. Am I thinking right? More items on sqm=more positions in every array.
I'm pretty sure that many of you know how it works and I would be glad for explaining me this ;)
 
Hmm I would say that it's a square.

A vector has 3 dimensions (like you see in school). These are X, Y & Z.

X is west / east. (Decreasing for west, increasing for east)
Y is north / south. (Increasing for north, decreasing for south)
Z is floor level. (0-15, 7 is ground floor).

I would say the hierarchy goes like this (this is only a square map with no other floors in it):

0x00 / 0x00 / 0x00
0x00 / 0x00 / 0x00
0x00 / 0x00 / 0x00

The tiles are clean, there are no important information on it. For reading it I would say it would be like (note this is really simplified);

MAP_WIDTH = Read Integer
MAP_HEIGHT = Read Integer
CURRENT_TILE_X_ID = 0
CURRENT_TILE_Y_ID = 0

while CURRENT_TILE_X_ID < MAP_WIDTH
while CURRENT_TILE_Y_ID < MAP_HEIGHT
// Read a map tile data in the current dimensions and set it to our map
MAP_TILE(CURRENT_TILE_X_ID, CURRENT_TILE_Y_ID) = Read_Tile_Data(CURRENT_TILE_X_ID, CURRENT_TILE_Y_ID)
end
end


That is just how I would do it if I was creating an RPG on XNA.

If we were about to read a tile with data information, the binary information and translation would look like this:

UINT32 -> X = 0
UINT32 -> Y = 0
BYTE ->Z = 0
UINT32 -> ITEMS SIZE = 2
  1. 0x01 -> Ground Tile with item id 100
  2. 0x02 -> Wall item type with item id 9999

This is very noob like but you can understand my point, you could take a look in iomapotbm.cpp from a server, or look for XNA map dimensions and such.
 
Back
Top