• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX BGL Airport Records

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,853
Country
unitedkingdom
I've started a new thread with this question as the one related to BGLAnalyzeX is becoming very long.

I think I was up too late last night and my brain is not working very well today :eek:

In Winfried's document on BGL format he gives formulas for converting the lat/lon values:

(double) Lon = (DWORD) Lon * (360.0 / (3 * 0x10000000) – 180.0
(double) Lat = 90.0 - (DWORD) Lat * (180.0 / (2 * 0x10000000)

I seem to see missing brackets and also these do not produce any sensible numbers for me - could some kind soul take pity and give me the Math 101 on this please?

Also I noted the dicussion on AirportTestRadius - am I correct in that this is used by the compiler but the information is not stored in the bgl? If not where is that information in the record? Second is TrafficScalar new and again where is it in the airport record please?

thanks guys :)
 
Messages
36
Country
spain
Hi Jon,

From the BGLXML code I use:

Code:
        private double fsLat2Lat(UInt32 fsLat)
        {
            double f = (((double)fsLat) * 180) / 536870912; //MAXSOUTH;
            if (f > 90.0)
                return -((f - 180) + 90);
            else
                return 90 - f;
        }
        private double fsLon2Lon(UInt32 fsLon)
        {
            double f = (((double)fsLon) * 360) / 805306368; //MAXEAST;
            return f - 180;
        }

It seems to work :)

Regards,
Javier.
 

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,853
Country
unitedkingdom
Thanks Javier

I will give that a try :)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi Jon,

So combining that information it seems like the brackets should be like this (which looks familiar from the stuff I looked at before):

Code:
(double) Lon = (DWORD) Lon * (360.0 / (3 * 0x10000000)) – 180.0
(double) Lat = 90.0 - (DWORD) Lat * (180.0 / (2 * 0x10000000))

Also I noted the dicussion on AirportTestRadius - am I correct in that this is used by the compiler but the information is not stored in the bgl? If not where is that information in the record? Second is TrafficScalar new and again where is it in the airport record please?

Yes, that is correct. The AirportTestRadius is only used by the compiler to generate warnings. That must also be why Winfried uses a default value for it in his decompiler (and big airports thus start giving such errors).

I have not looked at the TrafficScalar though, I would imagine it is in the BGL file somewhere. Or else it looks like a parameter that is not really used.
 

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,853
Country
unitedkingdom
I have not looked at the TrafficScalar though, I would imagine it is in the BGL file somewhere. Or else it looks like a parameter that is not really used.

Thanks Arno - It's not in the primary airport record as far as I can see but I'm not through everything in the other airport records yet so it might be there :)
 
Messages
8,893
jon

Both the traffic scaler and test radius is new for FSX.

I have also noted that warnings are given for the test radius at small airports when compiling so I started using 5000M as a standard for all compiled airports. That number takes care of airports like Halifax which gave me warnings all the way up to Atlanta when I added the 5th runway way south of the ARP.

Scaling is a AI Traffic scaler used when developing Flightplans with the TrafficDatabaseBuilder.

It tells the compiler how heavily to schedule traffic at each airport. It has no effect at runtime. It's only used when the traffic database is created.

It appears to do nothing in the header of a compiled airport because it is used when the Flightplan is compiled although the FP compiler needs that piece of data in the airport record to create the flight plans with the TDB.

The end result is that 30 percent parking stays vacant on startup even though a compiled FP overloaded the parking for that airport.
 
Messages
74
Country
germany
Hi,
in the description there are indeed some brackets missing (not in the program code :) ).
The TrafficScaler is stored in the Airport record within the DWORD added in FS X at the end of the fixed part of that record. Apparently MS has used always the same value, but developpers might want to change that.
 

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,853
Country
unitedkingdom
Hi,
in the description there are indeed some brackets missing (not in the program code :) ).
The TrafficScaler is stored in the Airport record within the DWORD added in FS X at the end of the fixed part of that record. Apparently MS has used always the same value, but developpers might want to change that.

Ah is that the extra four bytes which seem to be in the FSX airport record compared to the FS9 record?
 
Messages
288
Country
us-washington
Hi,
in the description there are indeed some brackets missing (not in the program code :) ).
The TrafficScaler is stored in the Airport record within the DWORD added in FS X at the end of the fixed part of that record. Apparently MS has used always the same value, but developpers might want to change that.

Up to FS9 we used a hardcoded ratio of parking spots to AI traffic. For FSX we exposed a scalar to allow throttling AI traffic at certain airports. There were some airports, in Russia notably, but also elsewhere, that the combination of many parking spots and a minimal taxiway infrastructure (or choke points) resulted in gridlock. The TrafficScalar allows us to help eliminate this problem.

-Doug
 

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,853
Country
unitedkingdom
Hi Doug

So the Scalar is the extra DWORd in the Airport Record?

Ah! - I should read the posts above more carefully - that is what Winfried is saying :eek:

Am I right in thinking that the scalar value is the value in that DWORD /65536???

Thanks
 
Last edited:
Top