Jump to content
The simFlight Network Forums

Offset 0x0658


SWhite

Recommended Posts

G'day,

I see offset 0x0658 is returning the "nearest" airfield as determined by the nearest GPS function.  IE: what you select when you want to navigate to an airfield in the" nearest" airfield list.

I thought it would be the "closest" airfield. Is this correct and if so is that an Asobo bug?

 

Link to comment
Share on other sites

FSUIPC receives a list of all airports in the aircrafts "reality bubble" from MSFS, then calculates the distance of each from the aircraft, and then populates 0x0658 with the nearest 6 airports.

FSUIPC uses the SimConnect function  Simconnect_RequestFacilitiesList to get the list of airports. This has recently been stated as being "fixed" in the latest MSFS release (1.9.5.0), however the SDK documentation for this function still lists this as 'bad response' and 'all facilities lists are empty', so I'm still not 100% sure this is fully working yet.

I've just taken a quick look and there seems to be various issues. I am getting plenty of airports through from SimConnect (36974 in total!), but many don't seem quite right (e.g. invalid ICAOs). Also, it seems that FSUIPC7 is only determining the closest one, and then repeating this 6 times in offset 0x0658. To check the full list in that offset, you can go to Log->Custom, and enter x20. You should then see the complete list of the 6 nearest airports (in your log).

Not sure what's going on yet, I'll look into this more tomorrow. But, the offset should contain the 6 closest airfield (as determined by FSUIPC) from the list of airports in the aircrafts reality bubble as received from MSFS.

John

 

 

Link to comment
Share on other sites

Just checked the list received from MSFS and it seems to contain each airport around 30 times! This is why its finding the same airport 6 times as the closest 6.
Could you try adding the logging I mentioned in the previous post to see if you also get the same airport 6 times - if so, I'll report to Asobo and see if I can add a temporary fix to ignore the duplicates.

 

Link to comment
Share on other sites

Thanks John,

Yep, the log shows the same location 6 times.

Right now I am parked at OMAN but the log shows OI02 as being nearest but that is 493 km away. There are lots of airports closer.

I swear though that yesterday, every time I chose a new airfield from the nearest page on the TBM the API returned that airport. I switched it like 5 times by doing that.

It seems Asobo have a bug or two. Who'd have though!

Link to comment
Share on other sites

2 hours ago, SWhite said:

Right now I am parked at OMAN but the log shows OI02 as being nearest but that is 493 km away.

Yes, it seems to return all airports except those that are closest to you!

2 hours ago, SWhite said:

I swear though that yesterday, every time I chose a new airfield from the nearest page on the TBM the API returned that airport. I switched it like 5 times by doing that.

It seems Asobo have a bug or two. Who'd have though!

Yes, it seems that the latest release introduced this bug - but the release note stated that this functionality had been fixed! I'll report to Asobo.

Link to comment
Share on other sites

  • 1 year later...

I haven't checked this since the last time over a year ago (October 2020). I will take another look when time permits, although there isn't much I can do if the data returned from the SimConnect_RequestFacilitiesList call doesn't actually contain the closest airports, which was previously the case. It is FSUIPC that determines which are the 6 closest from the complete list received.

If the closest airports aren't being returned, I don't think there is much else that can be done in FSUIPC. 

John

Link to comment
Share on other sites

26 minutes ago, roland_lfor said:

So I guess I need to build my own search algo using runways list in CSV files created by MakeRunways utility.

Yes, you could try that if all the information you need is available in the MakeRunways output files. Be aware that these are large as they contain all airports/runways, so you might find that this will take a while processing such a large amount of data... Good luck if you try this! 

Cheers,

John

Link to comment
Share on other sites

  • 2 weeks later...

Finally I have my code for searching nearest airport and runway ready.

Before deep optimization it's quite fast. I've not measured precisely but it takes no more than around 1/3 sec. to return results.

So it's very suitable with my app needs.

At script start I load the whole CSV content into a lua string to avoid I/O access.

Link to comment
Share on other sites

15 hours ago, roland_lfor said:

I've not measured precisely but it takes no more than around 1/3 sec. to return results.

That sounds pretty good!

15 hours ago, roland_lfor said:

Finally I have my code for searching nearest airport and runway ready.

Maybe you could share it in the User Contributions sub-forum?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.