plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

darkclown avatar image
darkclown asked Arzop commented

SubscribeToFacilities / RequestFacilitiesList returns the same 1234 aiports in the callback 31 times

I already seen this post on the MSFS2020 forums: SubscribeToFacilities/RequestFacilitiesList: Only returns the first 1243 airports but wanted to echo it here.

Anyone have a workaround for this? I'm trying to get a list of Airports around the user's aircraft. This would also be a lot easier if RequestFacilitiesList had a radius like RequestDataOnSimObjectType or if RequestDataOnSimObjectType could take a SIMBOJECT_TYPE.AIRPORT

thanks, Jeff

simconnect
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Arzop avatar image
Arzop answered Arzop commented

Hi,

For SU9, we fixed RequestFacilitiesList which send X the same message. From Su9, RequestFacilitiesList sends the entire list of airport but we couldn't restore its original behaviour because some addons used the broken behaviour, we couldn't change it. So, here is a little recap of what we did (SU10):

  • RequestFacilitiesList
    • Airport: Still return the all list of airport around the world (~ 40 000)
    • Vor/Ndb/Wpt: Return the list of element around you
  • SubscribeToFacilities
    • Airport: Does nothing because the all list has already been returned
    • Vor/Ndb/Wpt: That has been fixed. Work as expected
  • RequestFacilitiesList_EX1
    • Airport: Return the list of airport around you
    • Vor/Ndb/Wpt: Return the list around of element you
  • SubscribeToFacilities_EX1
    • Airport/Vor/Ndb/Wpt : Send a message each time an airport/vor/ndb/wpt goes in/goes out the 200 miles around you (according what you want)

So to get the list of airport around you, please use RequestFacilitiesList_EX1.


Best Regards

Maxime / Asobo

2 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Simbol avatar image Simbol commented ·

@Arzop

Right that makes sense, thanks for the quick response, so the problem we have is the documentation is not clear about this behaviour trowing us out of base.


I will change the code to use EX1 instead for efficiency purposes.

Thanks for clarifuing and providing further information.

@Boris_ if you guys could flag some how to put this in the SDK doc for SU10 it would be great, currently the description of RequestFacilitiesList_EX1 is just saying this:


The SimConnect_RequestFacilitesList_EX1 function is used to request a list of all the facilities of a given type currently held in the facilities cache.

This function is currently a simple alias for SimConnect_RequestFacilitesList, designed to be used with the other *_EX1 functions so that naming consistency can be maintained and code can be easier to track.


While the RequestFacilitiesList has a similar description, so it is confusing and not clear :)


Thanks to all for the help.

Best Regards,
Raul

0 Likes 0 ·
Arzop avatar image Arzop ♦♦ Simbol commented ·
@Nocturne FYI
0 Likes 0 ·
BenBaron85 avatar image
BenBaron85 answered

Hi Jeff,

as far as I know this is just broken. When I was trying with that I even did not receive the airport I was actually closest to...which was the only one I was interested at.

Asobo is planning on implementing something new for that this year. So I doubt they will bother fixing the current mechanic.

Greets,

Ben

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello @darkclown @BenBaron85 .

We were able to reproduce the problem and will look for a fix.

Regards,
Sylvain

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello.

This issue will be fixed with SU9.

Regards,
Sylvain

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Simbol avatar image
Simbol answered

@FlyingRaccoon when you say this is fixed, do you mean receiving the closest airport? I am using this to find the airport where the user is sitting at, and unfortunately I am receiving 41,019 airports on the list (1243 x 33 times) including airports that are over 3500 miles away. For example, I am sitting at EGKA and I received all the airports in Canada and beyond..

I did a quick algorithm to compare the lat / lon vs the airplane current position and I am able to determine what is airport the user is sitting at. However it seems quiet inefficient having to compare against 41,019 airports to determine where the user is.. I thought SimConnect RequestFacilitiesList is supposed to return the current airports in the reality bubble as explained on the SDK:

Remarks
The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft. This radius varies depending on where the aircraft is in the world, but is at least large enough to encompass the whole of the reality bubble for airports and waypoints, and can be over 200 miles for VOR and NDB stations. As the user aircraft moves facilities will be added to, and removed from, the cache. However, in the interests pf performance, hysteresis is built into the system.


To receive event notifications when a facility is added, use the SimConnect_SubscribeToFacilities function. When this function is first called, a full list from the cache will be sent, thereafter just the additions will be transmitted. No notification is given when a facility is removed from the cache. the Obviously to terminate these notifications use the SimConnect_UnsubscribeToFacilities function.


However this doesn't seem to be the case since I am getting airports across the next continent? is it the documentation wrong? or the function is not working as intended?

Thanks in advance for any help.

Best Regards,
Raul

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.