Hi Chasman, Andre. As I promised, here is the documment I wrote about trk files, I hope we can work together to totally understand these files. Now I'll finish some details in the TRK->TXT conevrter, and I'll send it to you too. Marcelo ---------------------------------------------------------------------------- I created this "formal" documment to have a better way to exchange information. Chasman, Andre, if you have something to add to this file, just do it, and send it back. We can work together ... :) ** TRK FILE STRUCTURE The TRK sets the placement for surfaces types and walls for each track, as far as we know, if we're able to modify 3DO and TRK files, we can create new tracks. The TRK file has four parts: THE HEADER PART 1 PART 2 PART 3 The sim reads PART 3 first, then PART 1 and finally PART 2 so I'll follow that order to explain the file structure. THE HEADER: ============================================================================= The header has different sizes, depending on how much information it needs to store. It will identify the file as a trk file and then define the remaining parts of the trk file. BYTE PURPOSE ------------------------------------------------------------------- 00-07 File ID 08-11 Track lenght in (1/50)" 12-15 Number of sectors per segment 16-19 Number of segments 20-23 Lenght (in bytes) of PART 2 24-27 Lenght (in bytes) of PART 3 28-31 1st sector value 32-35 2nd " " 36-40 3rd " " 40-43 4th " " 44-47 5th " " 48-51 6th " " 52-55 7th " " 56-59 8th " " 60-63 9th " " 64-67 10th " " 68-XX List of offsets for PART 3 where each segment is defined * File ID: ---------- Is always the same : 00 - 03 : (K A R T )asc 04 - 07 : (01 00 00 00)hex * Track Lenght: --------------- The real track lenght can be calculated as: value / 3168000 * Sectors: ---------- The number of sectors is the ammount of different bankings that a segment can have. The most recurrent is three and four, except for Australia (5) and Cleveland (2). * Segments: ----------- A segment is a piece of a track (straight or turn). * Sector values: ---------------- If there's N sectors per segment, there will be N non-null values and 10-N null values ((00 00 00 00)hex) We still don't know what these values are for, but modifying them we can see that some boundaries are changed, my guess is that they define where sectors start/finish, related to a "center point". Take this diagram as example: This is the 1st segment of Dover. Dover has 3 sectors per segment. I only have analised this segment, so I don't know if sectors are defined always in the same way. <------ Sector 3 --------><------ Sector 1 -------> <---------- Sector 2 --------------------> ___________________________________________________ || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || --------------------------------------------------- <- Start/Finish ^ ^ ^ line 3rd sector value 2nd sector value 1st sector value || = Wall /// = Grass The HEADER size can be calculated as: 68 + 4*(number of segments) PART 3 ============================================================================ Defines the segment size and position of walls and objects alongside the track. Contains (number of segments) segment definitions, every one follows this structure: BYTE PURPOSE ----------------------------------------------------- 00-03 Segment type 04-07 Segment starting point 08-11 Segment lenght 12-15 Segment inclination angle 16-19 ?? 20-23 ?? 24-27 ?? 28-31 ?? 32-35 ?? 36-39 Offset of PART 1 where sectors are defined 40-43 Number of surfaces in the segment 44-47 Offset of PART 2 where surfaces are defined 48-51 Number of walls in the segment 52-XX Wall definitions * Segment type: --------------- A segment can be a straight (01 00 00 00) or a turn (02 00 00 00). * Segment starting point/lenght: -------------------------------- The segment starting point in (1/50)". It's equal to the previous segment starting position + previous sector lenght. * Segment inclination angle: ---------------------------- Determines the car inclination angles. I don't have a clue to determine the values for angles, but you can set left/right or front/rear inclination angle. It only affects how the car is drawn. * Offset for sectors: --------------------- The sim moves to the (offset value)*(number of sectors)*32 inside the PART 1 and reads (number of sectors) sector definitions. * Number of surfaces/offset for surfaces: ----------------------------------------- The sim moves to the (offset value)*12 inside the PART 2 and reads (number of surfaces) surface definitions. * Number of walls/wall definitions: ----------------------------------- The sim reads (number of walls) wall definitions from the actual position. A wall definition consist in: BYTE PURPOSE ---------------------------------------------- 00-03 Wall type 04-07 Starting point 08-11 Ending point 12-15 Null value (CC CC CC CC) 16-19 Null value (CC CC CC CC) * Wall type: ------------ Determines if it's a left (04 00 00 00) or right (06 00 00 00) wall, I'm not sure what's the difference between them. * Starting/Ending point: ------------------------ Determines the location of wall at the beginning and end of a segment related to a center point. Again, take this diagram as example: ___________________________________________________ EP->|| ||///| | || || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || || | ||///| | || SP->|| ||///| | || --------------------------------------------------- PART 1 ============================================================================ Gives the sector position and seems to define bankings, vertical and 3d movements for the cars. Consist in (number of segments)*(number of sectors) definitions with this structure: BYTE PURPOSE ------------------------------------------------------- 00-03 Front left sector elevation 04-07 Front right sector elevation 08-11 ?? 12-15 ?? 16-19 ?? 20-23 ?? 24-27 ?? 28-31 ?? * Sector elevation: ------------------- Determines the height (Z coordinate) for the referenced points. Zero doesn't define no elevation, so this is a relative value. The reference elevation must be defined in the segment declaration (PART 3). I'm not sure if this value defines an angle or a Z coordinate (I guess is the second one). Now, if the segment is a turn, the 28-31 value is always (CC CC CC CC). PART 2 ============================================================================= Relates to the track surface seems to define where some visual effects (smoke, dirt) are used by the sim and may also contain information on the grip levels of each different surface. Part 2 is probably the easiest part of the file to understand (Chasman said that ;)) This part consists in N declaration for surfaces, N is relative to the segment declaration, because each segment can have different ammount of surfaces. BYTE PURPOSE ------------------------------------------------- 00-03 Starting point 04-07 Ending point 08-11 Surface type * Starting/Ending point: ------------------------ Just like walls, defines the position related to a center point. The first segment of dover has 5 surfaces: -----------------------------------------------------> -228000 Asphalt ----------------------------> 60000 White line ---------------------------> 64000 Asphalt -----------------------> 124000 Grass ------------------> 200000 Asphalt ___________________________________________________ || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || || | ||///| | || || ||///| | || --------------------------------------------------- * Surface type: --------------- Chasman has found these values 1E 00 00 00 = Yellow lines (30) 2E 00 00 00 = Asphalt (46) 36 00 00 00 = White Lines (54) 06 00 00 00 = Grass (6) 16 00 00 00 = Dirt (22) 26 00 00 00 = Concrete (38) I also have found these values +1 in indy.trk It seems that each of these has their own grip level. Now changing any of these values will only affect what the sim thinks is there. It will not actually alter the surface. That info is contained in the 3do file. What I mean is if you alter all asphalt (2E) to read as dirt (16), when you skid, you'll throw dirt on the asphalt surface drawn by the 3do. =========================================================================== Well, that's all I know, I hope you can specify or add more information to this file