XPMP 2 and XPMP2 Remote Client
The original X-Plane Multiplay Library is the work of many fantastic people, with Ben Supnik, Chris Serio, and Chris Collins appearing in recent files and documentation. But the origins date back to 2004, and very likely many more were involved. Thanks to all of them!
This complete re-implementation honours all the basic concepts (so I hope) but makes use of 2 modern X-Plane 11 concepts:
- instancing, and
- TCAS Override
Thus, it ports the idea of the library also into the times of Vulkan and Metal when the drawing mechanisms used by the original library no longer work.
At the same time, using instancing marks basically all parts of the original rendering code
of the library outdated...it is basically replaced by one line of code calling
XPLMInstanceSetPosition
.
Concepts like the syntax of the xsb_aircraft.txt
file or certainly the idea of an
multi-pass matching to find a good model are retained, though re-implemented (read: can have new bugs).
Added is support for synchronizing planes across the network with the remote machines running the included XPMP2 Remote Client.
XPMP2 does no longer call any OpenGL function and hence does not require to be linked to an OpenGL library. The included XPMP2 Remote Client and XPMP2-Sample applications do not link to OpenGL.
Despite its new approach, XPMP2 shall be your drop-in replacement for libxplanemp: The original header files are still provided with the same name. All original public functions are still there. The original XPCAircraft class is still there, now derived from XPMP2::Aircraft. See here for more details.
Pre-Built Library Release
If you don't want to build the library yourself you can find archives with headers and release/debug builds in the Release section here on GitHub.
Status
Available, and should be rather reliable now. No (major) bugs are known. Future development can certainly extend functionality while trying hard to stay backward compatible.
The XPMP2 library has been successfully tested with
- X-Plane 11.50 RC3 under OpenGL, Vulkan, and Metal,
- the enclosed XPMP2 Remote Client,
- the enclosed sample plugin,
- LiveTraffic v2.20
- X-Pilot 1.3
- on Mac OS,
- Windows, and
- Linux (Ubuntu 18.04 and similar).
Apparently, also the X-Plane version of the IVAO Altitude client seems to be built upon XPMP2.
Requirements
- XPMP2 implements instancing, so it requires X-Plane 11.10 or later
- CSL models in OBJ8 format (ie. older OBJ7 models are no longer supported)
GitHub pages
Documentation: See...on requirements, API, building, deployment, TCAS target, CSL mode dataRefs and more is available in the GitHub pages.
Sample Plugin
This package comes with a sample plugin in the XPMP2-Sample
folder. It is a complete
plugin including build projects and CMake setup. It displays 3 aircraft flying circles
in front of the user's plane. Each of the 3 aircraft is using a different technology:
the now recommended way of subclassing XPMP2::Aircraft
, the legacy way
of subclassing XPCAircraft
(as used by LiveTraffic v1.x), and by calling
standard C functions.
The HowTo documentation includes how to install the sample plugin, especially also CSL models.
Main Features
Model Matching
The way how XPMP2 picks any of the available CSL models for display is documented here.
Enhancing CSL Models
CSL packages come in different flavours. Popular ones for general use are
the Bluebell and the X-CSL packages. Both come with different history.
For XPMP2 to use all their features (all liveries, turning rotors, props, wheels...)
it needs to adapt their .obj
files. Performing these changes is built into XPMP2,
details here.
XPMP2 offers a wide range of animaton dataRefs that can be used in CSL models, details here.
TCAS and AI/multiplayer Support
XPMP2 provides TCAS blibs and AI/multiplayer data using TCAS Override introduced with X-Plane 11.50 Beta 8. Find details here including a reference lists of provided dataRef values and their sources.
When TCS Override is not available (like up to X-Plane 11.41), then TCAS is provided by writing the classic multiplayer dataRefs directly.
Beyond the standard set of information by X-Plane's family of dataRefs, XPMP2 also supports a set of shared dataRefs for providing textual aircraft and flight information, details here.
Map Layer
XPMP2 creates an additional layer in X-Plane's internal map, named after the
plugin's name. This layer displays all planes as currently controled by XPMP2
with an icon roughly matching the plane type, taken from Resources/MapIcons.png
.
XPMP2 Remote Client: Synchronizing Planes across the Network
Planes displayed using XPMP2 can by synchronized across the network. The included XPMP2 Remote Client needs to run on all remote computers, receives aircraft data from any number of XPMP2-based plugins anywhere in the network, and displays the aircraft using the same CSL model, at the same world location with the same animation dataRefs.
This supports usage in setups like
- Networking Multiple Computers for Multiple Displays,
- Networked Multiplayer,
- but also just locally as a TCAS Concentrator, which collects plane information from other local plugins and forwards them combined to TCAS and classic multiplayer dataRefs for 3rd party add-ons.
For end user documentation refer to LiveTraffic/XPMP2 Remote Client documentation.
For more background information refer to GitHub XPMP2 documentation.