Author: Tyler Young

New Python tools for working with airport data

Over the weekend, I published a Python package called xplane_airports. This serves two major use cases:

  1. Parsing the airport data (apt.dat) files used by X-Plane, and asking questions like “does <some airport> support <some feature>?”
  2. Nicely wrapping the X-Plane Scenery Gateway’s API to get information about the airports available there. This includes the ability to download scenery packs and manipulate them just like you would an apt.dat on disk.

If you’re doing any sort of automated analysis or manipulation of X-Plane airports, this should be a huge help.

It’s available via pip now:

$ pip install xplane_airports

And there’s a ton of documentation in the project’s README on GitHub.

Bug reports, feature requests, & pull requests are all welcome. 🙂

Posted in Tools by | Leave a comment

Joystick Features Coming in X-Plane 11.30

A custom joystick response curve in the upcoming 11.30 update

As you may have seen on our social media, we have new joystick features coming in the next major update. There are two major features here:

  • Custom response curves
  • Special (semantic) ranges for certain axis types

The first may be of general interest, while the second is almost exclusively useful to hardware makers and custom cockpit builders.

Custom response curves

For as long as I can remember, X-Plane has had a “control response” setting, which makes your controls respond non-linearly. More of your joystick’s range is mapped to the center of the your pitch/roll/yaw axis’s center, and less of the range is devoted to the extremes. This gives you fine-grained controls in the region where the controls are typically used, at the expense of more coarse controls at the limits.

In X-Plane 11, these settings live in the Control Sensitivity window (launched from the bottom of the Settings > Joystick screen), and they will continue to be there in the 11.30 update.

The problem with the existing control response setting, though, is that it applies to all joystick hardware you might plug in. You get just three values—pitch, roll, and yaw—that apply to every axis of that type, no matter the device. Moreover, if you have a different type of axis whose input you want to curve (e.g., throttle, tiller, etc.), you’re simply out of luck.

So, in 11.30, we’re adding support for setting custom curves on any axis type. When applied to a pitch, roll, or yaw axis, this will override the global control response curve; applied to other axis types, it will support new functionality not previously available.

These curves are incredibly powerful. They can do things like:

  • Manually configure a null zone
  • Create a smooth curve (a straightforward replacement for the old “control response” setting)
  • Create really complex curves, with loads of control points, and your choice of interpolation method (linear, or one of two methods of smoothing)

But the fun doesn’t stop there!

New semantic ranges

There’s a new component to the curve editor that bears calling out explicitly.

When you’re editing a response curve for certain axis types (throttle, prop, or mixture), you’ll have the option of also configuring the ranges for certain axis-specific behaviors:

  • Beta & reverse ranges for throttles
  • Feather range for prop controls
  • Cutoff range for mixture controls

X-Plane has always set these ranges automatically based on the aircraft model you were flying. For the first time, though, you can configure it yourself to match your hardware.

These are aimed primarily at hardware builders who have physical detents on their controls—you can make X-Plane’s idle point exactly match your throttle’s physical detent, for instance. This makes it possible to build really nice throttle-prop-mixture quadrants that play nicely with X-Plane.

If you’re a commercial hardware maker, and you’d like X-Plane to correctly configure your hardware by default for your users, you can set up both the axis & button assignments and the semantic axis ranges from the settings UI, then click the “Create Default Configuration File” button. Send the file it creates to me (my email is my first name at X-Plane.com) and I’ll get it shipping in the next release.

Posted in Hardware by | 47 Comments

We’re Hiring (Again)

We’re looking to add a junior UI developer to the team in the near future.

About the position

We need a junior developer to come do user interface work for us. As you may know, the Plane Maker and Airfoil Maker user interfaces did not get the same overhaul that X-Plane itself did for version 11, and we’d like to change that. That’s a major undertaking, and you, dear applicant, could be responsible for it in its entirety.

Beyond that, X-Plane itself has a “long tail” of UI improvements that we’d like to see. You could be the one to move these improvements from “The Glorious Future™” schedule into reality.

Our UI is built on a custom widget-based framework that is only now starting to reach maturity. So, while a lot of your work will involve putting together existing pieces, there will definitely be problems you can only solve by writing completely new UI components. Read More

Posted in Hiring by | 4 Comments

Widget Windows, You Fancy Now!

I’ve gotten a handful of emails from third-party devs recently asking the question:

