Code: Alles auswählen
Map is matrix of 112x64 blocks
Each file is a block of 64x64 tiles
Map sizes are width=112x64=7168 height=64x64=4096
XBlock = Int(XPos/64)
YBlock = Int(YPos/64)
Block Number = (XBlock * 64) + YBlock
Blocks are loaded from top to bottom than left to right.
Cells are loaded from blocks top to bottom then left to right.
Every files in facetX.uop is a block, execpt for the first file that contains map size.
In a block file there are 3 type of elements:
- LandTile
- Delimiter
- StaticTile
Header for all elements:
BYTE Unk1
BYTE Type1
BYTE Type2
if(Type1!=0) elem is a Delimiter, Type1 is # boundary blocks, Type 2 is Relative Direction of first block
if(Type1==0) && (Type2!=0) elem is a StaticTile, Type2 is # static blocks
else elem is a LandTile
The first element is always a LandTile, with WORD (Type1,Type2) set to current Block ID.
Then for each types continues as it follows:
for LandTile:
SBYTE Z (-127,127)
WORD New Graphic (8==Snow 5==Sea 1==Grass ...)
WORD Legacy Graphic flipped
for Delimiters:
(it appears only after cells placed on the boundaries of the blocks if they confine with other map blocks)
SBYTE Last Cell Z
WORD Last Cell New Graphic
if( # boundary blocks>1)
for each boundary block
BYTE Unkk1
BYTE 0
BYTE Relative Direction
SBYTE Last Cell Z
WORD Last Cell type of terrain
end for
endif
Relative Direction is one of this values:
1 2 7
----------
| |
| Map |
0 | Block | 3
| |
| |
----------
6 5 4
for StaticTile:
WORD Graphic
BYTES(2) UnkS
SBYTE Z
BYTE UnkS2
if( # static blocks>1)
for each static block
BYTES(3) 0
WORD Graphic
BYTES(2) Unk (seems always 0)
SBYTE Z
WORD Color ( Last byte overlaps next elem byte)
end for
endif
File EOF is 0x00 0x00 0x00