Closed TwinFan closed 5 years ago
Number 1.
didn't fully work out...X-Plane limits the number of aircraft as returned by XPLMCountAircraft
to the number of configured AI planes. I can (and do now) set more than that with XPLMSetActiveAircraftCount
...but X-Plane simply doesn't accept more than there are AI planes.
So plugins could read all multiplayer dataRefs and just try...(like apparently X-TCAS does)...but if they rely on XPLMCountAircraft
(Little Xpconnect of Little Navmap does, e.g., as does the internal X-Plane map and internal TCAS implementations in the Garmin instruments) they stop at the number of configured AI planes despite LT offering more planes.
The other implementations worked:
Also, LT/xplanemp now
keeps the correct XPLMSetActiveAircraft
count valid outside drawing callbacks (previously this was only explicitly set during gauge drawback phase) except for the aircraft drawing phase, so it effectively reversed the TCAS hack logic: Instead of activating them briefly for gauge drawing AI planes are now briefly deactivated during aircraft drawing callback phase.
Previously, the aircraft count was back to 1 outside drawing callbacks, which made LittleNavmap believe there aren't any as it works based on a timed callback, not a drawing callback. Now the count is where it should be also outside drawing callbacks and LNM works.
deactivates AI for all planes...that helps also quite a bit to reduce confusion about current position and movement
Current Situation / Problem The multiplayer uses just 3 dataRefs to control AI planes for TCAS blibs. While this is apparently OK for that purpose (TCAS is reported to work very good, so let's be careful with any change in this area) it is a bit few for other applications:
Suggested Solution
i.e. the position. xplanemp doesn't have all information for which there are
sim/multiplayer
dataRefs, especially the lib does not have any info on the movement of the plane (speeds) as it just asks current position with every frame. But things like heading, roll, pitch should be no problem.Alternatives Also see #86 for an API on LiveTraffic's dataRefs. That will be the ultimate solution. So effort we put into this issue will be limited to a reasonable amount.
Benefits AI planes should be better handled in other apps like map, Little NavMap, ABC.
Additional context Ad 2.
XPMPDefaultPlaneRenderer
could easily count actual TCAS planes and was probably meant like that in theint tcas
variable (there is, bad coding, abool tcas
variable in an included loop, too, fix that double-name also along the way), but this one gets set only once in the very beginning and thereafter stays constant: