1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSX traffic files time format?

Discussion in 'Tools programming' started by garfield_x, 30/11/06.

  1. garfield_x

    garfield_x

    Joined:
    30/11/06
    Messages:
    72
    Country:
    netherlands
    I noticed that in the FSX traffic BGL files the time format/structure has been changed.

    Has anyone already information about this structure?
  2. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    Yup.
    I'm actually coding a software to create/manage AI boats schedule, but the boat BGL traffic format is very similar to aircraft.

    The AI times are now 32 bits. The lower 24 bits is relative time in period (0 = beginning of period, 2^24 = 16777216 = end of period). The period is encoded in the upper 8 bits :
    0 = 1hr, 1 = 2hr, etc up to 7 = 1 week. New periods are available : 2 weeks, 5 weeks and 8 weeks. Periods now begins on monday morning (not sunday).
    I've not experienced so much but the reference date for multiple week periods seems to be the first monday of the year.
    To get the time in hour, it's just like FS9 times: divide the relative time by 16777216 and multiply by the period duration

    The new time format is used in schedules and in crossing sector tables. Since the structures are now bigger, the database were affected new ids so that FS9/FSX traffic files can be easily distinguished.
    Last edited: 30/11/06
  3. garfield_x

    garfield_x

    Joined:
    30/11/06
    Messages:
    72
    Country:
    netherlands
    thx i will look on it.

    I'm busy with converting my ACA2005 to ACA2007 with FSX support.
  4. Mace

    Mace

    Joined:
    2/12/06
    Messages:
    997
    Country:
    us-missouri

    Keep in mind, that in the initial FSX SDK release, the date values (Monday, Tuesday, etc.) appear to have been listed incorrectly. I have not yet checked to see if this was corrected with SP1.

    Our flag avatars look about the same as your all's...Missouri flag vs. French flag. vs. Dutch flag. :)
  5. Mace

    Mace

    Joined:
    2/12/06
    Messages:
    997
    Country:
    us-missouri
    I believe that is correct. And isn't that a change from FS2004? in FS2004, wasn't 0 = Sunday, 1 = Monday?

    I have done further research into this matter, and I have found that in the FSX SDK, it says 0 = Sunday, 1 = Monday, etc. The SDK is incorrect here, and you are very correct.

    In FS9: 0 = Sunday, 1 = Monday, etc.
    *****In FSX: 0 = Monday, 1 = Tuesday, etc.*****

    If this is true, (and I believe that it is), when converting FS9 AI flight plans to FSX, you have to make sure you subtract 1 from the date, and change 0 dates to 6. (0 was Sunday in FS9 but now in FSX 6 = Sunday.)
  6. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    The SDK is also missing the definition of new periods (TWO_WEEKS, FIVE_WEEKS, EIGHT_WEEKS) which is to my mind the major improvement of AI in FSX. Most real airlines schedules are bi-weekly and could now be correctly used in FS.

    It's also missing the very interesting international slang words list, used to prevent G-OOFY or F-UCKE to be valid ac registrations :laughing:
  7. garfield_x

    garfield_x

    Joined:
    30/11/06
    Messages:
    72
    Country:
    netherlands
    Finally found time to work on the time format and managed to get it working.
    Thx.

    I do not get this. Where or how i can see what BGL file is for FS9 or FSX?
  8. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    [/quote]
    By looking at the DatabaseID field of database descriptors. The database descriptors appears just after the 168 bytes BGL header.

    ID =
    1 = Airports (FS9/FSX)
    2 = Aircrafts and boats (FS9/FSX)
    3 = Flightplans (FS9)
    4 = Traffic sectors (FS9)
    5 = Flightplans (FSX)
    6 = Traffic Sectors (FSX)
    7 = Boat routes (FSX)

    A FS9 traffic compiler (TTools or FS9 TDBB) wil generate only databases 1,2,3,4 in a file
    whereas a FSX compiler will build 1,2,5,6 or 2,5,6,7 for boat traffic.
    The format of records in a database #5 (FSX plans) is just the same as #3, excepted that time records are 32 bits instead of 16. The same rule applies for db #6
  9. garfield_x

    garfield_x

    Joined:
    30/11/06
    Messages:
    72
    Country:
    netherlands
    I got it, thx a lot!

Share This Page