Ray Proudfoot Posted May 14, 2019 Report Posted May 14, 2019 Hi John, I'm currently using a LUA script to count the number of Ai in P3D v4 using the offset 025C. But that only gives the total count and doesn't differentiate between ground and airborne. I've looked though the Offsets file but can't find anything that would give me this info. I still use Traffic Look and that can show them separately. Is it possible to do the same via LUA?
John Dowson Posted May 15, 2019 Report Posted May 15, 2019 Hi Ray, it doesn't look like this information is easily accessible via Lua. You may be able to differentiate between airborne/ground traffic by counting the number of non-zero entries in the ground/airborne traffic data offsets at E080 / F080, but I'm not 100% sure. I'll take a look in a bit more detail later in the week (and check with Pete!). Cheers, John
Ray Proudfoot Posted May 15, 2019 Author Report Posted May 15, 2019 Thanks John. I'll wait until Pete has had a chance to reply. No great hurry.
Ray Proudfoot Posted May 15, 2019 Author Report Posted May 15, 2019 Hi John, Pete has suggested I request this feature but it’s not urgent so fit it in when you’re able. With so many Ai from the AIG package injected into P3D it would be helpful to know how many are ground based and airborne. That would help when assessing the impact of Ai on fps when pushing P3D hard for best performance. I understand the Ai bubble is 80nm. So when I’m sitting at EGLL and the count currently says 300 that’s taking into account Ai at Gatwick, London City, Stansted and Luton plus those overhead. Oh, and Northolt too perhaps. Knowing how many ground Ai just at Heathrow would be helpful. So as well as separating ground & airborne is it possible to filter by airport?
spokes2112 Posted May 15, 2019 Report Posted May 15, 2019 Ray, This may be a perfect project for a gauge rather than a ipc/simconnect lookup. Using a gauge allows an easy user interface such as distance from current location, etc.. Downside of course is that the gauge needs to be installed in each of your testing aircraft. Since it is just for performance testing, not really a bad downside. All the variables needed are there.. (Referencing FSX, but checked the P3D SDK, all good) P3D References -http://www.prepar3d.com/SDKv4/sdk/references/variables/custom_variables.html FSX References - FSX SDK (not ESP SDK) FSX\SimObjects\Misc\ControlTower\panel FSX\Gauges\Radar.cab ______________________________________________________________________________ C CLASS | CLASS NAME | UNITS | SETTABLE | DESCRIPTION ITrafficInfo | Radius | meters | Yes | The radius from the user aircraft (or tower) to use to collect data on nearby aircraft or vehicles. ITrafficInfo | Latitude | radians | Yes | The latitude of the point the search is to be made from. ITrafficInfo | Longitude | radians | Yes | The longitude of the point the search is to be made from. ITrafficInfo | Filter | enum | Yes | One or more of the following values combined: TRAFFIC_FILTER_AIRCRAFT = 1, TRAFFIC_FILTER_GROUND_VEHICLES = 2, TRAFFIC_FILTER_TOWER_CONTROLLERS = 4, TRAFFIC_FILTER_ON_GROUND = 8, TRAFFIC_FILTER_IN_AIR = 16, TRAFFIC_FILTER_SLEEPING = 32, TRAFFIC_FILTER_AWAKE = 64 ITrafficInfo | ListSize | number | No | The length of the list of vehicles returned after a search. The index numbers of the returned list will be from 0 to ListSize - 1. ______________________________________________________________________________ If you are interested I may be able to help in creating one - a perfect morning coffee project. 😉 ☕ Roman
Ray Proudfoot Posted May 15, 2019 Author Report Posted May 15, 2019 Roman, I appreciate your kind offer but a gauge would not appeal. Running WideFS on a second computer does allow me to display info of this type in a small window which is ideal for me. Is it possible it could be achieved via a executable instead?
spokes2112 Posted May 15, 2019 Report Posted May 15, 2019 (edited) The gauge can/would output lvars for you. From there you could do a lua to display of the values - but - Setting the lookup radius would have to be done via the gauge - or - a default value in the lua. Thinking more, just may run with it as a "fun" type project to do.. An extra "wake me up" for the morning. Will start tomorrow morn - to darn nice outside, finally!! 😉 Roman EDIT - An exe just may/could be made. ( or at least experimented with ) Just checked FSUIPCClientDLL code examples and it "looks" like everything is there. Will go the gauge route 1st to get the code flow then maybe go the exe route.. (it would take a while for the exe) Edited May 15, 2019 by spokes2112 Checked Paul Henty's excellent FSUIPCClientDLL for AITraffic services
Ray Proudfoot Posted May 15, 2019 Author Report Posted May 15, 2019 Thanks Roman. You are a clever chap being able to do things like this. I'm sure others will be interested in this too. PM me if you want me to test an executable across WideFS.
spokes2112 Posted May 16, 2019 Report Posted May 16, 2019 Ray, Guess I didn't have enough coffee yesterday.. Forgot to look at the lua library - flags & l:var read/write are not available on wideclient. A gauge server to lua works great (see image) but only on the local FS computer. I wanted to give it some user adjustability, namely the AI lookup radius & AI lookup timing. ( the latter dependant on the users sim performance - kind of important ) In order to do this and run it on wideclient it would have to be: gauge server < --- > local sim lua < --- > fsuipc user offsets (or ipc. get/set) < --- > wideclient lua Each of the 4 parts need to "talk" to its neighbor in the logic chain. Kind of a mess to say the least.. So it looks like an exe will be the route.. Not the best as a self taught hobbyist doing exe programming so it will take a while. Another project for tomorrow's coffee 😉
Ray Proudfoot Posted May 16, 2019 Author Report Posted May 16, 2019 Hi Roman, Thanks for your news. Unfortunately the image isn’t showing. If you’re able to provide an exe that can retrieve data via WideFS I am happy to wait I’m using a utility that shows Ai in P3D and it runs across WideFS. But it’s difficult for it to provide the data in a simple format to fit into a small space. You can find Ai Companion here. https://www.alpha-india.net/forums/index.php?topic=29651.0 Hopefully it won’t prove difficult for you and being able to filter either by distance or ICAO and show counts by the Ai status would be very useful both for me and many others I think. Maybe less coffee and more tea - English perhaps. 😉👍 1
spokes2112 Posted May 19, 2019 Report Posted May 19, 2019 Hi Ray, Big problems here.. Using FSUIPC limits the count of both on ground and in air AI to 96 each. Are you sure Ai Companion runs over Wideclient? Rather I am thinking it is possibly simconnect instead in order to get over the 96 each max count. Simconnect is out of my league.. I could however use a server gauge in the test aircraft to get a full count "and" be able to center on an ICAO too.. Something that doesn't seem possible using the FSUIPC route. The program is to the point of integrating a XML gauge.. Your thoughts? Would using a server gauge, needed to be installed in the test aircraft be too much? Roman
Ray Proudfoot Posted May 19, 2019 Author Report Posted May 19, 2019 Hi Roman, Aii Companion uses a combo of WideFS and SimConnect across a network but purely SimConnect when run on the same PC as P3D. Bear in mind AiC is designed to be used with AIG Ai Traffic which is designed for P3D v4 only. I notice you're testing with FSX. Would FSUIPC5 have the same limitation? Maybe Pete or John can answer that question. A gauge would not be something I would want to use, sorry. This was something desirable rather than essential. Thank you for your efforts.
Pete Dowson Posted May 19, 2019 Report Posted May 19, 2019 3 hours ago, spokes2112 said: Big problems here.. Using FSUIPC limits the count of both on ground and in air AI to 96 each. Yes, the tables are in limited offset space, so are of fixed allocated size. You need a SimConnect interface. John and i will be discussing adding these values as offsets, but in FSUIPC5 only, and not immediately. It'll be listed along with other things. Pete 1
spokes2112 Posted May 19, 2019 Report Posted May 19, 2019 4 hours ago, Ray Proudfoot said: A gauge would not be something I would want to use, sorry. This was something desirable rather than essential. Thank you for your efforts. Ray, Yes I understand.. Wish that it could be stand a alone for the biggest airports.. It works great up to those biggest traffic areas though. EGLL was just above the limits until the traffic started flowing, it then settled down to below the limits. Going to keep going just for the learning experience, only a few meters away from the finish line. 😉 Why stop now? Paul Henty's newest module has some great new features haven't seen before and this little project will use them. Will advise when finished, even if not interested.. It's not a big deal - the learning experience is worth it! Roman
Ray Proudfoot Posted May 19, 2019 Author Report Posted May 19, 2019 Roman, it’s all a learning experience. Once John and Pete make changes the info should be easier to extract and display. Good luck!
John Dowson Posted May 20, 2019 Report Posted May 20, 2019 Hi Ray, you can try this version (v5.5151b): FSUIPC5.txt (its the dll - download & rename to FSUIPC5.dll). I've added the total ground AI at offset 02A2, and airborne AI at offset 02A4, both 16-bit (U16). No filter by airport I'm afraid. You can get the distance from you in the readable offsets previously mentioned, but only the first 96 each of airborne/ground. Cheers, John 1
Ray Proudfoot Posted May 20, 2019 Author Report Posted May 20, 2019 Thanks John, that’s good of you. I’ll try it in the next day or so and report back.
John Dowson Posted May 21, 2019 Report Posted May 21, 2019 Hi Ray, please try this updated version (still 5.151b): FSUIPC5.txt This contains some corrections for AI trafiic transitioning from air-to-ground and ground-to-air. Cheers, John
John Dowson Posted May 21, 2019 Report Posted May 21, 2019 (edited) Hi Ray, the bits I had used to flag for ground/airborne were already in use elsewhere, creating a conflict. Sorry about that. Please try this version: FSUIPC5.txt Cheers, John Edited May 21, 2019 by John Dowson attachment corrected
Ray Proudfoot Posted May 21, 2019 Author Report Posted May 21, 2019 Hi John, Logs sent to your email. It's looks good. Many thanks for adding this. 👍
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