<pre>
 
<pre>
 
struct chunk_header {
 
struct chunk_header {
   u8  unk1[24];
+
   f32 map_offset_x; // (val - 6)/12
 +
  f32 unk1_1;
 +
  f32 map_offset_z; // (val - 6)/12
 +
  f32 unk1_2;
 +
  f32 unk1[7];
 
   u16 n_tiles;      // #tiles within chunk
 
   u16 n_tiles;      // #tiles within chunk
 
   u8  unk2, unk3;
 
   u8  unk2, unk3;
 
};
 
};
 
</pre>
 
</pre>
 +
 +
The ''map_offset_x'' and ''map_offset_z'' fields warrant some explanation: the map editor allows you to shift the whole map around, and instead of updating all tiles individually, these chunk-wide settings get changed.  Actors' coordinates are updated, and are not affected by this offset. Whenever tiles get read, a tile that has stored location ''(x, z)'' effectively ends up at ''(x + map_offset_x, z + map_offset_z)'' instead.  Why are they floats, you say?  No idea.
    
=== Object table ===
 
=== Object table ===
    
== Tile data ==
 
== Tile data ==
The number of tiles in the tile data section is the sum of ''n_tiles'' for all chunks. Presumably the tiles are assigned to chunks in the order they appear, so the first ''chunk[0].header.n_tiles'' chunks belong to chunk 0, etc.
+
The number of tiles in the tile data section is the sum of ''n_tiles'' for all chunks. Presumably the tiles are assigned to chunks in the order they appear, so the first ''chunk[0].header.n_tiles'' tiles belong to chunk 0, etc.
    
<pre>
 
<pre>
    
struct map_tile {
 
struct map_tile {
Exception encountered, of type "Error"