Originally Posted by
Scu11
what is a "floor id"?
The id of the floor used by the client to color/texture the ground.
In 400+, the client loads this information from files in index 5 based on the file name which are named m_'x'_'y'. 'x' and 'y' are calculated from the region id.
In the earlier client versions, the information was stored in index 3 and possessed an even file name. The coordinants were related to this file name from the mapindex file which was contained in file 5 of index 0.
These files are loaded like.
Code:
//Note: chunkRotation only applies to maps created with the construct map region packet.
static final void loadFloorData(int tileY, int y, int chunkRotation, int plane, int tileX, int x, Stream stream) {
if (x >= 0 && x < 104 && y >= 0 && y < 104) {
tileFlags[plane][x][y] = (byte) 0;
for (;;) {
int opcode = stream.getUByte();
if (opcode == 0) {
if (plane == 0)
tileHeight[0][x][y] = -method425(tileY + y + 556238, x + 932731 + tileX) * 8;
else
tileHeight[plane][x][y] = (tileHeight[plane - 1][x][y]) - 240;
break;
}
if (opcode == 1) {
int heightModifier = stream.getUByte();
if (heightModifier == 1)
heightModifier = 0;
if (plane != 0)
tileHeight[plane][x][y] = -(heightModifier * 8) + (tileHeight[plane - 1][x][y]);
else
tileHeight[0][x][y] = -heightModifier * 8;
break;
}
if (opcode <= 49) {
overlayIds[plane][x][y] = stream.getByte();
overlayShape[plane][x][y] = (byte) ((opcode - 2) / 4);
overlayRotation[plane][x][y] = (byte) ((opcode + (chunkRotation - 2)) & 3);
} else if (opcode <= 81) {
tileFlags[plane][x][y] = (byte) (opcode - 49);
} else {
underlayIds[plane][x][y] = (byte) (opcode - 81);
}
}
} else {
//Note: Obviously coordinants were out of bounds.
//However, we read the file so that the buffer's reader index will increase.
for (;;) {
int opcode = stream.getUByte();
if (opcode == 0)
break;
if (opcode == 1) {
stream.getUByte();
break;
}
if (opcode <= 49)
stream.getUByte();
}
}
}
For loading the data server sided, the majority of the file is irrelevant. The floor ids I was talking about are the overlayIds/underlayIds. I use the word floor because the file that these ids applied to was called "flo.dat" in pre 400 rs2.