Jump to content

Maps

In Metin2, a Client map is divided in chunks (or areas), each chunk represents a portion of the map.

There are two types of map that the client can load, Indoor and Outdoor maps.

Outdoor maps are all the maps that you freely stay on the outside (not in a closed place), an example of this could be a village.

Indoor maps are all the maps that are closed, an example of this could be the monkey dungeon or the spider dungeon. Indoor maps does not load an environment, as the presence of the sky and the sun should not exist.

Each chunk has it's own ID and represents an area of 128x128.

The chunks size are defined in the Settings file, when you warp to a coordinate, for example: (20, 0), the client will divide the current X and Y of the chunk size to the coordinates, and generate an X and Y id, the X id will be multiplied by 1000.

For example, (0, 20) will be chunk 000000, while chunk (128, 0) will be associated to chunk 001000.

 

MapProperty.txt

This file contains the type of the Map. This file is a text file that honors the Metin2 Script file.
NOTE: The type of this script MUST be MapProperty

Options
Name Description Possible values
MapType Described the type of the map Either "Indoor" or "Outdoor" (with the commas)
ParentMapName The map where this map is contained, this is used for boss rooms and guild village zones per each reign. A string (with or without comma)

 

Settings.txt

 

This file contains the configuration of the Map. This file is a text file that honors the Metin2 Script file.
NOTE: The type of this script MUST be MapSetting

Options
Name Description Possible values
CellScale ? Signed number (Always 200?)
HeightScale ? Floated number (Always 0.500000?)
ViewRadius ? Signed number (Always 128?)
MapSize Width and Height of the map Two signed numbers
BasePosition Base X and Y of the map (Although it is present in the Client but it is only used in the Server) Two signed numbers
TextureSet The TextureSet file name A string
Environment The name of the Environment file A string

 

Atlas minimap

The following minimap shown when you press M (internally called Atlas).

.png

There are two known ways of setting up the atlas, first is by providing a file called "atlas.sub" inside the map directory, the second way is by creating a file called "atlas.sub" inside the following folder: "d:/ymir work/ui/atlas/(map name)".

If this image does not exist then the game will report that the Atlas map cannot be shown.
The sub file respect the style of a Metin2 Sub file.

 

Chunk files

The following files listed are contained in each chunk map folder.

 

attr.atr

This file defines the collision of an area.
The first 6 bytes MUST contain the following data:

0x4A 0x0A (File identifier)
0x00 0x01 (Width of the area, always 256)
0x00 0x01 (Height of the area, always 256)

What follows after is the collision data of every point of the map. The data lists each X coordinate for one Y coordinate. (From (0,0) to (256,0) then (0,1) and so on).
A collision byte contains informations inside it's bits.

Known collsion bits
Number Description
Bit 1 An entity can walk into that coordinate
Bit 2 The coordinate is filled with water
Bit 3 PVP is disabled in that coordinate
Bit 8 A guild building can be built in that coordinate

 

water.wtr

This file defines the water height information, this defines how much space should the water occupy in the map.
The first 6 bytes MUST contain the following content:

32 15 (File identifier)
80 00 (Width of the water map)
80 00 (Height of the water map)

The 7th byte contains the number of water height contained in the map, if the number is 0, no map will be loaded.
The next data contains the water height numbers, the data lists each X coordinate for one Y coordinate. (From (0,0) to (256,0) then (0,1) and so on assuming 256 is the width of the chunk).

Each height number is stored in a 4-byte number.
For example, the coordinate (1,2) will start in the 2052th ( (2*256) + 1) * 4) position of the data array, assuming the map width and height are 256.

NOTE: The game references a support for 2-byte height, but they looks like they can throw a copy error / disabled.
NOTE: The client only supports width and height of 256, although is possible to make bigger chunks.

 

AreaProperty.txt

This file is a text file that honors the Metin2 [Script file].
NOTE: The type of this script MUST be AreaProperty

Options
Name Description Possible values
AreaName ? A string with comma
NumWater Number of water maps contained? A signed number

 

AreaData.txt

This file contains all the 3D objects that the chunk contains.
This file is a text file that honors the Metin2 Script file with nodes.
NOTE: This file starts with AreaDataFile not with a ScriptFile.

Options
Name Description Possible values
ObjectCount Number of objects contained in the map A signed number

Based from the number of object counts, there will be one or more object information vector contained inside.
NOTE: Please note that the count starts from 0.

Object vector
Number Description Possible values
1 X position Float number
2 Y position Float number
3 Z position Float number
4 CRC32 of the file name (.prt) Signed integer
5 Rotation if the rotation value contains # then 3 float numbers are used to represent the yaw, pitch and roll (Yaw#Pitch#Roll), otherwise, only one float number is used to represent the roll
6 A number that will be added to the object height Signed integer (can start with - to indicate a subtraction)
7 to 15 The name of the portal point One or more name that represents the id of the portal (if the object is a portal), the ID of the portal starts from 0 to 7 (max numbers of portals is 8).

 

AreaAmbienceData.txt

This is another file that loads the 3D objects that a chunk contains, it is currently not known the difference between ambience data and normal data.
This file is a text file that honors the Metin2 [Script file].
NOTE: This file starts with AreaAmbienceDataFile not with a ScriptType.

Options
Name Description Possible values
ObjectCount Number of objects in this map Signed number

Based from the number of object counts, there will be one or more object information vector contained inside.
NOTE: Please note that the count starts from 0.

Object vector
Number Description Possible values
1 X position Float number
2 Y position Float number
3 Z position Float number
4 CRC32 of the file name (.prt) Signed integer
5 ? Signed integer
6 ? Float number

 

minimap.dds

This texture contains a 256x256 representation of the chunk that will be used in this minimap:

.png

 

shadowmap.dds

This texture contains a 256x256 used to draw the shadows of the minimap chunk.

 

height.raw

This file contains the information of the height of the terrain.
The file has a fixed size of 34322 bytes and it always represents a map chunk with width and height 131x131.
The Z axes of the map is expressed inside two bytes (hence why the size is 131*131*2).

 

tile.raw

The file usage is unknown.
This file has a fixed size of 66564 byes and it always represents a map chunk with width and height 258x258.


  Report Doc

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.