Field File Section 5: Walkmesh - niemasd/PyFF7 GitHub Wiki

The Walkmesh "is a mesh of polygons on which characters move, telling the engine for example how high it is, and using this the character can, for example, cross bridges with the real feeling that in the middle he is at a higher place than on the sides." This wiki is a useful reference for the Walkmesh section.

4 bytes: Section Length

  • This is a 4-byte unsigned integer denoting the total length (in bytes) of this section

Section Header

4 bytes: Number of Sectors

  • This is a 4-byte unsigned integer denoting the total number of sectors in this Walkmesh

Sector Pool

"The pool consists of sectors, which are in fact triangles, each with their vertices position. For each sector there are 3 vertices. Res is always equal to v[0].z (it is just a padding value). The polygons are 'wound' clockwise, this makes determining if a point is within a triangle easier" (see this wiki). Each item in the sector pool is a triangle of 3 vertices. For each sector (see Number of Sectors):

Sector Pool Triangle

Each triangle in the sector pool has 3 vertices. Each vertex consists of 4 2-byte signed integers denoting the vector (x,y,z,res) (where res seems to be some form of padding). In other words, each vertex of of the triangle is 4 * 2 = 8 bytes, so each triangle is 3 * 8 = 24 bytes.

Access Pool

"The access pool is an array of access data (ID's of triangles in the Mesh) in the mesh, the ID is the triangle you should be in if you cross that edge, where access1 is for line from vertex 0 to 1, access2 is for line from vertex 1 to 2, and access3 is for line from vertex 2 to 0. If the edge value is 0xFFFF, than this edge cannot be crossed (it's blocked). The access pool and sector pool have the same number of entries, thus you use the same index value for both pools of data to access the data for the same triangle. The access data merely informs one that if the PC object crosses this line the object should be in the indentified triangle. FF7 will halt running if you are not in the access specified triangle." For each sector (see Number of Sectors):

Access Pool Vector

Each vector in the access pool consists of 3 2-byte signed intgers denoting the vector (access1, access2, access3). In other words, each vector in the access pool is 8 bytes.