fsx file structure.pdf

Upload: amiry1373

Post on 01-Jun-2018

281 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 FSX File structure.pdf

    1/31

    1

    FS X BGL File structureThis is a first attempt to understand the file structure of the FS X scenery files. It is still incomplete,since I do not understand all the features.

    Winfried OrthmanneMail: [email protected]

    BGL Files Overview

    FS X BGL-filesFile Name Contents Sections

    APX*. BGL Ai r port s i ncl udi ng obj ect s codedwi t hi n t he ai r por tr ecor ds t hr u Vi sual Modeland Taxi waySi gnsubr ecor ds

    ATX*. BGL Waypoi nt s and boundar i esBRX*. BGL ext r usi on br i dgesNVX*. BGL Navai dsOBX*. BGL Ai r por t obj ect s i ncl udi ng . mdl dat a[ ci t y name] . BGL ci t y obj ect s i ncl udi ng . mdl dat acvx*. bgl t er r ai n vect or dat a

    f i l es i n t he BASEsubdi r ect or y of t hescener y di r ect or yObj ect l i br ar i es i n t heGl obal subdi r ect or y of

    t he scener y di r ect or y

    In contrast to FS9, there are essentially no more files in the "old" file format.

  • 8/9/2019 FSX File structure.pdf

    2/31

    2

    Data types

    Latitude and longitudeare no longer represented as before. Each location on the earth is fixed in

    the LOD grid. Longitude and latitude are each represented by a 4 byte value (DWORD). The formulafor obtaining the decimal values is as follows:

    ( doubl e) Lon = ( DWORD) Lon * ( 360. 0 / ( 3 * 0x10000000) 180. 0)( doubl e) Lat = 90. 0 - ( DWORD) Lat * ( 180. 0 / ( 2 * 0x10000000))

    Al ti tude is given in 1/1000 m as DWORD.

    Pitch, bank and heading: is given as ANGLE16 in form of a DWORD. The formula for obtainingthe decimal value is as follows:

    ( doubl e) Pi t ch = ( DWORD) Pi t ch * 360. 0 / 0x10000

    ICAO Identifiers and region codes are coded in a special format. Each number and letter has a

    value from 0 .. 37:blank 00digits 0 .. 9 02 .. 11letters A .. Z 12 .. 37

    The code is calculated by starting from left: the value of the first digit/letter is multiplied by 38, thenthe value of the next digit/letter to the right is added, the sum s multiplied by 38, and as long asthere are more digits/letters this process is repeated.The region codes have only 2 digits/letters and the result is used as such; for the ICAO identifiersfor airports, ILS, VOR, NDB and waypoints there are up to 5 digits/letters, and the result is shiftedleft by 5 positions, i.e. multiplied by 0x20. Bits 0 .. 4 of the resulting DWORD are frequently usedfor other purposes.The ICAO identifiers for primary and secondary ILS in a runway record are not shifted.

  • 8/9/2019 FSX File structure.pdf

    3/31

    3

    BGL fi le headerThe BGL file header consists of a fixed part with the length of 0x38 (54) bytes and a variablenumber of section pointers.

    The fixed part of the header has the following structure:

    offset length format description contents

    0 2 WORD New bgl I D 0x02012 2 WORD Pr obabl y ver si on 0x19924 4 DWORD si ze of header 0x00388 12 DWORD[ 3] Unknown, possi bl y connect ed t o

    compi l at i on t i me20 4 DWORD number of sect i on poi nter s i n header

    r est ar e r ef er ences t o t he geogr aphi calarea covered by t he content s of t hef i l e

    The section pointers are located immidiately after the fixed part of the header, i.e. starting at offset0x0038.Each section pointer is 0x14 bytes long and has the following structure

    offset length format description contents

    0x00 4 DWORD t ype of sect i on. The f ol l owi ng t ypeshave been i dent i f i ed:

    0x0003: ai r por t dat a0x0013: VOR / I LS dat a0x0017: NDB data0x0018: mar ker s0x0020: boundar y data0x0022: waypoi nt dat a

    0x0023: geopol dat a0x0025: scenery obj ects0x0027: namel i st0x002b: mdl data0x002c: addi t i onal ai r por t dat a0x002e: excl usi onRectangl e

    0x04 4 DWORD unknown0x08 4 DWORD number of subsect i on poi nter s i n

    sect i on header0x0c 4 DWORD of f set f r om f i l e st ar t t o sect i on

    header0x10 4 DWORD si ze of sect i on header

  • 8/9/2019 FSX File structure.pdf

    4/31

    4

    BGL section headerThe section pointer records in the header point to the section header, which consist of 1 to nsubsection pointer records. The number of subsection pointer records present is given in thesection pointer record as mentioned above.

    Each subsection pointer record is 0x10 bytes long and has the following structure:

    offset length format description contents

    0x00 4 DWORD I D. Si nce many sect i ons are subdi vi dedi nt o subsect i ons accor di ng t o t hel ocat i on of t he obj ect s i n t he LOD ( orQMI D) syst em, t hi s I D i s an i ndexgi vi ng t he l ocat i on of t he obj ect i nspace.

    0x04 4 DWORD number of r ecor ds i n t he subsect i on0x08 4 DWORD of f set f r om f i l e st ar t t o st ar t of

    obj ect r ecor ds i n t hi s subsect i on0x0c 4 DWORD si ze of subsect i on

    The section header for records of Boundary and Geopol type have a different structure. Theyconsist of a 0x10 bytes long record for every subsection with the following structure:

    offset length format description contents

    0x00 4 DWORD I D. As ment i oned above t hi s I D i s ani ndex i ndi cat i ng t he l ocat i on of t heobj ect s i n t he QMI D space

    0x04 4 DWORD Number of r ecor ds i n t he subsect i on0x08 4 DWORD I ndex i nto t he l i st f ol l owi ng t hese

    records0x0c 4 DWORD unknown, seems al ways t o cont ai n 0x00000000

    after this list follows a record for every subsection with the following structure, which is repeated forthe number of records, i.e. if there are 2 records in the subsection, there will be two records of thefollowing structure:

    offset length format description contents

    0x00 4 DWORD of f set f r om st ar t of f i l e t o st ar t ofrecords

    0x04 4 DWORD l engt h of subsect i on

  • 8/9/2019 FSX File structure.pdf

    5/31

    5

    BGL subsectionsThe subsections for each kind of objects (airports, sceneryObjects, ILS etc) consist of a list with theindividual records following each other. Each record has at offset 2 a DWORD giving the total size

    of this record. Thus it is easy to find the start of the next record. Each section and thus eachsubsection contains records of the same general type. A number of records can containsubrecords, which in turn have a size field at offset 2 after a WORD identifying the type ofsubrecord.

    Ai rport

    Each airport record consists of a fixed part with the length of 0x38 bytes, followed by a variablepart with 0..n subrecords of different types. The structure of the fixed part is as follows:

    offset length format description contents

    0x00 2 WORD I D 0x003c0x02 4 DWORD si ze of ai r por t r ecor d

    0x06 1 BYTE number of r unways subrecor ds0x07 1 BYTE number of com subrecords0x08 1 BYTE number of st art subrecords0x09 1 BYTE number of approach subrecords ( ?)0x0a 1 BYTE Bi t 0- 6: number of apr ons ( ?)

    Bi t 7: f l ag f or del et eAi r por t r ecor d0x0b 1 BYTE number of hel i pad subrecords0x0c 4 DWORD l ongi t ude0x10 4 DWORD l at i t ude0x14 4 l ong al t i t ude i n m0x18 4 DWORD l ongi t ude of t ower ( i f present )0x1c 4 DWORD l at i t ude of t ower ( i f present )

    0x20 4 DWORD al t i t ude of t ower ( i f di f f er ent f r omai rport )0x24 4 f l oat magnet i c var i at i on0x28 4 DWORD I CAO i dent ( speci al f ormat )0x2c 4 DWORD unknown0x30 4 DWORD unknown0x34 1 BYTE unknown0x35 1 BYTE t r af f i c scal ar0x36 2 WORD unknown

    The following subrecords can be present after the main airport record:

    NAME

    offset

    length format description contents

    0x00 2 WORD I D 0x00190x02 4 DWORD Si ze of name subr ecor d0x06 STRI NG ai r por t name

    This subrecord seems to be present in every airport record, and it is always the first oneimmediately after the fixed part.

    INCLUDED TOWER SCENERY OBJECT

    offset length format description contents

    0x00 2 WORD I D 0x00660x02 4 DWORD Si ze of subrecor d0x06 4 DWORD Si ze of t he i ncl uded scenery obj ect

    After this record we find an included scenery object with an internal structure identical to that ofother scenery objects (see below) and including possible attachments. The BglComp compiler

  • 8/9/2019 FSX File structure.pdf

    6/31

    6

    allows only one scenery object to be included at this point, but in some FS X scenery files we findmore than one objects included here. If present, the subrecords of this type appear immediatelyafter the Name subrecord.

    RUNWAY

    The runway subrecord consists of a fixed part with a length of 0x34 bytes and a variable number ofsub-subrecords. The fixed part has the following structure;

    offset length format description contents

    0x00 2 WORD I D 0x00040x02 4 DWORD si ze of r unway subrecor d0x06 2 WORD t ype of sur f ace. The f ol l owi ng number s have

    been f ound:0x0000 CONCRETE; 0x0001 GRASS;0x0002 WATER; 0x0004 ASPHALT;0x0007 CLAY; 0x0008 SNOW;0x0009 I CE; 0x000c DI RT;0x000d CORAL; 0x000e GRAVEL ;

    0x000f OI L_TREATED; 0x0010 STEEL_MATS;0x0011 BI TUMI NOUS; 0x0012 BRI CK;0x0013 MACADAM; 0x0014 PLANKS;0x0015 SAND; 0x0016 SHALE;0x0017 TARMAC; 0x00f e UNKNOWN;

    0x08 1 BYTE pr i mary r unway number ( 01 36, t hen 37ss .f or NORTH, NORTHEAST, EAST, SOUTHEAST,SOUTH, SOUTHWEST, WEST, NORTHWEST

    0x09 1 BYTE pr i mary r unway desi gnat or0 = NONE, 1 = LEFT, 2 = RI GHT,3 = CENTER, 4 = WATER, 5 = A, 6 = B

    0x0a 1 BYTE secondar y r unway number0x0b 1 BYTE secondar y r unway desi gnat or

    0x0c 4 DWORD I CAO i dent . f or pr i mary I LS ( speci al f ormat ) ,0x0000 i f none

    0x10 4 DWORD I CAO i dent . f or secondar y I LS0x14 4 DWORD l ongi t ude0x18 4 DWORD l at i t ude0x1c 4 l ong el evat i on0x20 4 f l oat l engt h i n m0x24 4 f l oat wi dt h i n m0x28 4 f l oat headi ng0x2c 4 f l oat pat t er n al t i t ude0x30 2 WORD mar ki ng f l ags:

    BI T 0: edges; BI T 1: t hr eshol dBI T 2: f i xedDi st ance BI T 3: t ouchdown

    BI T 4: dashes BI T 5: i dentBI T 6: preci si on BI T 7: edgePavementBI T 8: si ngl eEnd Bi t 9: pr i mar yCl osedBI T 10: second. Cl osed BI T 11: pr i mar ySt olBI T 12: secondar ySt olBi t 13: al t er nat eThr eshol dBi t 14: al t er nat eFi xed Di st anceBi t 15: al t ernat eTouchdown

    0x32 1 BYTE l i ght f l ags:BI T 0- 1: edge (00 none, 01 l ow, 10 medi um,

    11 hi gh)BI T 2- 3: cent er ( as wi t h edge)BI T 4: f l ag f or cent er Red

    marki ng f l agsBI T 5: al t er nat ePr eci si onBI T 6: l eadi ngZer oI dentBI T 7: noThr eshol dEndAr r ows

  • 8/9/2019 FSX File structure.pdf

    7/31

    7

    0x33 1 BYTE pat t ern f l ags:BI T 0: pr i maryTakeof f ( 0 = YES)BI T 1: pr i maryLandi ng ( 0 = YES)BI T 2: pr i maryPat t ern ( 0 = LEFT)BI T 3: secondaryTakeof fBI T 4: secondaryLandi ng

    BI T 5: secondaryPat t ernBI T 6- 7: unused ( ?)

    The following sub-subrecords can be present within a runway subrecord:

    OffsetThreshold

    offset length format description contents

    0x00 2 WORD I D pr i mar y:secondar y

    0x00050x0006

    0x02 4 DWORD Si ze of sub- subrecor d 0x00100x06 2 WORD sur f ace ( same as i n r unway)0x08 4 f l oat l engt h i n m0x0c 4 f l oat wi dt h i n m

    BlastPad

    offset length format description contents

    0x00 2 WORD I D pr i mar y:secondar y

    0x00070x0008

    0x02 4 DWORD Si ze of sub- subrecor d 0x00100x06 2 WORD sur f ace ( same as i n r unway)0x08 4 f l oat l engt h i n m0x0c 4 f l oat wi dt h i n m

    Overrun

    offset length format description contents

    0x00 2 WORD I D pr i mar y:secondar y

    0x00090x000a

    0x02 4 DWORD Si ze of sub- subrecor d 0x00100x06 2 WORD sur f ace ( same as i n r unway)0x08 4 f l oat l engt h i n m0x0c 4 f l oat wi dt h i n m

    VASI

    offset length format description contents0x00 2 WORD I D pr i mary l ef t :

    pr i mar y r i ght :secondar y l ef t :secondar y r i ght :

    0x000b0x000c0x000d0x000e

    0x02 4 DWORD Si ze of sub- subrecor d 0x00180x06 2 WORD t ype

    0x01 = VASI 21 0x02 = VASI 310x03 = VASI 22 0x04 = VASI 320x05 = VASI 23 0x06 = VASI 330x07 = PAPI 2 0x08 = PAPI 40x09 = TRI COLOR 0x0a = PVASI0x0b = TVASI 0x0c = BALL

    0x0d = APAP/ PANELS0x08 4 f l oat bi asX0x0c 4 f l oat bi asZ0x10 4 f l oat spaci ng

  • 8/9/2019 FSX File structure.pdf

    8/31

    8

    20 4 f l oat pi t ch

    ApproachLights

    offset length format description contents

    0x00 2 WORD I D pr i mar y:secondar y

    0x000f0x0010

    0x02 4 DWORD Si ze of sub- subrecor d 0x00080x06 1 BYTE syst em 0x00 = NONE

    0x01 = ODALS 0x02 = MALSF0x03 = MALSR 0x04 = SSALF0x05 = SSALR 0x06 = ALSF10x07 = ALSF2 0x08 = RAI L0x09 = CALVERT 0x0a = CALVERT20x0b = MALS 0x0c = SALS0x0e = SSALS

    0x07 1 BYTE number of st r obes

    (end of runway)

    HELIPAD

    offset length format description contents

    0x00 2 WORD I D 0x00260x02 4 DWORD Si ze of hel i pad subrecor d 0x00240x06 1 BYTE sur f ace ( as wi t h r unway)0x07 1 BYTE bi t 0- 3: t ype

    0 = NONE 1 = H2 = SQUARE 3 = CI RCLE4 = MEDI CAL

    bi t 4: t r anspar ent

    bi t 5: cl osedbi t 6- 7: unused

    0x08 4 BYTE[4] col or ( cannot be set wi t h bgl comp)0x0c 4 DWORD l ongi t ude0x10 4 DWORD l at i t ude0x14 4 l ong al t i t ude * 10000x18 4 f l oat l engt h0x1c 4 f l oat wi dt h0x20 4 f l oat headi ng

    START

    (the keywords Start and RunwayStart produce identical subrecords)

    offset length format description contents

    0x00 2 WORD I D 0x00110x02 4 DWORD Si ze of st ar t subrecor d 0x00180x06 1 BYTE r unway number0x07 1 BYTE bi t 0- 3: r unway desi gnat or ( as wi t h

    r unway subr ecor d)bi t 4- 7: start t ype

    1 = RUNWAY 2 = WATER 3 = HELI PAD0x08 4 DWORD l ongi t ude0x0c 4 DWORD l at i t ude0x10 4 l ong el evat i on0x14 4 f l oat headi ng

  • 8/9/2019 FSX File structure.pdf

    9/31

    9

    COM

    offset length format description contents

    0x00 2 WORD I D 0x00120x02 4 DWORD Si ze of subr ecord: var i abl e0x06 2 WORD t ype. The f ol l owi ng numbers have been

    i dent i f i ed:0x0001 ATI S 0x0002 MULTI COM

    0x0003 UNI COM 0x0004 CTAF0x0005 GROUND 0x0006 TOWER0x0007 CLEARANCE 0x0008 APPROACH0x0009 DEPARTURE 0x000a CENTER0x000b FSS 0x000c AWOS0x000d ASOS0x000e CLEARANCE_PRE_TAXI0x000f REMOTE_CLEARANCE_DELI VERY

    0x08 4 DWORD f r equency0x0c var i abl e STRI NGZ name

  • 8/9/2019 FSX File structure.pdf

    10/31

    10

    DELETEAIRPORT

    The DeleteAirport subrecord has a fixed and a variable part. The fixed part has the followingstructure:offset length format description contents

    0x00 2 WORD I D 0x00330x02 4 DWORD Si ze of subr ecor d: var i abl e0x06 2 WORD del et e f l ags

    BI T 0: al l Appr oachesBI T 1: al l Apr onLi ght sBI T 2: al l Apr onsBI T 3: al l Frequenci esBI T 4: al l Hel i padsBI T 5: al l RunwaysBI T 6: al l St ar t sBI T 7: al l Taxi waysBi t 8: al l Bl ast FencesBi t 9: al l Boundar yFencesBi t 10: al l J et waysBi t 11: al l Cont r ol Tower s

    0x08 1 BYTE number of i ndi vi dual r unways t o del ete0x09 1 BYTE number of i ndi vi dual st ar t s t o del et e0x0a 1 BYTE number of f r equenci es t o del ete0x0b 1 BYTE unused ( ?)

    according to the number of individual features to delete there are the following parts of the recordadded:for runways:offset length format description contents

    0x00 1 BYTE sur f ace ( as i n r unway subrecord)

    0x01 1 BYTE r unway number pr i mar y0x02 1 BYTE r unway number secondar y0x03 1 BYTE bi t 0- 3: r unway desi gnator pr i mary

    bi t 4- 7: r unway desi gnator secondar y

    for starts:offset length format description contents

    0x00 1 BYTE r unway number0x01 1 BYTE r unway desi gnat or0x02 1 BYTE t ype of st art

    1 = RUNWAY, 2 = WATER, 3 = HELI PAD0x03 1 BYTE unused ( ?) 0x00

    for frequenciesoffset length format description contents

    0 4 DWORD bi t 28- 31: t ype ( as wi t h COM r ecor ds)bi t 0- 27: f r equency * 1000000

    APRON

    There are 2 subrecords for each apron which follow each other. Both have variable length.First record:

    offset length format description contents0x00 2 WORD I D 0x00370x02 4 DWORD si ze0x06 1 BYTE sur f ace ( as wi t h r unway subrecord)

  • 8/9/2019 FSX File structure.pdf

    11/31

    11

    0x07 2 WORD number of ver t i cesand then f or each ver t ex:

    4 DWORD l ongi t ude4 DWORD l at i t ude

    and t henzero- f i l l t o next DWORD boundar y

    second record:offset length format description contents

    0x00 2 WORD I D 0x00300x02 4 DWORD si ze0x06 1 BYTE sur f ace ( as i n f i r st r ecor d)0x07 1 BYTE f l ags:

    bi t 0: dr awSur f acebi t 1: dr awDet ai l

    0x08 2 WORD number of ver t i ces0x0c 2 WORD number of t r i angl es t o draw

    and then f or each vert ex4 DWORD l ongi t ude4 DWORD l at i t ude

    and t hen f or each t r i angl e to dr aw2 WORD i ndex of f i r st poi nt2 WORD i ndex of second poi nt2 WORD i ndex of t hi r d poi nt

    APRONEDGELIGHTS

    offset length format description contents

    0x00 2 WORD I D 0x00310x02 4 DWORD si ze0x06 2 WORD unknown0x08 2 WORD number of ver t i ces0x0a 2 WORD number of edges0x0c 4 DWORD unknown, probabl y col or of l i ght s 0xf f 0000f f0x10 4 f l oat unknown ( val ue 1) 0x3f 8000000x14 4 f l oat unknown ( val ue 800) 0x44480000

    and t hen f or each ver t ex4 DWORD l ongi t ude4 DWORD l at i t ude

    end then f or each edge4 f l oat unknown ( val ue 60. 96)2 WORD i ndex of st ar t vert ex2 WORD i ndex of end ver t ex

    FENCES

    offset length format description contents

    0x00 2 WORD I D: Bl ast FenceBoundaryFence

    0x00380x0039

    0x02 4 DWORD si ze0x06 2 WORD ver t ex count0x08 16 GUI D i nst anceI d0x18 16 GUI D pr of i l e

    and then f or each vert ex

    4 DWORD l ongi t ude4 DWORD l at i t ude

  • 8/9/2019 FSX File structure.pdf

    12/31

    12

    UNKNOWN RECORD

    Every (?) airport in the FS X scenery files contains a subrecord with the ID of 0x3b. This recordcontains as usual a DWORD length field at offset 0x02. It cannot be reproduced with the BglComp

    compiler, and it has no apparent function. It concists of a long list of vertices along the perimeter ofthe airport and a list of indices for triangles to be drawn (similar to the second Apron record), but infact the sim apparently does not use this list for drawing.

    TAXIWAYPOINT

    All taxiway points are joined in one record, which has a fixed part of 8 bytes and a variable partwith 12 bytes for each point. Structure of the fixed part:

    offset length format description contents

    0x00 2 WORD I D 0x001A0x02 4 DWORD si ze : var i abl e0x06 2 WORD number of t axi way poi nt s present

    and for each taxipoint:0x00 1 BYTE t ype:

    1 = NORMAL, 2 = HOLD_SHORT4 = I LS_HOLD_SHORT5 = HOLD_SHORT_NO_DRAW6 = I LS_HOLD_SHORT_NO_DRAW

    0x01 1 BYTE f l ag: 0 = FORWARD, 1 = REVERSE0x02 1 WORD unknown 0x00000x04 4 DWORD l ongi t ude0x08 4 DWORD l at i t ude

    TAXIWAYPARKING

    This record type has a short fixed part for all TaxiwayParking records together and a longervariable part with sections for each TaxiwayParking. The fixed part is 8 bytes long:

    offset length format description contents

    0x00 2 WORD I D 0x001B0x02 4 DWORD si ze : var i abl e0x06 2 WORD number of t axi way par ki ng r ecords present

    The record sections for each TaxiwayParking are again of variable length, depending on thenumber of airlineCodes present:.

    0x00 4 DWORD bi t 31- 24: count of ai r l i neCodes presentbi t 23- 12: numberbi t 11- 8: t ype

    0x1 = RAMP_GA0x2 = RAMP_GA_SMALL0x3 = RAMP_GA_MEDI UM

    0x4 = RAMP_GA_LARGE0x5 = RAMP_CARGO0x6 = RAMP_MI L_CARGO0x7 = RAMP_MI L_COMBAT0x8 = GATE_SMALL0x9 = GATE_MEDI UM0xa = GATE_HEAVY0xb = DOCK_GA

    bi t 7- 6: pushback ( 00 = none, 01 = l ef t ,10 = r i ght , 11 = both)

  • 8/9/2019 FSX File structure.pdf

    13/31

    13

    bi t 5- 0: name 0x00 = NONE, 0x01 = PARKI NG,0x02 = N_PARKI NG, 0x03 = NE_PARKI NG0x04 = E_PARKI NG, 0x05 = SE_PARKI NG0x06 = S_PARKI NG, 0x07 = SW_PARKI NG0x08 = W_PARKI NG, 0x09 = NW_PARKI NG0x0a = GATE, 0x0b = DOCK,

    0x0c = GATE_A, 0x0d = GATE_B,0x0e = GATE_C 0x0f = GATE_D0x10 = GATE_E . . . .0x25 = GATE_Z

    0x04 4 f l oat r adi us0x08 4 f l oat headi ng0x0c 4 f l oat t eeOf f set 10x10 4 f l oat t eeOf f set 20x14 4 f l oat t eeOf f set 30x18 4 f l oat t eeOf f set 40x1c 4 DWORD l ongi t ude0x20 4 DWORD l at i t ude

    . . 4 STRI NG ai r l i ne desi gnat or ( 0. . n t i mes r epeat ed)

    TAXIWAYPATH

    This record has a fixed length of 8 byte and a variable part with records for each path. It has thefollowing structure:

    offset length format description contents

    0x00 2 WORD I D 0x001C0x02 4 DWORD si ze0x06 2 WORD number of pat hs def i ned

    and t hen f or each pat h:0x00 2 WORD i ndex of st ar t poi nt

    NB: f or t ype TAXI , t he i ndex of t he st ar tand of t he end must bot h ref er t o aTaxi Poi nt . For t ype PARKI NG t he st ar ti ndex must r ef er t o a Taxi Poi nt , t he endi ndex must r ef er t o a Taxi wayParki ng.

    0x02 2 WORD Bi t 0- 11: i ndex of end poi ntBi t 12- 15: r unway desi gnator

    0x04 1 BYTE t ype1 = TAXI2 = RUNWAY3 = PARKI NG4 = PATH5 = CLOSED6 = VEHI CLE

    0x05 1 BYTE r unway number / i ndex i nt o Taxi Name0x06 1 BYTE bi t f i el d

    BI T 0: cent er l i neBI T 1: cent er Li neLi ght edBI T 2- 3: l ef t Edge ( 00 = NONE, 01 =SOLI D, 10 = DASHED, 11 = SOLI D_DASHED)

    BI T 4: l ef t EdgeLi ght edBI T 5- 6: r i ght EdgeBI T 7: r i ght EdgeLi ght ed

    0x07 1 BYTE sur f ace0x08 4 f l oat wi dt h0x0c 4 DWORD wei ght Li mi t0x10 4 DWORD ??

  • 8/9/2019 FSX File structure.pdf

    14/31

    14

    TAXINAME

    This record has variable length, it consist of 8 bytes as a fixed part and then 8 bytes for each Nameoffset length format description contents

    0x00 2 WORD I D 0x001D0x02 4 DWORD si ze : var i abl e0x06 2 WORD number of name ent r i es

    and then f or each name8 STRI NG t axi Name

    TAXIWAYSIGN

    These record are coded in the section for scenery objects (0x25) with a separate type of entry.All Taxiway signs for one airport are coded together in one record. There is no apparentcoordination of this record with the airport record to which it belongs. The main structure of therecord is identical with that of other scenery objectsoffset length format description contents

    0x00 2 WORD I D 0x000e0x02 2 WORD si ze : var i abl e0x04 4 DWORD l ongi t ude0x08 4 DWORD l at i t ude0x0c 4 l ong al t i t ude ( ?) cannot be coded wi t h t he

    compi l er0x10 2 WORD al t i t udeI sAGL cannot be coded 0x00010x12 2 WORD pi t ch ( ?) cannot be coded0x14 2 WORD bank ( ?) cannot be coded0x16 2 WORD ( headi ng) ( ?) cannot be coded0x18 2 WORD i mageCompl exi t y ( ?) cannot be coded0x1a 2 WORD unknown

    0x1c 16 GUI D i nst anceI d ( cannot be coded)0x2c 4 DWORD number of t axi way si gns f or t hi s ai r por t

    and t hen f or each si gn0x00 4 f l oat l ongi t ude of f set f r om val ue i n mai n

    r ecor d0x04 4 f l oat l at i t ude of f set f r om val ue i n mai n r ecor d0x08 2 WORD headi ng as coded0x0a 1 BYTE Si ze ( SI ZE1 . . SI ZE5)0x0b 1 BYTE j ust i f i cat i on ( 1 = l ef t , 2 = r i ght )0x0c var STRI NGZ l abel ( zero f i l l ed t o next WORD address)

    JETWAY

    offset length format description contents0x00 2 WORD I D 0x003a0x02 4 DWORD si ze : var i abl e0x06 2 WORD par ki ng Number ( r ef ers t o an exi st i ng

    par ki ng)0x08 4 WORD gat e name0x0a 4 DWORD unknown

    af t er t hi s f ol l ows a nor mal scener yobj ect r ecor d st ar t i ng wi t h an I D of0x0b.Thi s r ecor d r ef er s t o an appr opr i at escener y obj ect l i ke{BFCDF52B- 9142- 415C- 8318- 03C1B92CA9D9}

  • 8/9/2019 FSX File structure.pdf

    15/31

    15

    APPROACH

    offset length format description contents

    0x00 2 WORD I D f or Appr oach 0x00240x02 4 DWORD si ze : var i abl e0x06 1 BYTE suf f i x0x07 1 BYTE r unway number

    0x08 1 BYTE bi t 0- 3: t ype0x01 = GPS 0x02 = VOR0x03 = NDB 0x04 = I LS0x05 = LOCALI ZER 0x06 = SDF0x07 = LDA 0x08 = VORDME0x09 = NDBDME 0x0a = RNAV0x0b = LOCALI ZER_BACKCOURSE

    bi t 4- 6: r unway desi gnat orbi t 7: gpsOver l ay f l ag

    0x09 1 BYTE number of t r ansi t i ons ?0x0a 1 BYTE number of appr oach l egs0x0b 1 BYTE number of mi ssedApproach l egs ?0x0c 4 DWORD f i xI dent BI T 0- 4: f i xType

    02 = VOR03 = NDB04 = TERMI NAL_NDB05 = WAYPOI NT06 = TERMI NAL_WAYPOI NT09 = RUNWAY

    BI T 5- 31 f i xI dent0x10 4 DWORD bi t 0- 10: f i xRegi on

    bi t 11- 31: I CAO I d of r el evant ai r por t0x14 4 f l oat al t i t ude0x18 4 f l oat headi ng0x1c 4 f l oat mi ssedAl t i t ude

    after this the following record can occuroffset length format description contents0x00 2 WORD I D f or Appr oachLegs 0x002D0x02 4 DWORD si ze : var i abl e0x06 2 WORD number of l egs t o f ol l ow

    each leg is a structure with a fixed length of 44 bytesoffset length format description contents

    0x00 1 BYTE I D of t he l egt ypes f ound: 0x01 = AF

    0x02 = CA 0x03 = CD0x04 = CF 0x05 = CI0x06 = CR 0x07 = DF0x08 = FA 0x09 = FC

    0x0a = FD 0x0b = FM 0x0c = HA 0x0d = HF

    0x0e = HM 0x0f = I F0x10 = PI 0x11 = RF0x12 = TF 0x13 = VA0x14 = VD 0x15 = VI0x16 = VM 0x17 = VR

    0x01 1 BYTE al t i t udeDescr i pt or01 = A02 = +03 = -

    04 = B0x02 2 WORD f l ags:

    bi t 0: t ur nDi r ect i on = Lbi t 1: t ur nDi r ect i on = R

  • 8/9/2019 FSX File structure.pdf

    16/31

    16

    bi t 8: magnet i cCour se ( 0)t r ueCour se ( 1)

    bi t 9: di st ance ( 0) or t i me ( 1)bi t 10: f l yover f al se ( 0) t r ue ( 1)

    0x04 4 DWORD bi t 5- 31: f i xI dentbi t 0- 4: f i xType

    0x08 4 DWORD bi t 0- 10: f i xRegi onbi t 11- 32: I CAO I d of r el evant ai r por t0x0c 4 DWORD bi t 5- 31: r ecommendedI dent

    bi t 0- 4: r ecommendedType0x10 4 DWORD r ecommendedRegi on0x14 4 f l oat t het a0x18 4 f l oat r ho0x1c 4 f l oat t r ueCour se / magnet i cCour se

    ( dependi ng on f l ag)0x20 4 f l oat di st ance / t i me0x24 4 f l oat Al t i t ude10x28 4 f l oat Al t i t ude2

    offset length format description contents

    0x00 2 WORD I D f or mi ssedApproachLegs 0x002E0x02 4 DWORD si ze : var i abl e0x06 2 WORD number of l egs t o f ol l ow

    offset length format description contents

    0x00 2 WORD I D f or Transi t i on 0x002C0x02 4 DWORD si ze : var i abl e0x06 1 BYTE t r ansi t i onType 1 = FULL, 2 = DME0x07 1 BYTE number of Transi t i onLegs ( ?)0x08 4 DWORD bi t 0- 4: f i xType

    2 = VOR 3 = NDB4 = TERMI NAL_NDB 5 = WAYPOI NT6 = TERMI NAL_WAYPOI NT

    bi t 5- 31: f i xI dent ( spezi al f or mat )0x0c 4 DWORD bi t 0- 10: f i xRegi on

    bi t 11- 31 : ai r por t I D of r el evant ai r por t0x10 4 f l oat al t i t ude

    i f t r ansi t i onType = DME and DmeAr c r ecor dexi st s, t hen t he f ol l owi ng 16 bytes ar epr esent

    0x14 4 DWORD dmeI dent0x18 4 DWORD bi t 0- 10: dmeRegi on

    bi t 11- 31: ai r por t I D of r el evant ai r por t

    0x1c 4 DWORD r adi al0x20 4 f l oat di st ance

    offset length format description contents

    0x00 2 WORD I D f or Transi t i onLegs ( can f ol l ow onl yaf t er t r ansi t i on

    0x002F

    0x02 4 DWORD si ze : var i abl e0x06 2 WORD number of l egs t o f ol l ow

    WAYPOINT

    The waypoint record can be part of the Airport group or can be entered independently. In both

    cases the output for the BGL is the same but for the DWORD at offset 0x18

    offset length format description contents

  • 8/9/2019 FSX File structure.pdf

    17/31

    17

    0x00 2 WORD I D f or Waypoi nt 0x00220x02 4 DWORD si ze : var i abl e0x06 1 BYTE t ype

    1 = NAMED, 2 = UNNAMED, 3 = VOR4 = NDB, 5 = OFF_ROUTE, 6 = I AF7 = FAF

    0x07 1 BYTE number of Rout e ent r i es t o f ol l ow0x08 4 DWORD l ongi t ude0x0c 4 DWORD l at i t ude0x10 4 f l oat magvar0x14 4 DWORD waypoi nt I dent ( speci al f ormat )0x18 4 DWORD bi t 0- 10: waypoi ntRegi on ( speci al f ormat )

    bi 1 11- 31: I CAO i dent of t he rel evantai r port , i f i t i s a t ermi nal waypoi nt ,def i ned wi t hi n an ai r por t r ecor dopt i onal , i f Rout e i s gi ven:

    0x1c 1 BYTE r out eType ( 1 = VI CTOR, 2 = J ET, 3 = BOTH0x1d 8 char [ 8] name ( zer o padded) , name cannot be

    l onger t han 8 char act ers

    f or Next :0x25 4 DWORD BI T 0- 2: t ype

    2 = VOR, 3 = NDB, 5 = al l ot herBI T 5- 31: waypoi nt I dent ( speci al f or mat )

    0x29 4 DWORD Bi t 0- 10 waypoi ntRegi on ( speci al f ormat )BI T 11- 31 ai r por t I d i f t er mi nal waypoi nt

    0x2d 4 f l oat al t i t udeMi ni mumf or Pr evi ous:

    0x31 4 DWORD t ype + waypoi nt I dent ( as f or Next )0x35 4 DWORD Bi t 0- 10 waypoi ntRegi on ( speci al f ormat )

    BI T 11- 31 ai r por t I d i f t er mi nal waypoi nt0x39 4 f l oat al t i t udeMi ni mum

    Not e: i t i s not necessar y f or any rout et o have bot h pr evi ous and next def i ned,i n t hat case t he f i el ds f or t hi s par t oft he r ecor d ar e al l zer o

  • 8/9/2019 FSX File structure.pdf

    18/31

    18

    ILS / VOR

    The records for ILS and VOR are in the same section and they are identical for the fixed section.ILS records can have an additional subrecordThe fixed part is 40 bytes long and has the following structure:

    offset length format description contents

    0x00 2 WORD I D 0x00130x02 4 DWORD si ze0x06 1 BYTE t ype. The f ol l owi ng number s have been

    f ound:0x0001 VOR TERMI NAL0x0002 VOR LOW

    0x0003 VOR HI GH0x0004 I LS0x0005 VOR VOT

    0x07 1 BYTE f l ags. The f ol l owi ng bi t s have beenr ecogni zed:

    bi t 0: i f 0 t hen DME onl ybi t 2: backcour sebi t 3: gl i desl ope pr esentbi t 4: DME pr esentbi t 5: NAV t r ue

    0x08 4 DWORD l ongi t ude0x0c 4 DWORD l at i t ude0x10 4 DWORD el evat i on0x14 4 DWORD f r equency0x18 4 f l oat r ange i n m0x1c 4 f l oat magnet i c var i at i on0x20 4 DWORD I CAO i dent ( speci al f ormat )0x24 4 DWORD bi t 0- 10 r egi onI d

    bi t 11- 31 ai r por t I d ( f or I LS)

    The following subrecords can follow:(for ILS)offset length format description contents

    0x00 2 WORD I D l ocal i zer 0x00140x02 4 DWORD si ze 0x00100x06 2 WORD unknown0x08 4 f l oat headi ng0x0c 4 f l oat wi dt h

    :(for ILS)

    offset length format description contents0x00 2 WORD I D gl i desl ope 0x00150x02 4 DWORD si ze 0x001c0x06 2 wor d unknown0x08 4 DWORD l ongi t ude0x0c 4 DWORD l at i t ude0x10 4 DWORD el evat i on0x14 4 f l oat r ange0x18 4 f l oat pi t ch

    (for ILS/VOR)offset length format description contents

    0x00 2 WORD I D DME 0x00160x02 4 DWORD si ze 0x00180x06 2 WORD unknown0x08 4 DWORD l ongi t ude

  • 8/9/2019 FSX File structure.pdf

    19/31

    19

    0x0c 4 DWORD l at i t ude0x10 4 DWORD el evat i on0x14 4 f l oat r ange

    After these subsections, a name subsection is added:

    offset length format description contents

    0x00 2 WORD I D 0x00190x02 4 DWORD si ze0x06 STRI NG Name ( max. 48 char act er s)

    if VisualModel is added in the source file, the compiler adds another section to the file with a recordof type 0x0025 (SceneryxObject) with the GUID for the object referenced. The coordinates for thisobjects are taken from the ILS/VOR and adjusted, if BiasXYZ is added to the VisualModel.

    NDB

    The NDB records are stored in a separate section. The have a 40 bytes long fixed section and aname section of variable length. The fixed section has the following structure:offset length format description contents

    0x00 2 WORD I D 0x00170x02 4 DWORD si ze var i abl e0x06 2 WORD Type

    0 = COMPASS_POI NT1 = MH2 = H3 = HH

    0x08 4 DWORD f r equency0x0c 4 DWORD l ongi t ude0x10 4 DWORD l at i t ude

    0x14 4 l ong el evat i on0x18 4 f l oat r ange0x1c 4 f l oat magnet i c var i at i on0x20 4 DWORD I CAO i dent ( speci al f ormat )0x24 4 DWORD bi t 0- 10: r egi on

    bi t 11- 31: I CAO i d of ai r por t , i f i t wasdef i ned wi t h an ai r por t ( t er mi nal NDB)

    The name subsection has the following structureoffset length format description contents

    0x00 2 WORD I D 0x00190x02 4 DWORD si ze0x06 STRI NG name

  • 8/9/2019 FSX File structure.pdf

    20/31

    20

    SceneryObject

    LIBRARYOBJECT

    The record has a fixed length of 0x40 bytes with the following structure:

    offset length format description contents

    0x00 2 WORD I D 0x000b0x02 2 WORD si ze 0x00400x04 4 DWORD l ongi t ude0x08 4 DWORD l at i t ude0x0c 4 DWORD al t i t ude0x10 2 WORD f l ag: 1 = i sAboveAGL0x12 2 WORD pi t ch0x14 2 WORD bank0x16 2 WORD headi ng0x18 2 WORD i mageCompl exi t y

    0 = VERYSPARSE 1 = SPARSE

    2 = NORMAL 3 = DENSE4 = VERYDENSE

    0x1a 2 WORD unknown0x1c 16 GUI D i nst ance I D0x2c 16 GUI D name0x3c 4 f l oat scal e

    if anAttachedObjectexists, there are three other records following:offset length format description contents

    0x00 2 WORD I D 0x10020x02 2 WORD si ze 0x0004

    and t hen 2nd r ecor d

    0x00 2 WORD I D dependi ng on t he ki nd of at t achedobj ect. I t i s possi bl e t oat t achbeacons, ef f ect s and ot her l i br ar yobj ect s

    0x02 2 WORD si ze0x04 2 WORD of f set of at t ach poi nt st r i ng0x06 2 WORD pi t ch0x08 2 WORD bank0x0a 2 WORD headi ng0x0c 4 f l oat bi as X0x10 4 f l oat bi as Y0x14 4 f l oat bi as Z0x18 16 GUI D i nst ance I D

    0x28 2 WORD pr obabi l i t y0x2a 2 WORD r andomness

    t he f ol l owi ng par t of t he r ecor ddepends on t he t ype of at t achedobj ect and cor r esponds t o t he code oft hi s t ype of obj ectand t hen t he 3r d r ecor d

    0 2 WORD I D 0x10032 2 WORD si ze ( ?) 0x0004

    In theory, there can be several attachments with one library object (if an adequate number ofattchment points exists)

    EFFECT

    The record has a fixed part of 108 byte and a variable part. The fixed part has the followingstructure:

  • 8/9/2019 FSX File structure.pdf

    21/31

    21

    offset length format description contents

    0x00 2 WORD I D 0x000d0x02 2 WORD si ze : var i abl e0x04 4 DWORD l ongi t ude0x08 4 DWORD l at i t ude0x0c 4 DWORD al t i t ude

    0x10 2 WORD f l ag: 1 = i sAboveAGL0x12 2 WORD pi t ch0x14 2 WORD bank0x16 2 WORD headi ng0x18 2 WORD i mageCompl exi t y

    0 = VERYSPARSE 1 = SPARSE2 = NORMAL 3 = DENSE4 = VERYDENSE

    0x1a 2 WORD unknown0x1c 16 GUI D i nst ance i d0x2c 80 STRI NGZ ef f ect Name0x7c var i abl e STRI NGZ ef f ect Par ams

    GENERICBUILDING

    offset length format description contents

    0x00 2 WORD I D 0x000a0x02 2 WORD si ze : var i abl e0x04 4 DWORD l ongi t ude0x08 4 DWORD l at i t ude0x0c 4 DWORD al t i t ude0x10 2 WORD f l ag: 1 = i sAboveAGL0x12 2 WORD pi t ch0x14 2 WORD bank0x16 2 WORD headi ng

    0x18 2 WORD i mageCompl exi t y0 = VERYSPARSE 1 = SPARSE2 = NORMAL 3 = DENSE4 = VERYDENSE

    0x1a 2 WORD unknown0x1c 16 GUI D i nst ance i d0x2c 4 f l oat scal e0x30 2 WORD t ype: 0x00a0 gener i c bui l di ng0x32 2 WORD si ze of r ecor d0x34 2 WORD subt ype. The f ol l owi ng numbers have been

    i dent i f i ed:0x0004 r ectangul ar wi t h r oof Type FLAT0x0006 r ect angul ar wi t h r oof Type RI DGE

    0x0007 r ect angul ar wi t h r oof Type PEAKED0x0008 rect angul ar wi t h roof Type SLANT0x0009 pyr ami dal bui l di ng0x000a mul t i si dedBui l di ng

    for all rectangular buildings:0x36 2 WORD si zeX 00x38 2 WORD si zeZ 10x3a 2 WORD bot t omText ur e 20x3c 2 WORD si zeBot t omY 30x3e 2 WORD t ext ur eI ndexBot t omX 40x40 2 WORD t ext ur eI ndexBot t omZ 5

    0x42 2 WORD wi ndowText ur e 60x44 2 WORD si zeWi ndowY 70x46 2 WORD t ext ur eI ndexWi ndowX 8

  • 8/9/2019 FSX File structure.pdf

    22/31

    22

    0x48 2 WORD t ext ur eI ndexWi ndowY 90x4a 2 WORD t ext ur eI ndexWi ndowZ 100x4c 2 WORD t opText ur e 110x4e 2 WORD si zeTopY 120x50 2 WORD t ext ur eI ndexTopX 130x52 2 WORD t ext ur eI ndexTopZ 14

    0x54 2 WORD r oof Text ur e 150x56 2 WORD t ext ur eI ndexRoof X 160x58 2 WORD t ext ur eI ndexRoof Z 17

    end for rectangular buildings with rooftype FLAT

    for rectangular buildings with roofType RIDGE or SLANTED0x5a 2 WORD si zeRoof Y 180x5c 2 WORD t ext ur eI ndexGabl eY 190x5e 2 WORD gabl eText ur e 200x60 2 WORD t ext ur eI ndexGabl eZ 21

    for roofType SLANTED only0x62 2 WORD f aceText ur e 22

    0x64 2 WORD t ext ur eI ndexFaceX 230x66 2 WORD t ext ur eI ndexFaceY 24

    for rectangular buildings with roofType PEAKED0x5a 2 WORD si zeRoof Y 180x5c 2 WORD t ext ureI ndexRoof Y 19

    for multisided buildings:0x36 2 WORD bui l di ngSi des.

    Note: The Ar gument f or smoot hi ng i sr equi r ed by t he compi l er , but i t has noef f ect on t he BGL-f i l e

    0

    0x38 2 WORD si zeX 1

    0x3a 2 WORD si zeZ 20x3c 2 WORD bot t omText ur e 30x3e 2 WORD si zeBot t omY 40x40 2 WORD t ext ur eI ndexBot t omX 50x42 2 WORD wi ndowText ur e 60x44 2 WORD si zeWi ndowY 70x46 2 WORD t ext ur eI ndexWi ndoxX 80x48 2 WORD t ext ur eI ndexWi ndowY 90x4a 2 WORD t opText ur e 100x4c 2 WORD si zeTopY 110x4e 2 WORD t ext ur eI ndexTopX 120x50 2 WORD r oof Text ur e 13

    0x52 2 WORD si zeRoof Y 140x54 2 WORD t ext ur eI ndexRoof X 150x56 2 WORD t ext ur eI ndexRoof Z 16

    Not e: t extur eI ndexRoof Y i s r equi r ed byt he compi l er , but i t has no ef f ect on t hebgl f i l e !

    for pyramidal buildings0x36 2 WORD si zeX 00x38 2 WORD si zeZ 10x3a 2 WORD si zeTopX 20x3c 2 WORD si zeTopZ 30x3e 2 WORD bot t omText ur e 4

    0x40 2 WORD si zeBot t omY 50x42 2 WORD t ext ur eI ndexBot t omX 60x44 2 WORD t ext ur eI ndexBot t omZ 7

  • 8/9/2019 FSX File structure.pdf

    23/31

    23

    0x46 2 WORD wi ndowText ur e 80x48 2 WORD si zeWi ndowY 90x4a 2 WORD t ext ur eI ndexWi ndowX 100x4c 2 WORD t ext ur eI ndexWi ndowY 110x4e 2 WORD t ext ur eI ndexWi ndowZ 120x50 2 WORD t opText ur e 13

    0x52 2 WORD si zeTopY 140x54 2 WORD t ext ur eI ndexTopX 150x56 2 WORD t ext ur eI ndexTopZ 160x58 2 WORD r oof Text ur e 170x5a 2 WORD t ext ur eI ndexRoof X 180x5c 2 WORD t ext ur eI ndexRoof Z 19

    WINDSOCK

    Record with fixed length of 46 byte

    offset length format description contents

    0x00 2 WORD I D 0x000c0x02 2 WORD si ze 0x003e0x04 4 DWORD l ongi t ude0x08 4 DWORD l at i t ude0x0c 4 l ong al t i t ude0x10 2 WORD f l ags ( unused)0x12 2 WORD pi t ch0x14 2 WORD bank0x16 2 WORD headi ng0x18 2 WORD i mageCompl exi t y0x1a 2 WORD unknown0x1c 16 GUI D i nst ance i d0x2c 4 f l oat pol eHei ght0x30 4 f l oat sockLengt h0x34 1 BYTE Pol eCol or : bl ue0x35 1 BYTE Pol eCol or : green0x36 1 BYTE Pol eCol or : r ed0x37 1 BYTE Pol eCol or ? 0xf f0x38 4 BYTE[4] SockCol or0x3c 2 WORD f l ag: l i ghted ( TRUE = 0x0001)

    EXTRUSION BRIDGE

    offset length format description contents

    0x00 2 WORD I D 0x00120x02 2 WORD si ze0x04 4 DWORD l ongi t ude0x08 4 l ong l at i t ude0x0c 4 DWORD al t i t ude0x10 2 WORD f l ags0x12 2 WORD pi t ch0x14 2 WORD bank0x16 2 WORD headi ng0x18 2 WORD i mageCompl exi t y0x1a 2 WORD unknown0x1c 16 GUI D i nst ance i d

    0x2c 16 GUI D pr of i l e0x3c 16 GUI D mater i al set0x4c 12 DWORD[ 3] al t i t ude sampl e l ocat i on 10x58 12 DWORD[ 3] al t i t ude sampl e l ocat i on 2

  • 8/9/2019 FSX File structure.pdf

    24/31

    24

    0x64 4 f l oat r oad wi dt h0x68 4 f l oat pr obabi l i t y0x6c 1 BYTE suppress0x6d 1 BYTE pl acement count0x6e 2 WORD poi nt count

    and t hen f or each pol yl i ne obj ct

    pl acement16 GUI D pl acement i d

    and t hen f or each pol yl i ne poi nt4 DWORD l ongi t ude4 DWORD l at i t ude4 l ong el evat i on

    TRIGGER

    The record consists of a fixed part and a variable part. The fixed part is 34 byte long and has thefollowing structure:

    offset length format description contents

    0x00 2 WORD I D 0x00100x02 2 WORD si ze : var i abl e0x04 4 DWORD l ongi t ude0x08 4 DWORD l at i t ude0x0c 4 DWORD al t i t ude0x10 2 WORD al t i t udeI sAGL ( 0x00001 = TRUE)0x12 2 WORD pi t ch0x14 2 WORD bank0x16 2 WORD headi ng0x18 2 WORD i mageCompl exi t y0x1a 2 WORD unknown0c1c 16 GUI D i nst ance i d0x2c 2 WORD t ype ( 0x0000 = REFUEL_REPAI R,

    0x0001 = WEATHER0x2e 4 f l oat t r i gger Hei ght

    i n case of WEATHER t he vari abl e par t has t he f ol l owi ng st r uct ur e0x32 2 WORD t ype 0x0001 = RI DGE_LI FT

    0x0002 = UNI DI RECTI ONAL_TURBULENCEnot e: i n bgl comp. xsd t hi skeywor d i s spel l edNONDI RECTI ONAL_TURBULENCE, butt he compi l es does not under st andi t . I f you change the keywor d i nbgl comp. xsd compi l at i on i s ok.

    0x0003 = DI RECTI ONAL_TURBULENCE0x0004 = THERMAL

    0x34 4 f l oat headi ng0x38 4 f l oat scal ar0x3c 4 DWORD number of ver t i ces

    and then f or each ver t ex:4 f l oat Bi asX4 f l oat Bi asZ

    i n case of FUEL_REPAI R t he var i abl e par t has t he f ol l owi ng st r uct ur e0x32 4 DWORD f uel t ype and avai l abi l i t y

    BI TFI ELD:bi t 0- 1: t ype 73bi t 2- 3: t ype 87bi t 4- 5: t ype 100

    bi t 6- 7: t ype 130bi t 8- 9: t ype 145bi t 10- 11: t ype MOGASbi t 12- 13: t ype J ET

  • 8/9/2019 FSX File structure.pdf

    25/31

    25

    bi t 14- 15: t ype J ETAbi t 16- 17: t ype J ETA1bi t 18- 19: t ype J ETAPbi t 20- 21: t ype J ETBbi t 22- 23: t ype J ET4bi t 24- 25: t ype J ET5

    bi t 26- 29 : unusedbi t 30 : pi st on t ypebi t 31 : j et t ype

    f or al l except l ast t wo :0 = NO; 1 = UNKNOWN; 2 = PRI OR_REQUEST;3 = YES

    when type=UNKNOWN and avai l abi l i t y = YESt hen t ype=100 and t ype = J ETA both ar eset t o avai l abi l i t y=YES

    0x36 4 DWORD number of ver t i cesand then f or each vert ex

    4 f l oat Bi asX4 f l oat Bi asZ

  • 8/9/2019 FSX File structure.pdf

    26/31

    26

    Marker

    The marker record has a fixed length of 28 byte with the following structure:

    offset length format description contents

    0x00 2 WORD I D 0x00180x02 4 DWORD si ze 0x0000001c0x06 1 BYTE headi ng0x07 1 BYTE Type

    0 = I NNER; 1 = MI DDLE; 2 = OUTER3 = BACKCOURSE

    0x08 4 DWORD l ongi t ude0x0c 4 DWORD l at i t ude0x10 4 DWORD al t i t ude0x14 4 DWORD i dent ( speci al f ormat )0x18 2 WORD r egi on ( speci al f ormat )0x1a 2 wor d unknown 0x0000

  • 8/9/2019 FSX File structure.pdf

    27/31

    27

    Boundaryoffset length format description contents

    0 2 WORD I D 0x00202 4 DWORD si ze : var yi ng6 1 BYTE t ype 00 = NONE

    01 = CENTER 02 = CLASS_A03 = CLASS_B 04 = CLASS_C05 = CLASS_D 06 = CLASS_E07 = CLASS_F 08 = CLASS_G09 = TOWER 0a = CLEARANCE0b = GROUND 0c = DEPARTURE0d = APPROACH 0e = MOA0f = RESTRI CTED 10 = PROHI BI TED11 = WARNI NG 12 = ALERT13 = DANGER 14 = NATI ONAL_PARK15 = MODEC 16 = RADAR17 = TRAI NI NG

    7 1 BYTE BI T 0- 3: maxi mumAl t i t udeType

    BI T 4- 7: mi ni mumAl t i t udeType1 = MEAN_SEA_LEVEL ( = UNKNOWN)2 = ABOVE_GROUND_LEVEL3 = UNLI MI TED

    8 4 DWORD mi ni mum l ongi t ude of ar ea cover ed12 4 DWORD mi ni mum l at i t ude of area covered16 4 DWORD mi ni mumAl t i t ude * 100020 4 DWORD maxi mum l ongi t ude of ar ea cover ed24 4 DWORD maxi mum l at i t ude of ar ea cover ed28 4 DWORD maxi mumAl t i t ude32 2 WORD t ype f i el d of name r ecor d 0x1934 4 DWORD si ze of name r ecor d36 si ze- 6 STRI NG name

    on this follows a record describing the drawing of the lines

    offset length format description contents

    0 2 WORD I D 0x00212 4 DWORD si ze : var yi ng6 2 WORD number of poi nt s t o f ol l ow

    f or each poi nt 10 bytes0 2 WORD t ype of poi nt

    1 = START2 = LI NE3 = ORI GI N

    4 = ARC cl ockwi se5 = ar c count er- cl ockwi se6 = ci r cl eNB: i n case of ci r cl e, t he ent r i es f ormi ni mumAl t i t ude and maxi mumAl t i t ude over -r i de t he val ues i n st ar t i f bot h ar egi ven.t he start ent r y i s i n case of ci r cl enot needed at al lNote: t her e i s a bug i n the new ver si onof bgl comp. xsd: t he word BoundarySt arti n gr pBoundar yChi l dr en has t o be repl acedby St art , ot herwi se t he compi l er does not

    accept i t !2 4 DWORD l at i t ude of poi nt ( i n case of ci r cl e:

    unknown, = 0x0000)6 4 DWORD l ongi t ude of poi nt ( i n case of ci r cl e:

  • 8/9/2019 FSX File structure.pdf

    28/31

    28

    f l oat : radi us

  • 8/9/2019 FSX File structure.pdf

    29/31

    29

    Geopol

    fixed part:offset length format description contents

    0 2 WORD I D 0x00232 4 DWORD si ze : var yi ng

    6 2 WORD Bi t 0- 13: number of ver t i cesnumber of ver t i cesBI T 14- 15: t ype( 0x40 = BOUNDARY, 0x80 = COASTLI NE)

    8 4 DWORD mi ni mum l ongi t ude12 4 DWORD mi ni mum l at i t ude16 4 DWORD maxi mum l ongi t ude20 4 DWORD maxi mum l at i t ude

    variable part: for each vertex0 4 DWORD l ongi t ude4 4 DWORD l at i t ude

    Model data

    The model data structure has a fixed length of 24 bytes

    offset length format description contents

    0 16 GUI D name16 4 DWORD mdl f i l e of f set f r om t he st ar t of t hi s

    subsect i on20 4 DWORD mdl f i l e l engt h

  • 8/9/2019 FSX File structure.pdf

    30/31

    30

    ExclusionRectangle

    This record has a fixed length record of 20 bytesoffset length format description contents

    0 2 WORD excl usi on t ype0x0008 = excl udeAl lot her wi se:

    bi t 4 = BeaconObj ect sbi t 5 = Ef f ect Obj ect sbi t 6 = Gener i cBui l di ngObj ect sbi t 7 = Li br ar yObj ect sbi t 8 = Taxi waySi gnObj ect sbi t 9 = Tr i gger Obj ect sbi t 10 = Wi ndsockObj ect sbi t 11 = Ext r usi onBr i dges

    2 2 WORD si ze ( unused) 0x00004 4 DWORD l ongi t ude of NW cor ner

    8 4 DWORD l at i t ude of NW cor ner12 4 DWORD l ongi t ude of SE cor ner16 4 DWORD l at i t ude of SE cor ner

  • 8/9/2019 FSX File structure.pdf

    31/31

    31

    Namelist

    The namelist contains only one record of variable length. It consists of a fixed part and a variablepart. The fixed part is 42 bytes long and has the following structure:

    offset length format description contents

    0x00 2 WORD I D 0x00270x02 4 DWORD si ze ( ?) seems al ways t o be 0x000000000x06 2 WORD number of r egi on names0x08 2 WORD number of count r y names0x0a 2 WORD number of st at e names0x0c 2 WORD number of ci t y names0x0e 2 WORD number of ai r por t names0x10 2 WORD number of I CAO i dent .0x12 4 DWORD of f set of r egi on l i st ( f r om st ar t of

    record)0x16 4 DWORD of f set of count r y l i st

    0x1a 4 DWORD of f set of st ate l i st0x1e 4 DWORD of f set of ci t y l i st0x22 4 DWORD of f set of ai r port l i st0x26 4 DWORD of f set of I CAO i dent l i st

    The lists for region, country, state, city and airport names have all the same structure:

    an i ndex wi t h 1 DWORD f or each ent r y i n t he l i st , cont ai ni ng t he of f set of t hent h name f r om t he begi nni ng of t he names par t ( i . e. af t er t he i ndex)f ol l owed by the names i n f or m of zer o- t er mi nat ed st r i ngs

    The ICAO list has a different structure. It contains n entries (one for each ICAO name), each of

    them 20 bytes long, with the following structure;:

    offset length format description

    0x00 1 BYTE r egi on name i ndex ( al l i ndexes st art wi t h 0 f or t hef i r st name i n t he r el evant l i st)

    0x01 1 BYTE count r y name i ndex0x02 2 WORD bi t 4- 15 : st at e name i ndex

    bi t 0- 3 : unknown0x04 2 WORD ci t y name i ndex0x06 2 WORD ai r por t name i ndex0x08 4 DWORD I CAO i dent i f i er ( speci al f ormat )0x0c 4 DWORD unknown0x10 4 DWORD unknown

    Vector data in cvx files

    The cvx files contain terrain data in vetor format which can be produced with the Shp2Vecprogram. They are organized as the other bgl files, i.e. the data are contained in records groupedaccording to the QMID region they belong to. The vector data in the single records (or subsections)are compressed. Since the SDK does not contain a program which would allow to obtain the shapefiles back from the BGL files and since Microsoft has not published the algorithm with which thecompression is achieved, it is at present impossible to analyze the internal structire of the cvx files.The only way to obtain information about their contents is to load them into the TmfViewer programprovided with the SDK.