I have a bunch of XPWidget-based windows. When will I be able to use them with fancy new features like UI scaling, pop-out support, VR support, etc.?

Happily, the answer is: now!

I really buried the lede on this one, but back in X-Plane 11.20, as part of adding plugin support for VR windows, we added a new “mode” for XPWidget-based plugins. It all starts with a call to opt-in to the “modern” window APIs like this:

XPLMEnableFeature("XPLM_USE_NATIVE_WIDGET_WINDOWS", 1);

From this point forward, all widget windows you create will be backed by a modern XPLM window, and can therefore be used with all the new XPLMDisplay APIs. All you have to do from there is call XPGetWidgetUnderlyingWindow() get the XPLMWindowID of your window to pass to those APIs.

Posted in Plugins by | Comments Off on Widget Windows, You Fancy Now!

X-Plane Live: European Edition

Edit: the X-Plane live session is actually on the 14th – today, Tuesday.

At the request of our European friends, the next round of X-Plane live Q&A will take place on August 15th—excuse me, 15 August!  August 14—at 20:00 UTC (translate that to your time zone). Previous Q&A sessions have been scheduled at times that were convenient primarily for Americans, but why should they get to have all the fun?!

In case you missed the first and second rounds of this, this is a streaming broadcast (via YouTube) featuring:

  • Austin Meyer, owner & creator of X-Plane
  • Ben Supnik, desktop product manager
  • Chris Serio, mobile product manager
  • Alex Unruh, art director
  • …and anyone else we happen to drum up. 🙂

Dear Europeans, the fate of the livestream is in your hands! 😀

Posted in News by | 25 Comments

Let’s Talk About CEF (Some More)

The CEF post generated a lot of controversy, and rather than replying directly in the comments (and doing a bunch of copy & paste), I thought I’d collect my responses to the major objections here.

Objection: Nobody wants to browse the web in X-Plane!

Yes and no. I agree that, unless you’re in VR, a full-fledged web browser is totally useless. Nobody wants to be browsing cat pictures while flying. But CEF is really not designed to power a traditional web browser.

Consider this list of a bunch of other applications that nobody wants a web browser in:

  • Spotify
  • Adobe Acrobat
  • Evernote
  • The Steam client
  • The Atom text editor
  • The GitHub desktop client
  • WhatsApp

What do all those applications have in common? They’re built on CEF, or the closely related Electron project.

My point is this: the primary use case for CEF is not to build a full-fledged browser—it’s to support things like HTML5 user interfaces, which massively lower the bar for creating nice, easy-to-use plugins. It could also support things like displaying PDF charts or other electronic flight bag features—things that are theoretically possible without a webview, but which have such a high barrier to entry that nobody wants to tackle them.

We are always looking for ways to both

  • get more people involved in creating X-Plane add-ons, and
  • give existing plugin developers better tools so that they can create things they couldn’t have before.

Doing so makes the X-Plane community stronger, and supports the creation of add-ons that might otherwise not have existed.

Objection: This is a waste of time. What you should be working on is [some other feature].

As I mentioned previously, CEF is being used in X-Plane right now to enable in-app upgrades. This is obviously the most boring non-feature we could ever ship, and I understand why power users (people who might have bought X-Plane 11 on day 1!) are irritated.

The reality is: some features we ship for end-users*, and some we ship to “pay the bills.” Paying the bills is boring, but important: having X-Plane be financially successful ensures that we can continue improving the sim (ahem, in ways that end users actually care about!) for decades to come. In this particular case, we have reason to believe the current purchasing process is convoluted enough that it’s losing us sales. In-app upgrades will increase sales by some (small) percentage, so even though it’s not a direct improvement to the sim for existing users, it’s funding future development.

One more thing worth mentioning on the topic of “I wish you’d do x instead” is that we have a handful of full-time developers now, with people specializing in very different areas, so we tend to have a lot of features in progress at any one time. It’s certainly not the case that, say, Sidney stopped working on improving performance while I was off integrating CEF. 🙂

Objection: I don’t want X-Plane plugins using webviews!

The reason we’re having this discussion is that plugin developers are already using CEF—and they’re doing so in ways that are incompatible with other developers’ implementations.

