DO/BTB

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(OVERALL FILE STRUCTURE)
Line 1: Line 1:
-
== BUILDING BLOCKS ==
+
== Building Blocks ==
The BTB file consists of chunks of the form:
The BTB file consists of chunks of the form:
Line 19: Line 19:
When coordinates are referenced in the BTB file, divide them by eight to get into the same coordinates as the terrain mesh.
When coordinates are referenced in the BTB file, divide them by eight to get into the same coordinates as the terrain mesh.
-
== OVERALL FILE STRUCTURE ==
+
== Overall File Structure ==
The observed format of the BTB files in Dark Omen follows in order:
The observed format of the BTB files in Dark Omen follows in order:
Line 40: Line 40:
  START/END CHUNK, type=0xBEAFEED0, size=0
  START/END CHUNK, type=0xBEAFEED0, size=0
-
== CHUNK DESCRIPTIONS ==
+
== Chunk Descriptions ==
-
=== START/END CHUNK ===
+
=== Start/End Chunk ===
This chunk is just a marker of the start/end of the file; it contains no data
This chunk is just a marker of the start/end of the file; it contains no data
Line 49: Line 49:
----
----
-
=== HEADER CHUNK ===
+
=== Header Chunk ===
  HEADER CHUNK, type=0, size=240
  HEADER CHUNK, type=0, size=240
Line 64: Line 64:
----
----
-
=== UNKNOWN CHUNK ===
+
=== Unknown Chunk ===
This chunk is made up of several 3-tuples, which contain unknown data
This chunk is made up of several 3-tuples, which contain unknown data
Line 79: Line 79:
----
----
-
=== OBSTACLES CHUNK ===
+
=== Obstacles Chunk ===
This chunk seems to contain information about obstacles on the map (e.g. trees)
This chunk seems to contain information about obstacles on the map (e.g. trees)
Line 110: Line 110:
----
----
-
=== REGION CHUNK ===
+
=== Region Chunk ===
This chunk contains information which delimits an area or path.  It primarily consists of a list of line segments which define the path or polygon.  These areas and paths seem to be used for a variety of reasons, some of which are listed below.
This chunk contains information which delimits an area or path.  It primarily consists of a list of line segments which define the path or polygon.  These areas and paths seem to be used for a variety of reasons, some of which are listed below.
Line 128: Line 128:
----
----
-
=== GAME OBJECTS CHUNK ===
+
=== Game Objects Chunk ===
This chunk seems to hold a lot of the game-related info, for example initial enemy deployment, triggers for mission events, movement targets for the enemy AI.
This chunk seems to hold a lot of the game-related info, for example initial enemy deployment, triggers for mission events, movement targets for the enemy AI.

Revision as of 17:00, 12 May 2008

Contents

Building Blocks

The BTB file consists of chunks of the form:

struct CHUNK_HEADER
{
  unsigned int chunkType;
  unsigned int chunkSize; // excluding header
};

Each chunk consists of 'records' which are similar to chunks, but the record size is inclusive of the header.

struct RECORD_HEADER
{
  unsigned int recordType;
  unsigned int recordSize; // including header
};

When coordinates are referenced in the BTB file, divide them by eight to get into the same coordinates as the terrain mesh.

Overall File Structure

The observed format of the BTB files in Dark Omen follows in order:

START/END CHUNK, type=0xBEAFEED0, size=0

HEADER CHUNK, type=0, size=240
UNKNOWN CHUNK, type=1, size=<varies>
OBSTACLES CHUNK, type=2, size=<varies>
   
REGION CHUNK 0, type=3, size=<varies>
REGION CHUNK 1, type=3, size=<varies>
.
.
.
REGION CHUNK n, type=3, size=<varies>
   
GAME OBJECT CHUNK, type=4, size=<varies>

START/END CHUNK, type=0xBEAFEED0, size=0

Chunk Descriptions

Start/End Chunk

This chunk is just a marker of the start/end of the file; it contains no data



