I mentioned in a previous post that we are working with Ondrej on a next-generation Blender 2.7 OBJ exporter. I am excited for this work because I believe it will greatly improve the artist interface to X-Plane. Let’s use instancing as an example to explain the idea.
X-Plane 10 will sometimes draw scenery objects using hardware instancing. When an object is drawn with instancing, performance is a lot better than without it; the huge numbers of objects you can see in the autogen scenery are due to instancing. But the conditions for instancing are, to put it mildly, complicated.
- The object has to be attached to a DSF. Well, that’s not crazy.
- There’s a giant pile of things you’re not allowed to do in an instanced object – animation, material attributes, smoke puffs, bla bla bla. (The object has to be simple so that the GPU can draw a big pile of objects without the CPU intervening to handle things like smoke generation on a per-object basis.)
- Buuuuut…not every ATTRibute is a problem. You can use ATTR_hard in an instanced object, no problem! But don’t use ATTR_shiny_rat – that’ll kill instancing.
- But wait, there are these weirdo new attributes like GLOBAL_specular that seem to replace ATTR_shiny_rat that do work with instancing.
If you model, and this seems confusing, it’s because it is. You were never supposed to see this!
File Formats for Machines and Applications For Humans
My view is this: the file formats of X-Plane are meant to be seen by programmers, not artists. When was the last time you had to hand-edit an .acf? You just use Plane-Maker. You don’t hand-edit a PNG file or worry about its internal compression – you use PhotoShop.
OBJ should be the same way – you should export from a 3-d tool and never have to look inside the OBJ itself. This means the OBJ8 format can serve two purposes:
- Help X-Plane load models quickly and draw good looking content and
- Maintain compatibility so older scenery continues to load.
Note that “be really easy to understand in Notepad” is not on the list!
Blender the Transformer
Now here’s the trick: the rules for OBJ that a 3-d modeler can present can be different from the rules that the OBJ8 format itself has. And that is exactly what we are trying to do in the new Blender exporter.
Rather than expose global attributes and non-global attributes and all of the crazy complexity of OBJ8, our strategy with the new exporter is this:
- When you export a scenery object, you specify if you want the object to be instanced or not.
- If the object is not instanced, Blender creates the best OBJ it can for this case.
- If the object is instanced, Blender tries to create the best OBJ it can for this case.
- If the object is supposed to be instanced but you’ve done something that is not instancing-friendly, the exporter tells you, in terms you can understand.
So for example, if you make an animated radar dish that spins and attempt to export with instancing, the exporter can say “you cannot have animation in an instanced object.” Now you, the scenery designer, can make a decision: is it more important to have the radar dish draw really really fast, or is it more important that it spins?
This is the strategy we used for our modifications of Marginal’s 2.49 exporter* – the artist specifies instancing and gets a check that instancing requirements have met. This means instance-tagged objects will be fast. (It is possible to check instancing within the sim with DataRefEditor but it’s not easy, especially for large projects.)
Don’t Expose the Weird
This idea that Blender can transform your work, and thus hide weird X-Plane rules, is not specific to OBJ, not new to X-Plane, and not even specific to X-Plane. When you look at major 3-d game engines (e.g. for combat games and racing games) a ton of code goes into the “art asset pipeline”, transforming the artist’s original work into something already digested for the 3-d engine.
Another example of this is WED. DSFs have an annoying rule that polygons can’t cross DSF boundaries. There are also some even weirder exceptions for a few special cases, introduced in X-Plane 10.20.
WED knows all of these rules; you draw polygons wherever you want and set the export target for the version of X-Plane you want to fly in, and WED figures out the best way to export your work, chopping up polygons as needed.
Shedding Light on Things
Our current work on the Blender exporter focuses on WYSIWYG animation and the material model (which includes instancing support). There is one more area that I think will make a huge difference to authors that we haven’t started working on yet: lighting.
The lighting values for commands like LIGHT_PARAM are, to put it mildly, completely goofy. If you’ve ever tried to read this, you know that even when things are explained, they make no sense.
No author should ever have to write a LIGHT_PARAM. This is a classic case where the exporter should do the transformation for us. What I would like to get into Blender 2.7 is the ability to place a cone light in Blender and have the exporter write the spill light automatically, e.g. filling in the parameters from the position and shape of the light. You light your scene and you see the same thing in X-Plane.
For years we’ve been behind the curve on user experience when it comes to 3-d modeling. I think we’re starting to fix some of those problems in a major way, which should help make the power of X-Plane 10’s rendering engine quite a bit more accessible.
*As a side note, I have no idea what the current 2.49 script status is. We view the 2.7 scripts as the long term way forward, due to Blender 2.49’s not being maintained, so our effort on a truly user-friendly tool is going into 2.7. But we also maintain updates to 2.49 to support our internal team. X-Plane 10.50 will feature a few new OBJ commands, so I will try to post our branch of the 2.49 scripts (which do have this new support) for anyone whose aircraft is in 2.49.
In the long term the 2.7 scripts will feature a migration tool, but I expect we will have a useful 2.7 release (for 2.7 authors) without migration first, and then migration will come later.
We’ve seen a few reports (and Philipp has experienced first hand) that X-Plane will crash on startup with the very latest Catalyst drivers that came out last week. The crash appears to only happen if you have a machine with a discrete AMD GPU (e.g. a 7970M) and a built-in GPU on your CPU for low-power use.
We are investigating this with AMD now; in the meantime please use the previous Catalyst driver if you are seeing crashes.
If you have a desktop machine, don’t have an AMD card, or are on Mac or Linux this does not affect you.
X-Plane 10 Mobile is among the first games to be released for NVidia’s Shield set top box.
Part of the work of doing this release was putting game controller support into X-Plane mobile – you’ll be able to use a game controller on your Android or iOS phone or tablet too.
And part of the work was making the entire user interface accessible from a game controller, e.g. only button presses, no touch screen input. That code is going back to X-Plane 10 Global for keyboard navigation in our next generation user interface.
The 747 is out for X-Plane 10 Mobile too (iOS and Android):
The 747 started on X-Plane 10 Global and has been moved over to X-Plane 10 Mobile. We’ve tried to keep the two versions synchronized, so we can move some of the improvements from mobile back to the desktop version of X-Plane.
If you have a computer that can handle more detailed base meshes, AlpilotX’s free HD and (for those with serious hardware, UHD) meshes are a really great looking enhancement to X-Plane. Alpilotx just released a new HD version of South America with more up-to-date land class and OSM data.
Here are comparison screenshots.
Update: the comments form is fixed – sorry about that!
I’ve been working a bit on scenery tools this week. Here’s a road map of some of what’s coming up.
WED and the X-Plane Scenery Gateway
We are working on a release of the latest scenery gateway airports for X-Plane 10.45. Like all releases, we’ve found problems with airports that WED does not detect. So I will try to release a new version of WED with stricter validation soon.
Airport Parking Spots
Austin is working on new code to place static aircraft at unused ramp parking spots. I’l describe this in more detail in another post, but here are some key points:
- As an airport author, you simply place ramp starts, not static aircraft.
- X-Plane will feature some new static aircraft in the update.
- Third parties can further add to the static aircraft and have them be used via the library system.
- There will be a revision to the apt.dat format that stores more data per ramp spot and a WED update to support this new data.
- Since there may be scenery now with static aircraft on top of ramp starts*, we will auto-remove static aircraft from ramp starts in the gateway export as a temporary measure until authors can resolve the situation and post the fixes to the gateway.
- We are not removing the old static aircraft from the library, but we will be hiding them from WED’s library so that authors use ramp starts instead of placing them by hand.
Static aircraft in parking spots will ship next year, not this year, but is planned as a v10 update.
Scenery Tools on OS X
I made significant progress this week porting WED for OS X to 64-bit and modern Mac APIs. This effort basically meant rewriting the OS-level UI code in WED to be new AppKit based calls instead of the old Carbon API.
What this means is that developers will be able to build all of the scenery tools on a modern Mac running Yosemite or El Capitan with X-Code 7. Since Chris has already updated the projects to compiled WED in MSVC, a developer can build all of the common scenery tools from the most widely used open source IDEs.
It also brings us closer to a 64-bit WED on Mac, which is desperately needed since OS X provides the least amount of usable address space to 32-bit apps. I am not sure of the 64-bit status of the Windows WED build; it may need more work on the libraries.
Will It Blend
This might be the most significant scenery tools development: we’ve been working with Ondrej (der-On on Git-Hub) on new features for the Blender 2.7 exporter. This will include:
- Much better animation support. Complete WYSIWYG animation of data blocks and bones, with no work-arounds needed. Bone animations match Blender 2.49 so you can move your projects forward.
- Modernized material support including instancing for a really clean work-flow that takes advantage of X-Plane 10’s features.
- Updates for the latest OBJ features.
- Our plan is to create a migration script to bring 2.49 projects into 2.7, converting the special tags used for an X-Plane 2.49 export into 2.7.
Many of our artists still use 2.49, but there’s no question that 2.49’s days are numbered. It’s a question of when it stops working on OS X, not if. With the migration step, we can move our projects forward without artists having to redo work.
Like the previous 2.7 exporter, this one is open source and will be free, and should be able to export existing 2.7-type projects with no modifications – we are trying to maintain full backward compatibility.
* This situation is slightly silly – if the user picks the ramp start to fly, the user will be on top of a static aircraft.
X-Plane 10.42 is a small bug fix release, and it’s out now as a free update for all X-Plane 10 customers, Global Edition, Digital Download and Steam. We also updated the installer on Monday.
With 10.42 out, we’re looking to get onto 10.45 ASAP, which will include the latest set of airports from the X-Plane Scenery Gateway.
I’d like to see us release new airports from the gateway every eight weeks, as long as there are enough new updates (and so far that has definitely been the case). I’m posting that here, publicly so that when Julian and Robin are ready to release new airports and data and I’m going “um, well, maybe next week, I’m really busy and the kids threw up on me this morning” they can point to this post and go “eight weeks!”
X-Plane 10.42r1 is available for beta – the release notes are here. This is a very small bug fix patch that mostly aims to address problems we’ve found with digital download over the last few weeks. (We have already significantly upgraded the capacity of the digital download authorization servers, and a new installer release will finish this work next week.)
Even if you don’t use digital download, please do get the new build by running the installer, checking for updates, and checking “get betas”. Once some users have tested 10.42 and we release it, we can move on to 10.45 and more interesting things.
Since El Capitan came out, SASL has been crashing on quit when used in aircraft with customized sound. While I work on neither SASL nor El Capitan, both are (at least partly) open source, so I spent a few hours yesterday and located the bugs.
The good news is: this bug is fixed in SASL version 2.4. The bad news is: you’ll need to make sure the aircraft you are flying is using SASL 2.4 – and this applies to every aircraft that you have that uses SASL.
If you develop an aircraft using SASL, you can get the latest free version of SASL here. Note that this new version is apparently 64-bit only.
If you are using a freeware aircraft that is no longer supported, I think you could theoretically drop in the new SASL and see if it fixes things. If the aircraft is payware, the aircraft author might not be thrilled to have to support a “modified” aircraft and might prefer to do the upgrade in-house.
If you are a developer of SASL or you use OpenAL, you can read the gory technical details here.