It’s certainly an option for us to bury our heads in the sand and ignore this—we could force users to choose between, say, installing a Flight Factor plane and installing a fancy new web-based plugin (or using future X-Plane core features). Ultimately, though, this hurts both the end users who would have otherwise chosen “all of the above,” and it hurts the add-on makers who lose sales because users were forced to choose.

We can’t stop add-on makers from using webviews, but we can make sure that doing so doesn’t lead to a compatibility nightmare for end users.

Objection: CEF represents a massive security hole!

This is absolutely a concern for us. Webviews in X-Plane present two major attack surfaces:

  1. The possibility of running untrusted code (e.g., a nefarious site exploits a browser vulnerability to execute harmful code on your machine)
  2. The possibility of sending data somewhere you didn’t want it to go (e.g., a nefarious site masquerades as your bank’s web site, and sends your login info to bad guys)

We’re still in the “exploration” phase here, trying to understand plugin developers’ needs, but there are a lot of ways we could mitigate these threats. A few possibilities, listed from most extreme to least:

  1. Don’t allow remote connections at all; plugin-created webviews could only load local assets (HTML, JS, etc.) that were bundled with the plugin
  2. Disable JavaScript entirely
  3. Require plugins to provide a whitelist of URLs that are deemed safe to send & receive data from
  4. Disable JavaScript loaded from external (or non-whitelisted) domains
  5. Allow user preferences to control the above policies (or even disable webviews entirely)

Objection: CEF will slow the sim down. This is bloatware!

That’s for measurement to decide! In our tests, having CEF displaying static pages while flying didn’t slow down the sim by any amount we could measure. And since CEF doesn’t run on the main X-Plane thread, the OS can schedule CPU-intensive things like page loads around X-Plane’s work. There is definitely some memory overhead involved (a few hundred megabytes), but considering the existing footprint of X-Plane, it’s not a crazy amount.

And, like everything in X-Plane, if you want to tune it to get the last drop of performance, you’d be free to avoid using features & add-ons that depend on webviews.

Objection: Don’t use CEF—You should use WebKit, Gecko, Servo, etc. instead.

I did a lot of research and test implementations (on Windows, I went so far as to use Trident, the underlying engine to Internet Explorer!), and the only webview framework I found that meets X-Plane’s requirements was CEF.

* Aside: What does 11.20 include for end-users? A few highlights from the release notes:

  • VR support
  • New Sydney, Australia landmarks
  • A new Aerolite 103 model
  • An overhauled Columbia 400
  • 1,315 airports with new 3-D scenery
Posted in Plugins by | 23 Comments

New VR APIs Are Available Now

Plugin developers, Beta 5 includes a few new VR-specific APIs in the XPLMDisplay header.

The complete list of VR-specific APIs is now:

I’ve updated the VR sample plugin to take advantage of all the new stuff here, minus the widget API—really, once you enable native widget windows, your widget window becomes “just another XPLM window” as far as the display APIs are concerned.

Posted in Uncategorized by | 8 Comments

Let’s Talk About CEF

In the X-Plane 11.20b1, we’re shipping a web browser for the first time. We’re using the Chromium Embedded Framework (CEF)—essentially the same guts as Chrome, wrapped inside X-Plane.

For the time being, it’s being used in one place only*: to support in-app upgrades, so that if you have the demo, you can buy the full version of X-Plane without having to go to the web site. The web view is seamless—you can’t tell by looking at the app that it’s not just part of the native X-Plane user interface.

While its present use is quite limited, if all goes well, we’d like to expand its use elsewhere in the sim—in The Glorious Future™, we could potentially use it to load online charts and the like.

But, there’s a hitch!

There’s not a good way to load two copies of CEF at a time. And, since some plugins (like the ones used in the new Flight Factor A320 Ultimate) depend on a version of CEF provided by a (global) plugin, we have to disable X-Plane’s web browser functionality in the presence of that plugin. This isn’t a big deal right now—after all, if you’ve installed payware, you probably already own the sim anyway—but it will be a shame if, in The Glorious Future™, you have to choose between your payware and core X-Plane functionality.

The situation is even worse than you might expect: CEF absolutely doesn’t support multiple initialization calls in the lifetime of an app—you can’t initialize it, shut it down, then re-initialize it. That means it’s not even possible for plugin authors to be good citizens and “relinquish” CEF to X-Plane, such that you could at least use X-Plane’s browser whenever you’re not using an add-on that depends on it. It’s all or nothing! In fact, you’ll have to uninstall the CEF plugin before X-Plane can use a web view itself.

