T
Tonberry
Guest
I post this as I got curious because of some comments by halkun about the WM for FF7 in the Q-Gears forum. I thought the structure wouldn't be too different to the FF9 WM, and it isn't. I didn't find much info about the WM, so excuse me if this is known.
I only looked into 'wm0.bot' in detail, but the other 'bot' and 'map' files seem to be similar, so there is specific information about 'wm0.bot' that maybe doesn't apply to the other files, but general info that applies to all.
This file defines the geometry for the WM (continents, island, etc.). It's divided in sections of 0xB800 bytes, each section representing a square(?) block of the map.
Each block is divided into 16 meshes arranged like this:
Code: [Select]
And each mesh is defined by a set of triangles, vertices and some other info I don't know what it is.
A block has this structure: (all pointers in bytes relative to offset 0 of block.)
Code: [Select]
The data for each mesh is independently compressed using LZSS, so the first 4 bytes are the size in bytes of the compressed data and the rest is the compressed data itself.
Once uncompressed, each mesh has this structure:
Code: [Select]
(Yes, I know, that's a lot of unknowns.)
Some of the unknowns in the triangle data must specify the texture and maybe some special effects on the textures. That should be easy to figure out by filtering those fields.
After the info of vertices come a structure that I don't know what it is, but the number of elements seems to be equal to the number of vertices. (I'll have to find one that doesn't have so many zeros.)
As in the FF9 WM, the definition of the blocks is repeated several times in the file, so maybe each block has a version that can be used depending on the parts of the game that were solved.
The WM has a width of 9 blocks and a height of 7 blocks (or 36x28 meshes.) Maybe I'm wrong by a row of water, but it's unlikely.
To render a correct version of the WM, I used the blocks defined every 4 blocks, starting from block 0. As an example:
Code: [Select]
That's a total of 63 blocks used, but the file has 332 blocks. I didn't check all the remaining 269 blocks, but I did a visual inspection of most of them and they seem to be repetitions of those 63 blocks. Maybe I'll do a binary comparison among similar blocks.
Hope this helps in some way with Q-Gears.
I only looked into 'wm0.bot' in detail, but the other 'bot' and 'map' files seem to be similar, so there is specific information about 'wm0.bot' that maybe doesn't apply to the other files, but general info that applies to all.
This file defines the geometry for the WM (continents, island, etc.). It's divided in sections of 0xB800 bytes, each section representing a square(?) block of the map.
Each block is divided into 16 meshes arranged like this:
Code: [Select]
Code:
+----+----+----+----+| 0 | 1 | 2 | 3 ||----+----+----+----|| 4 | 5 | 6 | 7 ||----+----+----+----|| 8 | 9 | 10 | 11 ||----+----+----+----|| 12 | 13 | 14 | 15 ||----+----+----+----|
A block has this structure: (all pointers in bytes relative to offset 0 of block.)
Code: [Select]
Code:
(4 bytes) Pointer to compressed data for mesh 0.(4 bytes) Pointer to compressed data for mesh 1....(4 bytes) Pointer to compressed data for mesh 15.(variable size) Compressed data for mesh 0.(variable size) Compressed data for mesh 1....(variable size) Compressed data for mesh 15.
Once uncompressed, each mesh has this structure:
Code: [Select]
Code:
(2 bytes) Number of triangles.(2 bytes) Number of vertices.Start of triangle data: (1 byte) Index of vertex 0 of triangle. (1 byte) Index of vertex 1 of triangle. (1 byte) Index of vertex 2 of triangle. (1 byte) Unknown. (1 byte) Coordinate u in texture for vertex 0. (1 byte) Coordinate v in texture for vertex 0. (1 byte) Coordinate u in texture for vertex 1. (1 byte) Coordinate v in texture for vertex 1. (1 byte) Coordinate u in texture for vertex 2. (1 byte) Coordinate v in texture for fertex 2. (2 bytes) Unknown. ... (Repeat for each triangle.)Start of vertex data: (2 bytes) Coordinate x of vertex. (2 bytes) Coordinate y of vertex. (Signed.) (2 bytes) Coordinate z of vertex. (2 bytes) Unknown. ... (Repeat for each vertex.)Start of unknown data: (related to vertices?) (2 bytes) Unknown. (2 bytes) Unknown. (2 bytes) Unknown. (2 bytes) Unknown. ... (Repeat for each vertex.)
Some of the unknowns in the triangle data must specify the texture and maybe some special effects on the textures. That should be easy to figure out by filtering those fields.
After the info of vertices come a structure that I don't know what it is, but the number of elements seems to be equal to the number of vertices. (I'll have to find one that doesn't have so many zeros.)
As in the FF9 WM, the definition of the blocks is repeated several times in the file, so maybe each block has a version that can be used depending on the parts of the game that were solved.
The WM has a width of 9 blocks and a height of 7 blocks (or 36x28 meshes.) Maybe I'm wrong by a row of water, but it's unlikely.
To render a correct version of the WM, I used the blocks defined every 4 blocks, starting from block 0. As an example:
Code: [Select]
Code:
0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68... ... ... ... ... ... ... ... ...216 220 224 228 232 236 240 244 248
Hope this helps in some way with Q-Gears.