Here’s a pop quiz: you download the release candidate for a new X-Plane patch – maybe it’s 10.41 – and you run your add-on. To your horror, you find that a dataref is missing – or maybe a command no longer works. Do you:
- Immediately rewrite your code to work with the release candidate and release it immediately, preferably before the beta is over or
- File a bug, clearly indicating what changed from the last shipping version. Laminar fixes the release candidate and by the time the patch ships, your add-on “just works”.
Pencils down! I have said this before, but I’ll say it again: the answer is choice number two – file a bug.
If you find a problem with your add-on during a beta where something used to work and now does not:
- Do file a bug. We cannot maintain compatibility if we do not know there is a problem.
- Do not change your add-on (and definitely do not release that change). Most likely that change is a mistake, and when we fix the bug, your original add-on would have worked but your modified add-on is now broken.
We try really, really, really hard to make sure that you don’t have to cut a new release of your add-on just because we are issuing a free update to X-Plane.
What If I Am Late?
What if you are using the new shipping version of the sim? You just got 10.41, but you didn’t try any betas, and you find your add-on is broken.
File a bug. We will still fix the bug, and issue a patch. The only difference here is that:
- Your users will be grumpy about the 1 or 2 week period during which the add-on was broken – that time could have been zero weeks if you participated in the beta and
- I will be grumpy that you reported the bug after beta instead of during the beta.
Free Passes
Even if we find a bug that requires a modification to your aircraft to fix, we still try to put a compatibility mode into X-Plane so that you don’t have to release your aircraft immediately. As I blogged before, shipping add-ons can get a free pass. In these cases we sometimes recommend you update your add-on when you can, but there is no requirement that you must update to match our new update. Update when you can, on your own schedule.
We did hit three bugs in X-Plane 10.40 for which you do have to update your aircraft to get the benefit of the bug fix:
- Light sizes for billboard lights.
- Fixing buggy fuel consumption at high altitude.
- Feathering props on low oil pressure.
In all of these cases, we couldn’t apply the bug fix correctly to all aircraft – the changes would have positive effects on some aircraft and negative effects on others. So you get a free pass to leave the aircraft as is until you next save it in Plane-Maker; at that time you can make sure that the results of each bug fix are working for your aircraft. More details here.