N2 3DO FILE STRUCTURE ************************* You must use the DOC that I wrote for N1/ICR2 3DO files, as reference to understand the new flavor structures! The file has four parts: HEADER, VERTICES, NEEDED FILES and FLAVORS. PART ONE: HEADER ================== The header holds the information related to the body's contents. LONG PURPOSE VALUE ------------------------------------------------------------------ 1 File ID 4 ( 3 O D 3)asc 2 File version 4 ( 0)dec 3 Body size 4 File length - 12 ------------------------------------------------------------------ PART TWO: VERTICES ==================== Following the HEADER, there are all vertex definitions LONG PURPOSE VALUE ------------------------------------------------------------------ 1 Part ID 4 ( P E R P)asc 2 Version 4 ( 0)dec 3 Data size for vertices 4 16 * [number of vertices] 4-N Vertex definitions ------------------------------------------------------------------ The vertex definitions have all the same format (no matter if is used for a textured polygon or not) LONG PURPOSE ------------------- 1 Vertex ID 4 2 X Coord 4 3 Y Coord 4 4 Z Coord 4 ------------------- PART THREE: NEEDED FILES ========================== Following the VERTICES, the list of needed files are defined. Here the file tells which MIP/MI4, SRB and 3DO files are used. LONG PURPOSE VALUE ------------------------------------------------------------------ 1 Part ID 4 ( N R T S)asc 2 Version 4 0 3 Data size for file names 4 4-N File names 8 ------------------------------------------------------------------ The file names are each stored in no more than 8 bytes, a string will be any sequence of chars than ends in (00)hex. The size is counted until the appearance of the value (FF)hex at the end of the list. Usually extra chars (20)hex are added after it to fill the data size to have 4*X bytes in total. No order is required to list the files, so MIP, SRB and 3DO can appear anywhere. The type is defined by the way they're used by the flavors. PART FOUR: FLAVORS ==================== This part holds "flavors" and there is no special order for the ocurrence of flavors in a 3DO file. Just one thing is needed: any flavor called must have an offset minor to the caller flavor's offset. Each flavor allows the sim to define a particular property of the 3D object, a track 3DO file will need certain flavors, meanwhile trackside objects and cars will need other. The units used by the sim are: Coordinates: 1 unit = (1/500) inches Angles : 2147483648 units = 180 degrees Units related to track length or position are defined by the TRK file. Offsets are calculated from the long 4 in the header of this part. If a flavor doesn't need to call an offset, but its structure requires a call, the value will be set to -1. LONG PURPOSE VALUE ------------------------------------------------------------------ 1 Part ID 4 ( M I R P)asc 2 Version 4 0 3 Data size for flavors 4 4 Root's offset 4 5-N Flavor definitions ------------------------------------------------------------------ The different flavor I've found are: ----------------------------------------------------------------------------- Flavor #2 - Replaces the old Flavor #1 and #2 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (02 00 00 00 00)hex 06-09 Polygon type 10-13 Color 14-17 Number of vertices 18-X0 List of vertex IDs (long integers) X1-Y0 List of MIP coordinates (integers) Y1-Z0 List of values (long integers) --------------------------------------------------- The list of MIP coords appear only in polygons with type > 0 The list of values appear only in polygons with type = 3 Type 0: Plain polygon (no texture) Type 1: Textured Type 2: Textured Type 3: Double textured ----------------------------------------------------------------------------- Flavor #3 - Replaces the old Flavor #3 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (03 00 00 00 00)hex 06-09 ?? (00 00 00 00)hex 10-13 ?? (00 00 00 00)hex 14-17 Angle --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #4 - Replaces the old Flavor #11 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (04 00 00 00 00)hex 06-09 Number of flavor offsets 10-XX Flavor offsets --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #5 - Replaces the old Flavor #4 ----------------------------------------------------------------------------- Depending on the Mode value, this flavor has different structures BYTES PURPOSE (This is a placeholder for additional flavor calls) --------------------------------------------------- 01-05 Flavor ID (05 00 00 00 00)hex 06-09 Flavor offset 10-11 Mode (00 00)hex BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (05 00 00 00 00)hex 06-09 Flavor offset 10-11 Mode (00 00)hex 12-13 Number of values - 1 14-XX Values (integers) --------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (05 00 00 00 00)hex 06-09 Flavor offset 10-11 Mode (01 00)hex 12-13 Count (00 00)hex 14-17 Texture flag --------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (05 00 00 00 00)hex 06-09 Flavor offset 10-11 Mode (04 00)hex 12-13 Count (00 00)hex 14-17 Texture flag --------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (05 00 00 00 00)hex 06-09 Flavor offset 10-11 Mode (05 00)hex 12-13 Count (00 00)hex 14-17 File number (in the Needed Files list) 18-21 Texture flag --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #6 - Replaces the old Flavor #5 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (06 00 00 00 00)hex 06-09 Value #1 10-13 Value #2 14-17 Value #3 18-21 Value #4 22-25 Value #5 26-29 Flavor offset --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #7 - Replaces the old Flavor 6 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (07 00 00 00 00)hex 06-09 Value #1 10-13 Value #2 14-17 Value #3 18-21 Value #4 22-25 Value #5 26-29 Flavor offset 30-33 Flavor offset --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #8 - Replaces the old Flavor 9 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (08 00 00 00 00)hex 06-09 Value #1 10-13 Value #2 14-17 Value #3 18-21 Value #4 22-25 Value #5 26-29 Value #6 30-33 Flavor offset 34-37 Flavor offset 38-41 Flavor offset --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #9 - Replaces the old Flavor #7 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (09 00 00 00 00)hex 06-09 Value #1 10-13 Value #2 14-17 Value #3 18-21 Value #4 22-25 Value #5 26-29 Flavor offset 30-33 Flavor offset 34-37 Flavor offset --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #10 - Replaces the old Flavor #8 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (0A 00 00 00 00)hex 06-09 Value #1 10-13 Value #2 14-17 Value #3 18-21 Value #4 22-25 Value #5 26-29 Flavor offset 30-33 Flavor offset 34-37 Flavor offset F10 3 Offset 7 Val 1 12 Val 2 12 Val 3 12 Val 4 12 Val 5 12 Off 1 12 Off 2 12 Off 3 12 --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #11 - Replaces the old Flavor 10 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (0B 00 00 00 00)hex 06-09 Value #1 10-13 Value #2 14-17 Value #3 18-21 Value #4 22-25 Value #5 26-29 Flavor offset 30-33 Flavor offset --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #12 - Replaces the old Flavor 16 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (0C 00 00 00 00)hex 06-09 Flavor offset 10-13 Number offsets 14-XX List of offsets --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #13 - Replaces the old Flavor #15 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (0D 00 00 00 00)hex 5 06-09 X Coord 4 10-13 Y Coord 4 14-17 Z Coord 4 18-21 X Angle 4 22-25 Y Angle 4 26-29 Z Angle 4 30-33 Flag (00 00 01 00)hex 4 34-37 Flavor #14 offset 4 --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #14 New flavor. Define the 3DO file name from the Needed Files list ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (0E 00 00 00 00)hex 5 06-09 File number (in the Needed Files list) 4 10-13 Flag (00 00 00 00)hex 4 --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #15 - Replaces the old Flavor #12 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (0F 00 00 00 00)hex 06-09 Initial position 10-13 Right margin 14-17 Final position 18-21 Left margin --------------------------------------------------- ----------------------------------------------------------------------------- Flavor #16 - Replaces the old Flavor #17 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (10 00 00 00 00)hex 5 06-09 Number of positions 4 10-XX Positions 4*Number of Positions --------------------------------------------------- This flavor has a special use when used as index of all other F#16 ----------------------------------------------------------------------------- Flavor #17 - Replaces the old Flavor #13 ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (11 00 00 00 00)hex 06-09 Value #1 10-13 Value #2 14-17 Value #3 18-21 Number of records 22-XX Records --------------------------------------------------- Each record consists in two values: Value #1: Value Value #2: Flavor Offset ----------------------------------------------------------------------------- Flavor #21 - New Flavor ----------------------------------------------------------------------------- BYTES PURPOSE --------------------------------------------------- 01-05 Flavor ID (15 00 00 00 00)hex 06-09 Value #1 Always seems to be 0 10-13 Value #2 Color (s/f line, tire mark borders) 14-17 Value #3 # of values 18-21 Value #4 Value 22-25 Value #5 Value --------------------------------------------------- *************************************************************************** Last Updated: January 11, 1998