Map data format

Describes the format of map data.
Please refer to it when using the data of "Graph paper" in your own program.


The file exported by Export's [Map shape data Export (unique format)] records the layout of the parts that make up the map, the map size, and so on. By reading it according to the "Graph paper" format, you can use it in your own program.
Notice However, the character data written on the map by the command [text] is not written to the data exported by [Map shape data Export (unique format)].

Each data is explained below.

1.Labyrinth name
2.Floor name
3.Floor quantity
4.Map size
5.Parts placement data
6.Flooring data when the wall type is

Labyrinth name

Look for the following string in the exported file.

MapName =

The Labyrinth name is recorded after this string.

example:
MapName = Labyrinth of unknown

Return to top

Floor name

Look for the following string in the exported file.

FloorName[0] =

The name of each floor is recorded after this string.

The number [0] after "Floor Name" is the floor number.
If the map has 3 floors, the 3 names are recorded side by side as shown below.

FloorName[0] = Floor 1
FloorName[1] = Floor 2
FloorName[2] = Floor 3

Since the numbers enclosed in [] are numbers starting from 0, the name of the first floor is recorded in [0].

Return to top

Floor quantity

Look for the following string in the exported file.

Floor =

After this string, the floor quantity of the map is recorded.
However, the numbers recorded here start at 0.
In other words, for a map with 10 floor quantities, the number 9 is recorded.

example:
Floor = 9

Return to top

Map size

Look for the following string in the exported file.

MapSizeX =
MapSizeY =

The map size is recorded after this string.
MapSizeX has a horizontal width. The vertical width is recorded in MapSizeY.

However, the numbers recorded here start at 0.
That is, for a map with a horizontal width of 20, MapSizeX will record a number of 19.

example:Horizontal width is 20. When the vertical width is 10.
MapSizeX = 19
MapSizeY = 9

Return to top

Parts placement data

Describes the recording format of the arrangement of the parts that make up the map.

Look for the following string in the exported file.

[MapData]

From the line below this, the part placement data is arranged as the following character string.

00000000000101000101010100010001010100010001000100000101010101000100000000000000000000000000000000000000000000000000000000
00000000000101000101010100010101000001000102000101000001000000000100000000000000000000000000000000000000000000000000000000

This is a record of the part placement in hexadecimal numbers.
Hexadecimal numbers are numbers that start at 0 and carry by 16.
(The numbers we use in our daily lives are decimal numbers that start at 0 and carry up by 10.)

Numbers from 0 to 16 are expressed in hexadecimal format in the following format.

0→00
1→01
2→02
3→03
4→04
5→05
6→06
7→07
8→08
9→09
10→0A
11→0B
12→0C
13→0D
14→0E
15→0F
16→10 Notice Carried up, the number on the left is 1.

In "Graph paper", a number is assigned to each part.
There are four types of parts, "wall", "flooring", "air space", and "object", and numbers starting with 00 are assigned to each type.

A map of empty flooring only that is displayed at startup. This is the state where the number 00 is filled with the assigned flooring parts.

In the three types of parts, wall, air space, and object, number 00 indicates "nothing". Therefore, even if there is nothing on the screen, the data of the wall, air space, and object also contains the numerical value of 00.

Read these numbers from the program into the array data.

The map data is composed by superimposing the following four types of array data.

Vertical wall
Horizontal wall
Flooring
Air space
Object

Notice The message data will be in a different format, so I will explain it separately.

First, I will explain using only walls and flooring as an example.

If the map size is 3 * 3, the data of the flooring and walls with nothing placed will be as follows.
Notice For easy viewing, each number is separated by a space.

[Vertical wall]

00 00 00 00
00 00 00 00
00 00 00 00

[Horizontal wall]

00 00 00
00 00 00
00 00 00
00 00 00

[Flooring]

00 00 00
00 00 00
00 00 00

Look at the flooring data.
For a map size of 3 * 3, the number of 00 is also 3 in both vertical and horizontal directions.

This will be the data in the form corresponding to the squares of the map as it is.
The same is true for air space and objects.

Next, look at the data on the vertical wall.
The number of "00" in the horizontal direction is four.
And for the horizontal wall, the number of 00 in the vertical direction is four.

This is the difference that arises from the fact that the "wall" exists between the squares.

Vertical walls exist on the left and right of the square.
Therefore, if the vertical wall on the left side of the leftmost square is the first, the vertical wall on the right side of the rightmost square is the fourth.


Similarly, horizontal walls lie above and below the squares.
Therefore, if the horizontal wall at the top of the top square is the first, the horizontal wall at the bottom of the bottom square is the fourth.

With this in mind, let's take a look at the state where the elevator (part number: 03) is placed on the vertical wall at the upper right end, the horizontal wall at the upper right end, and the flooring material at the upper right end.

[Vertical wall]

00 00 00 01
00 00 00 00
00 00 00 00

[Horizontal wall]

