catcarbon / XPMP2

Multiplayer library for X-Plane 11 using instancing and TCAS override. Reimplementation of libxplanemp.

Home Page:https://twinfan.github.io/XPMP2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XPMP 2 and XPMP2 Remote Client

Build all Platforms

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:

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

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)

Documentation: See GitHub pages

...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

For end user documentation refer to LiveTraffic/XPMP2 Remote Client documentation.

For more background information refer to GitHub XPMP2 documentation.

One of many possible setups: XPMP2 in a Standard Networked Setup

About

Multiplayer library for X-Plane 11 using instancing and TCAS override. Reimplementation of libxplanemp.

https://twinfan.github.io/XPMP2/

License:Other


Languages

Language:C++ 72.3%Language:C 23.9%Language:CMake 2.5%Language:PowerShell 0.7%Language:Shell 0.4%Language:Makefile 0.2%Language:Batchfile 0.1%