Jump to content

Collision map file: Difference between revisions

no edit summary
(Created page with "Map files are stored in directory id_low = 0xd710, id_high = 0x9305 in the Master file table. They contain the gameplay relevant details of a map. This includes heights, collision data, event triggers, and so on. They do *not* include graphics (tile sets, tile maps, palettes, etc.), those are stored elsewhere (''TODO'': Where?). Most (all?) maps are stored LZ77 (<code>swi 0x11</code>) compressed. When loading a map, the game checks if the map file starts with the AS...")
 
No edit summary
Line 68: Line 68:
* ''tile.obj'': This determines the sprite that is used to occlude Django when he should be covered by the tile. Purely visual. 0 = default, other values need to be documented.
* ''tile.obj'': This determines the sprite that is used to occlude Django when he should be covered by the tile. Purely visual. 0 = default, other values need to be documented.
* ''tile.height'': A tile is only accessible to Django if he's either coming from a tile at the same height, or coming via a suitable stair tile.
* ''tile.height'': A tile is only accessible to Django if he's either coming from a tile at the same height, or coming via a suitable stair tile.
= Zone data =
Zones are triggers for events (cutscenes, loading zones, etc.). The map file only defines the geometry of each zone. Behaviour is linked to zones by scripts (using the [[Bytecode#Control 0xd4cb|ctrl 0xd4cb]] instruction). Zone boundaries are more precise than tile boundaries: A tile is 256x256 units in size, and tile boundaries can start/end at any point within a tile).
<syntaxhighlight lang="c">
struct zone_data {
  u8 count;
  u8 unknown_1;
  u16 unknown_2;
  zone[count] zones;
};
struct zone {
  // X/Y coordinates: 1 tile = 256 units
  i16 start_x;
  i16 start_y;
  i16 end_x;
  i16 end_y;
  // Z coordinate: 1 tile = 16 units
  i8 start_z;
  i8 end_z;
  // Used by scripts to link behaviour to a specific zone using its ID
  u16 id;
};
</syntaxhighlight>
= Unknown block 1 =
= Unknown block 2 =


[[Category:Documentation]] [[Category:File formats]]
[[Category:Documentation]] [[Category:File formats]]
[[Category:Boktai 1]] [[Category:Boktai 2]] [[Category:Boktai 3]]
[[Category:Boktai 1]] [[Category:Boktai 2]] [[Category:Boktai 3]]