3DO FILE STRUCTURE ******************** This document contains all information I've retrieved from 3DO files in the last several years. There are not many unsolved mysteries any longer as we have worked hard to understand the formats. The 3DO file format is used by Papyrus' racing simulators to hold information about 3D objects. These files have changed in N2, so this description is only valid for ICR, ICR2 and N1. If you want to understand how 3DOs work, you must imagine how the SIM is reading the file, that is, if you can reproduce the steps and understand what's expected to happen, you will be able to create 3DOs from scratch. Since we're not able to do it yet, we're only capable of modify some properties on the 3DOs, like: vertices, colors and object positions. I'm working on other documents to explain how to create .3do files from scratch, so use this one as a "reference guide". * STRUCTURE ***************************************************************** Each 3DO has the same structure: Header and Body. Before starting to explain them I must introduce the "tree" data structure, because you need to imagine the whole file. The tree is created meanwhile the SIM is reading the file, so if you draw the sequence of calls to flavors you'll have something like this: [16] 1) The SIM calls the F#16 |-[11] 2) The F#16 calls one F#11 and two F#15 | |-[4] 3) The F#11 calls one F#4 | |-[2] 4) The F#4 calls one F#2 | |-[0] 5) The F#2 calls three F#0 | |-[0] | |-[0] [16] is the "root" of the tree |-[15] |-[15] THE HEADER ============ The header holds the information related to the body's contents. BYTE PURPOSE ------------------------------------------------------------------ 00-03 body's size (filesize - length of header) 04-07 root's offset 08-11 number of MIP files used by this 3DO file 12-15 number of PMP files used by this 3DO file 16-19 number of 3DO files used by this 3DO file 20-XX file names (XX is 19 + 8*number of files) The file names are each stored in 8 bytes, left-justified, with value (00)hex being used to fill in any extra space at the end. The file extension is not given inside the 3DO file, instead, the extensions MIP, PMP, and 3DO are assumed for their respective file types. All MIP files are listed first, followed my all of the PMP files, followed finally by all of the 3DO files. THE BODY ========== The body 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. There are two types of Flavor #0, one for regular polygons, and one for texture-mapped polygons. The texture-mapped polygons also have an x and y extra coordinates defined for the location within the MIP image that this vertex corresponds to. 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. All numeric values are stored as long integers, except the X and Y MIP coordinates from the Flavor #0. Offsets are calculated from the end of the header, and start in zero. If a flavor doesn't need to call an offset, but its structure requires a call, the value will be set to zero. ----------------------------------------------------------------------------- Flavor #0 - Vertex Tracks - Objects - Cars ----------------------------------------------------------------------------- It defines a point in the 3D space. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (00 00 00 00) 2 X-Coordinate 3 Y-Coordinate 4 Z-Coordinate 5(*) Corresponding X-Coordinate in MIP Image (both optional) 5(*) Corresponding Y-Coordinate in MIP Image (both optional) (*) These values are 2 bytes integers ----------------------------------------------------------------------------- Flavor #1 - Plain Polygon Tracks - Objects - Cars ----------------------------------------------------------------------------- Defines a n-sides plain polygon. The SIM allows the definition of non-plane polygons but it will make them look strange. LONG PURPOSE N = 4 + (LONG 3) ------------------------------------------------------------------ 1 Flavor Flag (01 00 00 80) 2 Color 3 Number of Vertices 4-N Flavor Offsets Color Specifies the color used to fill this polygon. Vertex of Vertices Is a value that contains the number of vertices used to construct this polygon minus one. Flavor Offsets List of Flavor #0 offsets. ----------------------------------------------------------------------------- Flavor #2 - Textured Polygon Tracks - Objects - Cars ----------------------------------------------------------------------------- Defines a n-sides textured polygon. The SIM allows the definition of non-plane polygons but it will make them look strange. LONG PURPOSE N = 5 + (LONG 3) ------------------------------------------------------------------ 1 Flavor Flag (02 00 00 80) 2 Texture Flag 3 Color 4 Number of Vertices 5-N Flavor Offsets Color Specifies the color used to fill this polygon. Number of Vertices Is a value that contains the number of vertices used to construct this polygon minus one. Flavor Offsets List of Flavor #0 (with additional X,Y MIP values) offsets. Texture Flag If this flag is non-zero, the texture will be used when the polygon is drawn. If this flag is zero, the texture will not be used when the polygon is drawn, and the value specified in Color will be used to fill the polygon instead. The Sim uses this flag to recognize the texture in order to set it on/off depending on the user's preferences. 1 = Asphalt/Concrete 2 = Grass/Dirt 4 = Wall 8 = Trackside Object 16 = Car Decals 32 = Horizont 64 = Grandstand ----------------------------------------------------------------------------- Flavor #3 - PMP Properties Objects - Cars ----------------------------------------------------------------------------- Defines the properties of a PMP object used in the 3DO file. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (03 00 00 80) 2 Value #1 3 Value #2 4 PMP Number PMP Number Specifies which PMP in this file the flavor is referring to, starting with zero for the first PMP listed in the header. Value #1 #2 ?? So the entire structure of a file using this is as follows: 64-16-0-1-0 (whereby each number represents a long). Object name (is 2 longs) 0-0-0-0 (again each number represents a long) call 0 (value 1) ? (value 2) 0 (mip call) Value 1 crashes the sim if a value other than 0 Value 2 seems to set the x-y-z (size) of the object. X-Y-Z is not a proper definition for this either. Size if a more appropriate definition. Values I've seen are 186000, 210000, 240000, 332000, 550000, 770000. How this value is set is not known. Could be in Papy units (1/500"). The larger the number, the larger the object. DO NOT USE THE DEF PROGRAM TO RECOMPILE A PMP 3DO ObJECT !!! ----------------------------------------------------------------------------- Flavor #4 - MIP Properties Tracks - Objects - Cars ----------------------------------------------------------------------------- Defines the properties of a MIP object used in the 3DO file. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (04 00 00 80) 2 MIP Number 3 Color 4 Flavor Offset MIP Number Specifies which MIP in this file the flavor is referring to, starting with zero for the first MIP listed in the header. Flavor Offset Call to a Flavor #2, #7, #8 or #11 offset. Color This option seems to only affect rendition cards with the anti aliasing option turned on. Basically flavor 4 outlines the mip with the color that is specified. If the color doesnt match you will have odd miscolored lines running along polygons. ----------------------------------------------------------------------------- Flavor #5 - Polygon Properties Objects ----------------------------------------------------------------------------- This flavor seems to apply some kind of properties over the polygons drawn in the objects. The structure is the same in Flavor #7. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (05 00 00 80) 2 Value #1 3 Value #2 4 Value #3 5,6 Value #4 (This is an 8 byte long) 7 Flavor Offset Flavor Offset Call to a Flavor #1 or Flavor #2 offset. Flavor 5 is called from Flavor 7 and is an end flavor to the tree. Flavor 5 is Used as an end value. It calls the last texture or non-textured area to be drawn. Calculating Values: 1) Find 3 points on the plane. The 3 points are often defined as the first three called from a Flavor 1 or Flavor 2 2) Calculate Vector 1 and Vector 2 Vector 1 = X2-X1, Y2-Y1, Z2-Z1 Vector 2 = X3-X1, Y3-Y1, Z3-Z1 3) Calculate A,B,C,D (4 values of Flavor 7) A = ((Y2-Y1)*(Z3-Z1))-((Z2-Z1)*(Y3-Y1)) B = ((Z2-Z1)*(X3-X1))-((X2-X1)*(Z3-Z1)) C = ((X2-X1)*(Y3-Y1))-((Y2-Y1)*(X3-X1)) D = -Ax - By - Cz Final Values should fit this formula: Ax+By+Cz+D = 0 Sample Trees look like this: 7 - 5 - 1 7 - 5 - 2 ----------------------------------------------------------------------------- Flavor #6 - Two Sided Cars - Objects ----------------------------------------------------------------------------- This flavor is used to change the PMP image depending on the viewer's position. It is also used to draw objects that need to be viewed from 2 sides. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (06 00 00 80) 2 Value #1 3 Value #2 4 Value #3 5 Value #4 6 Value #5 7 Flavor Offset #1 8 Flavor Offset #2 Flavor Offset #1 #2 Call to a Flavor #6, #11, #1 or #2 offset. May also call a Flavor 3. Value #1 #2 #3 #4 #5 ?? Used to call textures and non-textures in objects that have two viewable sides opposite each other. It appears to be an end value to the tree called from a flavor 9. Therefore it's purpose is somewhat similar to Flavor 5. ----------------------------------------------------------------------------- Flavor #7 - Polygon Properties Objects ----------------------------------------------------------------------------- This flavor seems to apply some kind of properties over the polygons drawn in the objects. The structure is the same in Flavor #5. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (07 00 00 80) 2 Value #1 3 Value #2 4 Value #3 5,6 Value #4 (This is an 8 byte long integer) 7 Flavor Offset #1 8 Flavor Offset #2 9 Flavor Offset #3 Flavor Offset #1 Call to a Flavor null value (0), #7, #5, OR #6 offset. Flavor Offset #2 Call to a Flavor #7 or #5 offset. If near the end of a tree this can also call to 0. Flavor Offset #3 Call to a Flavor #1, #2 or #11 offset. Used to call textures and non-textures in objects. Sample trees: 7 | 0 7 1 | 0 5 1 | 1 7 | 0 7 2 | 0 5 2 | 2 7 | 6 5 2 | | 1 1 2 7 | 0 7 1 | 0 5 2 | 1 Calculating Values: 1) Find 3 points on the plane. The 3 points are often defined as the first three called from a Flavor 1 or Flavor 2 2) Calculate Vector 1 and Vector 2 Vector 1 = X2-X1, Y2-Y1, Z2-Z1 Vector 2 = X3-X1, Y3-Y1, Z3-Z1 3) Calculate A,B,C,D (4 values of Flavor 7) A = ((Y2-Y1)*(Z3-Z1))-((Z2-Z1)*(Y3-Y1)) B = ((Z2-Z1)*(X3-X1))-((X2-X1)*(Z3-Z1)) C = ((X2-X1)*(Y3-Y1))-((Y2-Y1)*(X3-X1)) D = -Ax - By - Cz Final Values should fit this formula: Ax+By+Cz+D = 0 ----------------------------------------------------------------------------- Flavor #8 - 3DO Properties Tracks - Objects ----------------------------------------------------------------------------- I don't know what's this flavor for, but I think it defines some properties over the objects drawn in the track when the driver is at certain position. LONG PURPOSE ---- ------- 00-03 Flavor Flag (08 00 00 80) 04-07 Value #1 08-11 Value #2 12-15 Value #3 16-23 Value #4 (This is an 8 byte long) 24-27 Flavor Offset #1 28-31 Flavor Offset #2 32-35 Flavor Offset #3 Flavor Offset #1 #2 #3 We have found calls to Flavor #1, #7, #8, #11, #12 and #15 offsets. Used to call textures and non-textures in tracks and objects. Seems to use two sides of the 3do? Calculating Values: 1) Find 3 points on the plane. The 3 points are often defined as the first three called from a Flavor 1 or Flavor 2. 2) Calculate Vector 1 and Vector 2 Vector 1 = X2-X1, Y2-Y1, Z2-Z1 Vector 2 = X3-X1, Y3-Y1, Z3-Z1 3) Calculate A,B,C,D (4 values of Flavor 7) A = ((Y2-Y1)*(Z3-Z1))-((Z2-Z1)*(Y3-Y1)) B = ((Z2-Z1)*(X3-X1))-((X2-X1)*(Z3-Z1)) C = ((X2-X1)*(Y3-Y1))-((Y2-Y1)*(X3-X1)) D = -Ax - By - Cz Final Values should fit this formula: Ax+By+Cz+D = 0 ----------------------------------------------------------------------------- Flavor #9 - ?? Cars ----------------------------------------------------------------------------- No idea. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (09 00 00 80) 2 Value #1 3 Value #2 4 Value #3 5 Value #4 6 Value #5 7 Value #6 8 Flavor Offset #1 9 Flavor Offset #2 10 Flavor Offset #3 Flavor Offset #1 #2 #3 I have found calls to Flavor #1, #6, #9 and #11 offsets. Value #1 #2 #3 #4 #5 #6 ?? Not sure? Calls non-textured areas in the 3do from 4 different points. Seems to be associated with the Flavor 6 since 6 is used as the end to a tree. I haven't checked to see if they are object parts that are viewable from two sides. I do not believe Flavor 9 has 6 values. I believe instead that it has 4 values (similar to flavor 5,7,8) and that it has 4 calls. The structure I believe it has is below: 1 Flavor Flag (09 00 00 80) 2 Value #1 3 Value #2 4 Value #3 5-6 Value #4 7 Flavor Offset #1 8 Flavor Offset #2 9 Flavor Offset #3 10 Flavor Offset #4 ----------------------------------------------------------------------------- Flavor #10 - Object Properties Objects - Cars ----------------------------------------------------------------------------- No idea. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (0A 00 00 80) 2 Value #1 3 Value #2 4 Value #3 5 Value #4 6 Value #5 7 Flavor Offset #1 8 Flavor Offset #2 Flavor Offset #1 #2 I have found calls to Flavor #10 and #7 offsets. Value #1 #2 #3 #4 #5 ?? Used to call objects in objects and cars. It will also call textures and non-textures through additional flavors in the tree. ----------------------------------------------------------------------------- Flavor #11 - Flavor Group Tracks - Objects - Cars ----------------------------------------------------------------------------- Form a group of flavors to apply a property over them. LONG PURPOSE N = 2 + (LONG 2) ------------------------------------------------------------------ 1 Flavor Flag (0B 00 00 80) 2 Group Number 3-N Flavor Offsets Group Number Number of Flavors that will form the group. Flavor Offsets List of flavor offsets. ----------------------------------------------------------------------------- Flavor #12 - Car Zone Tracks ----------------------------------------------------------------------------- Determines the extremes of the track (left-right) where the cars are drawn, depending on the track position. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (0C 00 00 80) 2 Initial Position 3 Final Position 4 Left Margin 5 Rigth Margin Initial Position Value in the range 0 - (track length) where this zone starts, and at points is related to the sector values in the TRK file. * Final Position Value in the range 0 - (track length) where this zone ends, and at points is related to the sector values in the TRK file. * Left Margin Track Position (width) where this zone starts, related to sector values in the TRK file. Rigth Margin Track Position (width) where this zone ends, related to the sector values in the TRK file. * ---In the trk file, on a straight section, the trk will describe one section, whereas in the 3do, it will divide the large section up into smaller ones. this is why the initial position values will not always have a match in the trk file. rest assured that the beginning of straights and the end of straights will share the same values with the trk file. The beginning value of F12 also relates to flavor 17. flavor 12 is a flag, telling the sim where to turn things on. 1st call - textured sections. relatively close in front 2nd call - flavor 1's - mid distance 3rd call - flavor 1's - far. ----------------------------------------------------------------------------- Flavor #13 - Resolution Objects - Cars ----------------------------------------------------------------------------- This flavor has a dynamic structure, the first value doesn't specify the number of longs to read. Sets the hi-med-lo resolution calls and values. It has 3 parts (hi-med-lo) Each part of flavor 13 can be subdivided into 2 4 byte integers. The first is the value of the resolution. The second is the call to the object tree. Flavor 13 is used as a root to a tree. It will call flavors, 6,7,8,9 or 10. How to set the resolution values is not known. If the tree calls textured areas, the Flavor 13 normally calls Flavor 4's. A Flavor 13 creates 8 identical trees of the object ! It is assumed this occurs (through the use of Flavor's 9,10,11) for each different resolution. But not certain since the trees seem to begin identical calls from the flavor 10's and 11's. At least two of the trees contain only calls to Flavor 1's from a Flavor 11. ----------------------------------------------------------------------------- Flavor #14 - Color Redefinition Cars ----------------------------------------------------------------------------- This flavor appears only in the files .3do, is used by the paintkit to specify the user defined colors. LONG PURPOSE N = 2 + 2*(LONG 2) ------------------------------------------------------------------ 1 Flavor Flag (0E 00 00 80) 2 Record Number 3-N Redefinition Records Record Number Specifies the number of following records. Redefinition Records Correspond to a pair of values: First value -> Original color number. Second value -> New assigned color number. ----------------------------------------------------------------------------- Flavor #15 - 3DO Placement Tracks - Cars ----------------------------------------------------------------------------- This flavor is used to specify the location and orientation of a 3DO object. LONG PURPOSE ------------------------------------------------------------------ 1 Flavor Flag (0F 00 00 80) 2 X-Coordinate 3 Y-Coordinate 4 Z-Coordinate 5 Z-Axis Orientation Angle 6 X-Axis Orientation Angle 7 Y-Axis Orientation Angle 8 3DO Number 3DO Number Specifies which 3DO in this file the flavor is referring to, starting with one for the first 3DO listed in the header. The values used here are negative. ----------------------------------------------------------------------------- Flavor #16 - 3D Objects Declaration Tracks - Cars ----------------------------------------------------------------------------- This flavor is usually the ROOT for 3DO files, it declares all 3D objects used by the 3DO file. LONG PURPOSE N = 3 + (LONG 3) ------------------------------------------------------------------ 1 Flavor Flag (10 00 00 80) 2 Next Flavor 3 Object Number 4-N Flavor Offsets Next Flavor Specifies the next flavor that the SIM must read to keep exploring the 3DO file. Object Number Defines the number of following offsets. Flavor Offsets Call to Flavor #15 offsets. ----------------------------------------------------------------------------- Flavor #17 - Track Location Tracks ----------------------------------------------------------------------------- This flavor is used in together with the Flavor #11 to specify the objects and part of the track that must be drawn when the driver is inside the range defined here. LONG PURPOSE ---- ------- 1 Flavor Flag (11 00 00 80) 2 Track Position 3 Track Position 4 Track Position 5 Track Position Track Position Is a value in the range 0 - (track length). Values can be repeated in a flavor. As far as I can tell, flavor 17's values are based on the initial position value in flavor 12. and when looking at flavor 17 you must also look at the flavor11 that accompanies the fl17. in that flavor 11 you will find a call to 7 offsets. Each offset calls to a particular section of track The first four offsets always call to four textured [T] sections of track, these four textured sections will always be the total section length divided by four. The 5th and 6th offsets called will each call to a section of plain polygons, each section is 1/2 of the total length of the section. The 7th and last offset will call to a set of plain polygons that stretch the entire length of the section. This creates the draw order, when you are driving, you will notice plain polygons being drawn off in the distance. The asscoiated fl11 will look like this (I've begun to refer to them as 11/17 because it is really a combination of the 2. F11 264123 127468 128412 87128 87128 127656 87128 126656 F17 246143 42634925 46817748 46817748 46817748 46817748 Ok, the 87128 line I threw in is actually f00, it is a null flavor, it tells the sim that nothing is needed in that position but to read on to the next. When writing values out for flavor 17 you can do it like this. If the flavor 11 has 7 offsets (NO null flavor calls) then all you have to do is trace each offset of the accompaning 11 back to its section, then take the initial position value of flavor12 as the 1st value of f17. then move to the 2nd offset of f11 and once again trace it back to its section, the initial pos value of f12 becomes the 2nd value of f17...etc etc. Now In the cases of having null flavors in there it gets a little more tricky. In the case of a line like this: f11 268111 199166 87128 87128 87128 199411 87128 199846 In the case of the f11 above you f17 would be pretty easy. All four values of f17 would use the initial pos value of the 1st textured section. In the case of a f11 that looked like this: f11 268111 199166 199228 87128 87128 199411 87128 199846 In a line like this the f17's 1st value would be the initial pos value of the first textured section, since there are only 2 textured sections being callex to the last 3 values of fl17 would use the initial pos value of the 2nd and last textured section..you will NEVER see a f17 with the values split like this: f17 270000 42634925 42634925 46811176 46811176 I've found that it always looks like this when only 2 textured sections are called to f17 270000 42634925 46811176 46711176 46811176 Also, I've never seen a flavor 11/17 that calls to 3 textured sections. always 1/2/4. usually in corners it will call one or 2, four for straight sections..this makes sense because you dont need as much track called in a turn... ***ROOT F11*** The root flavor 11 is very important when changing the distance in a track or removing sections of track. I dont know everything about this yet but I know enough to fake it I think. The root f11 always calls 122 offsets in its first mile, 121 for every mile after that. it is calling to 11/17 combo's and it groups the offsets it calls...straight sections are usually called 14 times in a row..If the root 11 is not right the track will not draw in properly, it will either draw in way in front / behind you but not where you are. BRIAN - ADD YOUR KNOWLEDGE HERE NOTES: Flavor 17 calls four values.(distance) which in turn applies properties over a flavor 11 which calls to 7 flavor 11's the following flavor 11's make calls to 1/2/4/8/skids/12's which define the section of track Its really easy actually! four distances to match f12, then the following 11 calls in this order 1 1st textured section (distance *1) 2 2nd textured section (distance *2) 3 3rd textured section (distance * 3) 4 4th textured section (distance *4) 5 1st section plain poly (distance *2) 6 2nd section plain poly (distance *4) 7 1st and only section plain poly (distance *4) ************************************************************************************************* *** OBJECTS *** ROOTS: A object may have a FL04, FL07, FL11, FL13 as the root. If a Flavor 11 is used the entire object cannot have any textured calls. A flavor 4 will generally call a flavor 7. The flavor 7 will then have for its calls 0,7 or 5, and 1 or 2. The ensuing 5 will call either a 1 or a 2. The number of nested 7's is dependent on the number of 1's and 2's that need to be called. Generally speaking, each 1 and 2 requires a separate level on the tree (unless called by a flavor 6 from a flavor 7). A 6 as I have seen it (when called from a 7) will call two 1's. A #6 appears to be used when calls are made to surfaces that are drawn on 2 sides (ie the msign.3do in ICR2 Nazareth)! TREES: I have defined some basic structures used in nearly all of the objects I have examined. They are: F11 | F1's (quite simple eh?). F04 F04 F04 | | | F07 F07 F07 | | | 0 5 2 6 5 2 0 7 2 | | | | 1 1 1 2 7 | 0 5 1 | 1 Notice, 2 branches beyond the root in the leftmost tree. 2 calls to textured and non-textured areas ! In the middle tree 2 #1's and 2 #2's are called from 2 tree levels. It should also be noted that the #1's and #2's are called from bottom up in the 3do file and will mirror the calls to the 7's, 6's and 5's (as in the rightmost 3do). Now turn the rightmost tree sideways and you see it better: = FL04 = FL07 = 0 = FL07 = 0 = FL07 = 0 = FL05 = FL01 (called last) = 60 = 24 = 44 = FL01 (called third) = 80 = 60 = 44 = 100 = FL01 (Called second) = 80 = 100 = 4 = FL02 (called first) = 60 = 80 = 4 = 24 Notice 4 branches, and 4 calls to 1's and 2's ! F04 | F11 | 1's and 2's Here, the 11 acts as a single branch calling all 1's and 2's. The calls are made 1's first followed by 2's in the 11 call. The easiest object to define is the one that calls a pmp. It's entire tree structure consists of a single call to a flavor 3. The structure of the flavor 3 is defined above. All objects are called counter-clockwise. Now, to be certain what I mean, the vertices are called in the 1's and 2's in a counter clockwise fashion. The object beginning at the root then draws counter-clockwise as well. ************************************************************************************************* TRACK.3DO STRUCTURE =================== Each piece of track is just a sequence of calls to draw something, if every object has the same priority, then the order how the objects are drawn will define which one appears over the others. >From the F11/F17 combination, pieces of track are called to be drawn, for each F17, the F11 call to seven pieces, depending on the circunstances, a null call will be used. The way F11/F17 are defined is a mystery. You can think about a logical way, I mean, call the pieces from the S/F line until you complete a entire lap. But, the sim defines around 2 laps starting from an intermediate point (of course, repeating the same F11/F17 for the same point of the track). As we know, the root flavor is F16, defining all trackside objects, and it calls to a F11. This first F11, call a second F11, and a group of F11/F17 that describes exactly 1 lap, starting from the S/F line. The strange thing is the fact that most of these calls are repeated several times. The second F11, call every F11/F17 combination defined in the file. There are no repeated calls. Now,let's work on the F11/F17 for the S/F line at DOVER. F11 156328 7 45572 47032 43892 43892 47504 43892 47944 F17 156364 0 1506796 1506796 1506796 I understand this: When the player's car is located between the range defined in values 1 - 4 of F17 (0 - 15066796), the pieces of track to be drawn are defined in offsets: 45572, 47032, 43892, 43892, 47504, 43892 and 47944. A good question is: Why define 4 values in F17 if I only need values 1 and 4? A possible answer is that you must combine the values, and each combination has associated one of the seven offsets. Unfortunately, very strange cases appear on F17, sometimes all four values are the same, or three are the same, or just all are different. Here are some examples: F11 157056 7 92364 43892 43892 43892 92716 43892 93036 F17 157092 12934959 12934959 12934959 12934959 F11 157336 7 104268 104892 105688 106312 107916 108236 109196 F17 157372 20536135 20734024 20931913 21129802 So, let's have a closer view: offset 43892 is a null flavor, then: Values in F17 Calls in F11 --------------------------------------- V1 V2 V3 V4 C1 C2 C3 C4 C5 C6 C7 V1 V2 V2 V2 C1 C2 -- -- C3 -- C4 V1 V1 V1 V1 C1 -- -- -- C2 -- C3 So, null calls are used in case of repeated values in F17, I tested this theory in all F11/F17 and worked, so I guess I can extend the table for other cases (*). Values in F17 Calls in F11 --------------------------------------- V1 V1 V1 V1 C1 -- -- -- C2 -- C3 V1 V2 V2 V2 C1 C2 -- -- C3 -- C4 V1 V2 V3 V3 C1 C2 C3 -- C4 -- C5 (*) V1 V2 V3 V4 C1 C2 C3 C4 C5 C6 C7 Now, what combinations will produce this table? PIECES OF TRACK =============== Well, going back to the F11/F17 for the S/F line, let's see the flavors called this time: 43892 -> Null flavor 45572 -> Track piece 47032 -> Track piece 47504 -> Track piece 47944 -> Track piece Now, I'll work with the track piece defined in 45572. This F11 defines all object drawn in this piece of track, following the order from left to right. The number of calls depends on the number of objects to draw. <-------- Asphalt --------> F04 F04 F04 F04 | | | | F11 45572 7 45536 44008 44064 44164 44252 44340 41092 | | | F08 F01 [Line] F11 [Skid Marks] Now, let's see this first F08: F08 45536 ... 45500 45392 45092 | | | F08 F11 F11 +-- F11 1464 4 984 1080 1016 504 [Trackside Objects] | F11 45392 2 43892 1464 | +-------- F00 43892 [Null Flavor] [Right Wall] F04 | F11 45092 9 44420 44480 44572 44632 44724 44784 44876 44936 45076 | | | | | | | | F01 F01 F01 F01 F01 F01 F01 F01 <---------------- Fences -------------------> Now, let's see the second F08: F08 45500 ... 45408 45464 45376 | | | F11 F08 F04 [Middle Wall] +- F11 1176 1 1144 [Trackside Objects] | F11 45408 2 43892 1176 | +-------- F00 43892 [Null Flavor] Now, let's see the third F08: F08 45464 ... 45424 45444 45248 | | | F12 F12 F04 [Left Wall] F12 45424 0 1506796 200000 458000 F12 45444 0 1506796 -228000 200000 Well, it's clear that F08 describes a relationship of "what's in the left, middle or right side", so the SIM can know the priorities of objects, depending on the place you're located at. In other words, the structure of the F08 is: Offset 1 -> Everything to the left of my position Offset 2 -> Everything in the same place of my position Offset 3 -> Everything to the right of my position Well, "my position" is the race lane. So, in this piece of track, we can read this: 1st F08 -> +--------------------+--------------+ | | | | (Fences/RWall) (Objects) 2nd F08 -> +----------+--+-------+ | | | (Objects) | (MWall) 3rd F08 -> +-----+-----+ | | | F12 F12 (LWall) Another idea, is that F12 defines the numeric boundaries for the F08, until now we believe that F12 defines the range where the player's car is drawn. To comple this research, then, I must take another piece of track, but this time it doesn't have to define part of the pit lane (only two walls). So let's take this one: <----- Asphalt -----> F04 F04 F04 | | | F11 55176 6 55140 54484 54520 54600 54688 41372 | | | F08 F01 [Line] F11 [Skid Marks] The first F08: F08 55140 ... 55104 55052 54944 | | | F08 F11 F11 +-- F11 1524 3 984 856 952 [Trackside Objects] | F11 55052 2 43892 1524 | +-------- F00 43892 [Null Flavor] F11 54944 3 54768 54828 54928 | | | F01 F01 F04 [Right Wall] [Fences] The second F08: F08 55104 ... 55068 55084 55036 | | | F11 F12 F04 [Left Wall] +-- F11 1208 0 [Trackside Objects] | F11 55068 2 43892 1208 | +-------- F00 43892 [Null Flavor] F12 55084 4788827 4958293 -288000 300000 Then, again we have the same structure of left..right position. 1st F08 -> +--------------------+--------------+ | | | | (Fences/RWall) (Objects) 2nd F08 -> +----------+--+-------+ | | | (Objects) F12 (LWall) THE VALUES FOR F08 ================== Now the hardest part to understand. We already discovered that F08 are required depending on the ammount of walls in the piece of track. And we also know that F08 define relative L/R location for objects. But what about the values?? In the first piece of track they're (straight): F08 45464 -4066092 -1977562746 -84299 1059781682 5522651 F08 45500 -4066092 -1977562746 -84299 -233721350 5403857 F08 45536 -5394205 -1945025594 -357454512 1435769587 5632807 And in the other piece they're (turn): F08 55104 873083739 -1342992642 -114803 -1998404423 2059268 F08 55140 985950005 -1537417015 -679877236 2118563645 2649677 The must define something about the viewer's point, but HOW? * SOME IDEAS **************************************************************** Flavor #9 or #10 must define the parts of the car to be drawn depending on the car damage. I doubt it. Flavor 9 is not used in the Damage.3do's. Flavor 10 appears only when objects are being called. This may be part of it, but there is much much more as well as noted above. Most of unknown values are angles, and just a few distances. Maybe looking at the MIRROR keywords in N2 .txt files we can find answers. * CREDITS ******************************************************************* I would like to thank to: Andre de Boer (andredb@molyvos.net) Corey Rueckheim (rueck_cw@cslab.uwlax.edu) Marc J. Nelson (SimRacing@aol.com) Brian D. Fox (h8u2@hotmail.com) Chas Borenemann (chasman@dataplusnet.com)