Header Chunk

HEADER CHUNK, type=0, size=240
   INTEGER RECORD (Map width) type=1, size=12
   INTEGER RECORD (Map height) type=2, size=12
   STRING RECORD (Mercenary Army file name without extension) type=1001, size=40
   STRING RECORD (Enemy Army file name without extension) type=1002, size=40
   STRING RECORD (CTL filename without extension) type=1003, size=40
   STRING RECORD ("/0") type=1004, size=40
   STRING RECORD ("/0") type=1005, size=40
   2-TUPLE RECORD ( [Number of Regions in file, Number of line segments in all regions] ) type=9, size=16



Unknown Chunk

This chunk is made up of several 3-tuples, which contain unknown data

UNKNOWN CHUNK, type=2, size=<varies>
   3-TUPLE RECORD 0 (unknown) type=3, size=20
   3-TUPLE RECORD 1 (unknown) type=3, size=20 
   .
   .
   .
   3-TUPLE RECORD n (unknown) type=3, size=20



Obstacles Chunk

This chunk seems to contain information about obstacles on the map (e.g. trees)

OBSTACLES CHUNK, type=3, size=<varies>
   INTEGER RECORD (unknown) type=8, size=12

   COMPOUND RECORD 0 (contains sub-records) type=501, size=80
      INTEGER RECORD (type of obstacle - might be bit flags - see table below) type=5, size=12
      INTEGER RECORD (x position) type=1, size=12
      INTEGER RECORD (y position) type=2, size=12
      INTEGER RECORD (unknown) type=4, size=12
      INTEGER RECORD (radius of area) type=6, size=12
      INTEGER RECORD (unknown - normally 0) type=7, size=12
   COMPOUND RECORD 1 (contains sub-records) type=501, size=80
   .
   .
   .
   COMPOUND RECORD n (contains sub-records) type=501, size=80
Type Description
3 This obstacle blocks movement into its area
5 This obstacle blocks movement and projectiles into its area



Region Chunk

This chunk contains information which delimits an area or path. It primarily consists of a list of line segments which define the path or polygon. These areas and paths seem to be used for a variety of reasons, some of which are listed below.

REGION CHUNK, type=4, size=<varies>
   STRING RECORD (the human-readable name of the region) type=1006, size=40
   INTEGER RECORD (type code - might be bit flags - see table below) type=5, size=12
   2-TUPLE RECORD ([starting X position, starting Y position]) type=10, size=16
   4-TUPLE RECORD 0 ([ line start X, line start Y, line end X, line end Y]) type=502, size=24
   4-TUPLE RECORD 1 ([ line start X, line start Y, line end X, line end Y]) type=502, size=24
   .
   .
   .
   4-TUPLE RECORD n ([ line start X, line start Y, line end X, line end Y]) type=502, size=24



Game Objects Chunk

This chunk seems to hold a lot of the game-related info, for example initial enemy deployment, triggers for mission events, movement targets for the enemy AI.

GAME OBJECTS CHUNK, type=5, size=<varies>
   INTEGER RECORD (the number of game object compound records in this chunk) type=8, size=12

   COMPOUND RECORD 0 (contains sub-records and represents a game object) type=503, size=104
      INTEGER RECORD (type of game object - might be bit flags - see table below) type=5, size=12
      INTEGER RECORD (x position) type=1, size=12
      INTEGER RECORD (y position) type=2, size=12
      INTEGER RECORD (radius of area) type=6, size=12
      INTEGER RECORD (unknown) type=7, size=12
      INTEGER RECORD (unknown) type=11, size=12
      INTEGER RECORD (unknown for some types) type=12, size=12
      INTEGER RECORD (unknown) type=13, size=12
   COMPOUND RECORD 1 (contains sub-records and represents a game object) type=503, size=104
   .
   .
   .
   COMPOUND RECORD n (contains sub-records and represents a game object) type=503, size=104
Personal tools
communication