00 00 01
00 00 00
00 00 00
00 00 00

[Flooring]

00 00 03
00 00 00
00 00 00

Now you have an elevator in the upper right corner and walls on the top and right side of the elevator.

If the elevator is in the dark zone (part number: 01) and a treasure chest (part number: 01) is placed, the data will be as follows.

[Air space]

00 00 01
00 00 00
00 00 00

[Object]

00 00 01
00 00 00
00 00 00

Now let's look at the actual data format.

The format of the description will be as described above.
However, it is not separated by spaces.
The actual format of the elevator placed as the flooring material on the upper right of the map is as follows.

000003
000000
000000

Data is broken for each number of cells in the horizontal direction of the map.
Since the hexadecimal number handled in the map data is two digits, if the map size in the horizontal direction is 3, a line break will be inserted every 6 characters.

The map data starting from the line below [MapData] is recorded in the following order.

1.Vertical wall
2.Horizontal wall
3.Flooring
4.Air space
5.Object

For each type, it is recorded repeatedly for the number of floor quantities.
In the case of a map with a floor quantity of 3, only the vertical wall data is recorded three times in a row, and then the horizontal wall data is recorded three times in a row.

There is no mark for each type of delimiter, so determine the number of lines to read from [Map size].

Let me give you an example.

Map size
MapSizeX = 4
MapSizeY = 2

Floor quantity
Floor = 1

The map size is the number of squares on the map, which is the sum of each number and 1, so the map is 5 squares wide and 3 squares high.
Since the floor quantity is also the sum of 1, it means that the map has two floors.

As with the elevator example above, assuming you have an elevator, a dark zone, a treasure chest, and a wall on the far right of the top edge of Floor 1, the actual data looks like this

[MapData]
000000000001
000000000000
000000000000
000000000000
000000000000
000000000000
0000000001
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000003
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
0000000000
0000000000
0000000000
0000000000
0000000000

For clarity, we'll add type breaks and descriptions.

[MapData]

[Vertical wall]
[Floor 1]
00 00 00 00 00 01
00 00 00 00 00 00
00 00 00 00 00 00
[Floor 2]
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00

[Horizontal wall]
[Floor 1]
00 00 00 00 01
00 00 00 00 00
00 00 00 00 00
00 00 00 00 00
[Floor 2]
00 00 00 00 00
00 00 00 00 00
00 00 00 00 00
00 00 00 00 00

[Flooring]
[Floor 1]
00 00 00 00 03
00 00 00 00 00
00 00 00 00 00
[Floor 2]
00 00 00 00 00
00 00 00 00 00
00 00 00 00 00

[Air space]
[Floor 1]
00 00 00 00 01
00 00 00 00 00
00 00 00 00 00
[Floor 2]
00 00 00 00 00
00 00 00 00 00
00 00 00 00 00

[Object]
[Floor 1]
00 00 00 00 01
00 00 00 00 00
00 00 00 00 00
[Floor 2]
00 00 00 00 00
00 00 00 00 00
00 00 00 00 00

Next, the format of the message data is explained.
Look for the following string in the exported file.

[MessageXY]

Message data is recorded from the line below this string.

First of all, the character string [FloorTop] is recorded.
This is a sign that it is the first floor.
Think of it as data that means "message data begins".

[FloorTop] is followed by the following 4-character string.

012e

This is a hexadecimal record of the coordinates where the message was placed.
The first two letters are the X-axis. The last two letters indicate the Y axis.

In the case of the above string, [01] is the X axis. [2e] is the Y axis.

The X-axis [01] is 1 as it is because the character on the left is [0].

The Y-axis [2e] is 16 * 2 and 32 because the character on the left is [2].
The letter on the right is [e], so if you convert it to decimal, it will be 14.
32 + 14, which is 46.

Therefore, the coordinates of the message are X-axis: 1 Y-axis: 46.

The message can be multi-line.
In that case, the map data is also recorded with line breaks included.

One message ends when the line where the character string [Message_End] is recorded is read.

If another message is recorded on the line following [Message_End], data indicating coordinates such as [012e] is recorded again.

When switching to the data on the next floor, the character string [FloorNext] is recorded.
If the data read up to that point is floor 1 data, the message data starting on the next line of [Floor Next] is floor 2 data.

If no message data is set for that floor, [Floor Next] is immediately recorded on the next line.
If the message is recorded, the data indicating the coordinates such as [012e] is recorded again.

Where the data on the last floor is finished The string [Floor Bottom] is recorded in.

The message data ends at the [FloorBottom] line.

Return to top

Flooring data when the wall type is

If the wall type is and the wall parts are inserted, the wall data will also be recorded in the flooring data.
If the flooring data contains a value of 100 or more, it means that the wall data plus 99 is recorded.

This is used to determine whether to fill the wall position.
This makes the difference that walls are filled and doors are not.

The data used to determine the fill is recorded in the paper.ini file.
For details, see the [Self-made parts] page.

Return to top