There are two possible fixes here:

  1. At some point in the future, we provide access to CEF via the plugin SDK. If we did, it would have to be to the C API only—no fancy C++ wrappers for you. Speaking as someone with the memory of writing for the C API fresh in his mind, let me say: this isn’t a whole lot of fun, and it’s rife with the potential for memory leaks. Moreover, this would break any existing addons that depend on CEF—they would be forced to migrate to the SDK version of the API.
  2. We could (theoretically) compile an X-Plane-specific version of CEF that would not conflict with the version plugins are using. This would require renaming all the Objective-C symbols on Mac, and renaming the DLL on Windows. I’ve not investigated this for feasibility, but it’s certainly theoretically possible. This would allow X-Plane’s version of CEF to coexist with (one) plugin-provided copy, albeit at double the CPU and memory cost.

Having us expose CEF via the SDK is not an unequivocal win. CEF is notoriously incompatible between versions—you can more or less guarantee that even minor updates will break compatibility of the API somewhere. That means X-Plane would be stuck at a fixed version of CEF for at least the lifetime of a major version to prevent breaking plugins. X-Plane 11.20 uses CEF release 3202; it would be at least the next major version before we updated CEF to a newer version. There are two major downsides to this:

  1. When X-Plane updates to that newer version, it would break plugins compiled against old versions of the SDK that depend on CEF. That’s a lot more aggressive than our normal deprecation policy, and it makes CEF plugins a potential maintenance headache for plugin devs.
  2. If your add-on really, really needs features from the latest and greatest CEF release, you’re out of luck—wait a couple years (!!) and maybe we’ll update.

So, here’s what I’d like to hear from plugin devs:

  1. Are you currently, or are you planning to use CEF in the future?
  2. Would you be willing to use the C version of the CEF API only?
  3. Would you be able to accept the limitations and potential headaches (outlined above) of X-Plane-determined CEF versions and compatibility?

If you don’t mind telling me a bit about your intended use cases, that’d be very helpful as well!

EDITED TO ADD: There’s a third option here that I didn’t consider: X-Plane could provide a “wrapper” around CEF that offers “just” a browser surface, and simple interfaces like the ability to change the URL programmatically. This has the advantage that we could update CEF regularly without breaking the API (though there’s always the risk that a new version of Chromium would change how it handles your HTML + CSS + JS). The disadvantages are twofold:

a) If a plugin developer really, really needs the full power of the CEF API, they’re out of luck (or we’re back to square one with respect to having to disable core X-Plane functionality in order to support the plugin).

b) New XPLM APIs are a massive tax on our development time. Every time we need to make a change, we have to go test a dozen plugins… then go through an extensive beta… then inevitably hear about a show-stopping bug we introduced three hours after a release goes final. 😀 In contrast, providing a (major-version-stable), transparent copy of CEF costs us very little dev time; time that would otherwise be spent maintaining the XPLM API can be spent on, like, major features.

* Aside: This is actually how we test a lot of new tech in X-Plane: we find a single, relatively out-of-the-way place to make use of it, ship it in a major version update, and wait to see if it blows up. Betas catch a lot of bugs, but not all, so this is a way of hedging our bets when it comes to code that hasn’t been battle-hardened. This is how we worked the bugs out of the user interface framework (Plane Maker’s panel editor was the testbed), the X-Plane 11 particle system (behind the scenes, it was used for some very minor effects in X-Plane 10.51), and more.

Posted in Development, Plugins by | 48 Comments

What Would Make the ATC System Better?

This may come as a shock to you, but… we hear a lot of complaints about the X-Plane 11 ATC.

I have good news: We want to improve the ATC!

The problem we’re facing is that a lot of the feedback we get is indistinct—hearing “ATC sucks” doesn’t help us understand how we could do better. So, here’s what we’d like from you: Tell us the specific issues you have, or the specific features you’d like to see implemented. At this point, we can’t promise a timeframe for any given improvements, but we can promise to consider everything you say.

Please note: Any comments on this post that don’t directly relate to ATC will be deleted. Moreover, please don’t slag on other people’s wishlists—arguments against other people in this thread will not inform our decisions about how we prioritize this stuff.

Posted in Air Traffic Control by | 240 Comments