SWhite Posted October 15, 2020 Report Posted October 15, 2020 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?
John Dowson Posted October 15, 2020 Report Posted October 15, 2020 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
John Dowson Posted October 15, 2020 Report Posted October 15, 2020 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.
SWhite Posted October 16, 2020 Author Report Posted October 16, 2020 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!
John Dowson Posted October 16, 2020 Report Posted October 16, 2020 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.
roland_lfor Posted February 7, 2022 Report Posted February 7, 2022 Hello, I'm trying to adapt my RAAS system written in lua from P3D to MSFS. Unfortunately the SimConnect function is still buggy and send inconsistent results on the 6 airports positions. Did someone have another path to get the nearest airports?
John Dowson Posted February 7, 2022 Report Posted February 7, 2022 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
roland_lfor Posted February 8, 2022 Report Posted February 8, 2022 Thank you John. So I guess I need to build my own search algo using runways list in CSV files created by MakeRunways utility.
John Dowson Posted February 8, 2022 Report Posted February 8, 2022 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
roland_lfor Posted February 8, 2022 Report Posted February 8, 2022 I'm generally impressed with lua performance, I'll let you know. My R4.csv contains almost 90 000 entries with only native MSFS runways (empty community).
roland_lfor Posted February 18, 2022 Report Posted February 18, 2022 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.
John Dowson Posted February 19, 2022 Report Posted February 19, 2022 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?
roland_lfor Posted February 20, 2022 Report Posted February 20, 2022 I'll probably release my RAAS system as a freeware when I'll be happy with it 🙂
John Dowson Posted February 20, 2022 Report Posted February 20, 2022 1 hour ago, roland_lfor said: I'll probably release my RAAS system as a freeware when I'll be happy with it 🙂 👍
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now