X-Plane 10.50 Beta 3 is Dead, Long Live Beta 4

My son is five and he really wants to participate in conversations at dinner. “Daddy, what are you talking about?”

So I tried to explain to him that we had worked all week to get X-Plane 10.50 beta 3 ready and that we wanted it to be really good, and then at the last minute we discovered it was broken, so we had to go back and fix it and try again.

Gabe: What are you going to do if it’s broken again?

Me: Probably cry.

Gabe: No!  Daddy, you’re not going to do that! I said no joking!

Me: No, I’m being totally serious. I’m going to sit down in that corner and wimper with my head in my hands.

X-Plane 10.50 beta 3 fixed a lot of big bugs – several crash bugs fixed, etc. It unfortunately also had a small problem where it wouldn’t start without blowing up. (This one got by us because it only happens at some airports, and it requires a clean release machine to see- it doesn’t happen on developer machines or some of the more heavily loaded installs that Jennifer tests with. The breaking change also went in late in the game, and thus missed screening.)

So we turned around beta 4, and if it’s unusable, I’ll have to reconsider my life choices.

Crash Fixes!

We fixed three high profile crashes in X-Plane 10.50 beta 3 (now available to you without brain damage in beta 4):

  1. Crashing at DSF load time if a DSF mesh has a crack in it.Apparently some G2XPL-made meshes have tiny hairline cracks in them. They’re almost impossible to see but they were enough to crash the road code. DSF mesh cracks are illegal (per the DSF spec) but X-Plane now handles them anyway; I don’t think anyone wants to stop using this category of scenery.
  2. Crashes reading real weather when the .grib2 files are missing on Windows. I’m not sure of all of the different ways this was happening, but it should be fixed.
  3. There was a memory scribble in the scenery loading code for some scenery pack configurations.

That last one is in its own category of badness. A memory scribble is when a piece of X-Plane code just goes off and writes over random memory (in X-Plane’s memory space – X-Plane can’t splat the memory of other apps on your computer). Once this happens, pretty much anything can explode at any times ,and often it does.

We can’t know how many of the crashes we were seeing via auto-reporting were due to the scribble, so:

  • Please do get X-Plane 10.50 beta 4!
  • If you reported a crash bug and you still are getting a crash in beta 4, please re-report it.
  • Please keep on auto-reporting crash bugs on Windows and Linux – this is hugely helpful. The auto-crash reporter gives us a statistical picture of what’s going on with the beta.

Scenery and Aircraft Authors: I think 10.50 beta 4 should be stable enough to look at your add-ons; airport lights should be fixed and working normally, scenery should not be crashing, and missing taxiways are fixed.

Scenery authors in particular: 10.50 contains extensive changes to the rendering engine under the hood, so please take a careful look at your scenery packs and make sure they haven’t mysteriously changed in how they look compared to 10.45.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 43 Comments

Beta 3 In a Few Days

I tried to rush through X-Plane 10.50 beta 2 over Friday and Saturday, in an attempt to get past a number of high profile crash bugs and installer errors quickly, despite having our Q/A person out of the office.

This didn’t work too well – beta 2 introduced a new stupid bug (the airplane lights are always on), and of course there are still plenty of other bugs.

So my plan now is to slow down a little bit and try to take time to verify beta 3 a bit before releasing it, which means it won’t make it out until mid next week. There are bugs we’ve found in beta 2 that are not quick fixes that are still quite severe, so it’s time to measure twice, cut once, not take two steps forward and one step back.

In the meantime:

  • To everyone who has reported bugs via the bug reporter, thank you! We’ve gotten a lot of bug reports, which is great – it gives us a rapid picture of what’s working and what’s not.
  • To everyone who has also posted their bug report in the comments section, please stop doing that! I have deleted a number of recent comments that were either “I also posted this bug to the bug reporter, but (bug report goes here)” or “this is not a bug report but (“bug report goes here”). We really need the bug reports in a single place where we can carefully track them. That place is not the blog comment section.

Tall Buildings and Data

I believe that X-Plane 10.50 beta 2 fixed the bug where the tall autogen was missing from the installer. Unfortunately this means that if you still don’t see tall buildings, it’s because the DSF doesn’t contain tall building information. A good check is to go to New York City – if it’s tall with max autogen, it’s the underlying DSF data, not the autogen.

The tall building height data that is in the global scenery DSFs now came from a mix of FAA data and user collected data from a very long time ago. Therefore tall buildings are very likely to be missing or in the wrong place outside of the US. Our future plan (which alpilotx has already made progress on; I need to examine some of the files he sent me) is to use OSM for the height data too, which should be a huge improvement.

While we do plan to use OSM data to provide DSF height data, that is not going to happen soon, and is not going to happen for X-Plane 10.50.

In the meantime, I will try to post soon the DSF information on how the height data is encoded. This will at least give third party developers the option to create DSFs that take advantage of the new autogen.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in News | 40 Comments

X-Plane 10.50 Beta 2 – Different Issues

The good news is: 10.50 beta 2 is out, and it fixes a pile of big problems with beta 1.

The bad news is: it has its own problems – apparently some of the airplane lights are on all the time. This will have to get fixed in beta 3.

If you get a crash on startup, you’ll need to run the installer to get beta 2 – auto-update might not run due to the crash.

A quick note on scenery: I was able to fix one scenery-related crash in beta 1, but there are others still in the code. If you are seeing scenery crashes, I need a Log.txt showing the problem -and- info about what scenery and what settings you combined to get the crash. With the complete reproduction information, I can fix the crash.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in News | 16 Comments

The Anatomy of a Plugin Crash

This morning I found out why certain plugins (e.g. SeaTraffic, etc.) are crashing X-Plane 10.50 beta 1 on startup. Beta 2 was being uploaded when I found this, but I’m going to fix this bug first and recut the beta, as it’s a big bug (since it renders many users’ systems to be dead-on-boot).  Beta 2 should be up by tomorrow morning but might go live some time today if things go well.

The plugin-crash bug is a regression bug – X-Plane used to do something right and has now “regressed” and is doing it wrong in X-Plane 10.50 beta 1.  This is our bug to fix, and we will fix it in beta 2; no plugin will need any changes, and the plugins crashing in beta 1 will start working again in beta 2.

That’s everything you need to know about the plugin crash bug. What follows is a very long  and verbose write-up of the crash (think of it like an NTSB accident report). Perhaps it will provide plugin authors with some insight into where compatibility problems come from, and why early betas can be unstable.

A Proximate Cause: Loading an OBJ “Too Early”

We’ll work backward from the proximate cause (e.g. literally why did the plugin crash) and work our way backward to eventually understand the “why” of this crash. The fix for the bug is relatively simple, but you can’t know if a bug fix is correct without understanding the complete why; bugs like this take a lot more time to diagnose than to cure.

The crashing plugins are all calling XPLMLoadObject from their XPluginStart callback – that is, they are asking X-Plane to load an OBJ at the earliest possible time they can. This is totally legal! But it turns out that:

  1. X-Plane isn’t ready to load an object at plugin start and
  2. The penalty for doing so is a lot worse (a crash always) in 10.50 than in 10.45 (a crash rarely).

Why isn’t X-Plane ready to load objects? The answer lies in a little-known part of the OBJ file format called “conditionals.”  Conditionals are a lot like C preprocessor macros – they are IF-THEN statements in an OBJ that let you make parts of your OBJ file only run in certain settings. For example, we use conditionals to remove the artist-drawn shadows from the static aircraft when X-Plane is in a mode that can draw shadows dynamically; this prevents “double-shadow”.

Conditionals are weird – they work not by evaluating the condition when we draw, but rather when we load; if a conditional is false in the OBJ, that text in the file is literally not used.* This means we need conditionals to work at load time, which in our case means when XPluginStart is called.

Unfortunately, conditionals are set up when we load preferences, and we load preferences after we call XPluginStart. So when these plugins load an object, the conditional system isn’t inited, and the OBJ loader crashes. Since we called the OBJ loader from a plugin, the plugin gets blamed. (A plugin author looking at the plugin crash can easily tell what happened – “I called XPLMLoadObject and it exploded!”.**)

Is this typical?  Yes. Often it’s the combination of special rules for initialization, plugins using code in a way the sim doesn’t, and multiple subsystems that cause crashes.

Why Now?

When I found the code path that was causing the crash, my first reaction was “this is a mess…how did this work in X-Plane 10.45???”.  So I went back to the X-Plane 10.45 code and found that this was broken in X-Plane 10.45 too! So what changed?

The answer is that in X-Plane 10.45, the conditional system would only crash (due to not being inited) if it was used; in other words, any object with IF SCENERY_SHADOWS (for example) would crash if loaded from a plugin at XPluginStart. But if you didn’t use the conditionals, things worked fine. And my guess is that very few plugin authors use conditionals in their objects.

What changed is that X-Plane 10.50 uses the conditional system for every object load, even if you don’t have an IF statement. So now the crash is 100% reproducible, not a rare “five things must all go wrong at once” kind of crash.

Is this typical? Yes. This is a bug where something was fundamentally broken for a long time, and an incremental internal change in how our code works changed the symptoms from ‘rare’ to ‘always’. This is very typical of beta bugs.

There may be other bugs like this too – it looks to me like objects loaded from XPluginStart with named lights might not get their named lights.

Why Do You Need Conditionals If I Don’t?

The next question this raises is: why did you monkeys change the OBJ loader code? What was wrong with what we had before? What kinds of X-Plane features cause this code change that break plugins?

The conditional code changed to fix a bug that shipped in X-Plane 10.45. The bug is: if you start the sim with HDR off and then turn HDR on, some spill lights don’t appear. The cause is that the OBJs are loaded with spill lights stripped out for performance*** (since HDR is off). In X-Plane 10.45 when you turn on HDR, we reload a lot of objects – but not necessarily the ones we need to, and the spill lights are lost. Rebooting brings the lights back.

To fix this, I modified the OBJ engine to track which conditionals any given object uses. If you add “DEBUG” to the end of your object to view the diagnostics, you’ll now see this in the output. When you change a rendering setting in X-Plane 10.50, only the objects that use a conditional that was affected by the settings change are reloaded.

That’s a big improvement in loading rules compared to X-Plane 1045. Turn on HDR and only objects with spills are reloaded; turn on shadows and only objects with optionally baked shadows are reloaded. But it means we need to use the conditional system on every object load to set up those flags; that’s what exposed the bug.

Is this typical? Yes! What we have is a simple refactor making different use of an internal API to fix a bug, and the results make a separate existing bug worse; that separate bug is reproducible only via plugins.

Is There an Ultimate Cause To All of This?

When fixing bugs like this I have to ask myself “is there a way this could have been avoided?”

The root of this bug is the root of a large number of plugin quirks and edge cases: XPluginStart (the first thing a plugin does) is called insanely early in X-Plane’s load process; as a result, a lot of the SDK isn’t actually available.

The decision to call XPluginStart early is a bad decision, and it is one that I made, well over a decade ago, to solve one specific problem. At the time, X-Plane (6!) had no option to save the selected AI aircraft to preferences. XSquawkBox needed specific AI aircraft loaded to support multiplayer, and it was really slow to let X-Plane load 20 random aircraft, then reload them all later.

To “solve” this (and I use the term loosely, since this one fix has been the source of so many bugs) I put XPluginStart before almost all parts of sim load, so that the XPLMAircraft API could let a plugin pick the AI aircraft before they were loaded, influencing the first load.

If I had a time machine, I’d go back to 2000 and kick myself in the ass. This early in load, virtually all rules of how X-Plane work are wrong since so much of the sim is not yet loaded. Plugin authors already cope with this by “deferring” their work until the sim has fully loaded; our advice for a while has been to not touch any aircraft before this point.

So is this typical? Yes – it’s yet another edge case introduced by plugins starting unnecessarily early.

 

* If you are wondering why conditionals work at load time and not run time, the answer is instancing. X-Plane does the complex analysis to categorize an object as instancing-friendly when it is loaded; attributes disable instancing. The conditionals run at load time so that if attributes like ATTR_poly_os are removed for shadowing, are removed by conditionals, then the object becomes instancing-friendly (because the conditional is like removing the text).

In other words, by having conditionals “pre-process” the OBJ file, you don’t pay for what you don’t use.

** If you call a plugin API from your plugin and the plugin code crashes, it could be X-Planes fault or your fault; plugin APIs may crash if given bad arguments (e.g. a junk pointer for a string argument).

*** This is the same idea as above; by removing stuff you don’t use like a spill light that isn’t seen with HDR off, we can get X-Plane onto a faster path. For example, if an object contains a spill light with a dataref, it can’t be instanced; if the spill light will never be drawn, deleting it makes the object instancing-eligible.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Uncategorized | 11 Comments

Some Bugs in X-Plane 10.50 beta 1

So…beta 1 is buggy as a bed in New York. I’m going to list these here in the hope of stemming the tide of bug reports:

These are broken in beta 1 and will be fixed in beta 2 – I’ve already fixed the code.

  • The new autogen is missing! 🙁  There was a bug in the code that makes the installation; 10.50b1 diligently installs the old autogen.
  • Crashes with some custom scenery.
  • Missing taxi lines – they’ll be back.
  • Floating objects – I did see this one during pre-beta; it’s now fixed.

The static aircraft are also not working; I am investigating this now, but I expect to have it fixed for 10.50 beta 2.

Finally, users are reporting crashes on startup with plugins; if you have this on OS X, please include the Apple crash report and not just Log.txt.  I’m not sure what’s going on here, but it’s almost certainly a bug in 10.50b1 – we’re not changing any plugin compatibility rules, and the set of plugins affected is quite wide. (This bug is also not easily reproduced; I haven’t seen it with any plugins, it was not reported in private beta, and in one case the developer of a crashing add-on can’t crash his own add-on.)

Beta 2 will be out some time in the next few days.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 22 Comments

X-Plane 10.50 Beta 1 Is Here (And Only Slightly On Fire)

X-Plane 10.50 beta 1 is live! You can download it by running the X-Plane installer and clicking “get betas”, but you will not be auto-updated for it. As is normal with our betas, there is not a Steam beta of it, nor will there be until we are at release candidates.  (But Steam users can install a second copy of the free demo and update that to beta.)

Before continuing, I would like you to assume the lotus position and repeat the following mantra over and over until inner peace floods your body:

The comments section of the developer blog is not a bug reporter.

The comments section of the developer blog is not a bug reporter.

The comments section of the developer blog is not a bug reporter.

The comments section of the developer blog is not a bug reporter.

Ah…don’t you feel more calm already? I certainly do! Seriously though, the bug reporter is here; please use it! I cannot emphasize how much easier it is for us to triage bugs when they all show up in the same place. Random threads in forums about bugs get lost and don’t get fixed.

Release notes are here, but they are not necessarily complete yet. X-Plane 10.50 contained a huge amount of code change, so the notes probably need a few editing passes; something that Austin wouldn’t let meI didn’t want to hold up the beta for.

With any early beta of a major patch, I suggest that early adopters install it on a copy of their X-PLane folder and not the one they use to fly. This goes double for 10.50 because Jennifer, our Q/A head, is out of the office on a road trip. She was able to do a little bit of checking and we’ve tried to spot check it, but this release is more like the beta process from two years ago and not like 10.40 or 10.45. I suspect we’ll have the early stuff knocked out in a week.

There are already a few dumb bugs that have popped up: for some reason taxi lines are totally missing. I’m not sure when that happened because they were around for most of the beta. I’m also looking at a crash that JAR Designs sent me that looks like it could be pretty destabilizing (e.g. I broke the rendering engine). So…consider yourself warned.

Finally, our plan is to do one more airport collection from the gateway toward the end of the beta before we call 10.50 final. In the past we’ve done one airport collection per release, but for a long patch (e.g. 10.30, 10.40, 10.50) by the time we go final, hundreds of gateway submission are ready to go. We’re planning to take another batch in a few weeks, which will let people get fixes in to airports where the problems were revealed in 10.50 (e.g. even with the fixed 10.50 ATC the airport doesn’t work right).

 

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 33 Comments

X-Plane 10.50 Beta “Real Soon”

First, it was great to see everyone who came to FSConn 2016! Here’s a video of the conference: if there is another video that has better stabilization I’ll try to post it.

YouTube Preview Image

Now about X-Plane 10.50: I did just fix my last beta-stopping bug. So in theory the first beta will be live tomorrow.

But that’s only theory!  If the beta isn’t live, please refrain from being the 700th person to post “any ETA on the beta” to the comments section. The actual release date of builds is unpredictable because the existence of release-stopping bugs is unpredictable.  (If we could be 100% sure there were no bugs, we wouldn’t need betas at all.)

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 40 Comments

KATL At Night – X-Plane 10.50

KATL bkgnd

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development | 40 Comments

Pushing More Virtual Tin

We’ve been working for the last few weeks to get X-Plane 10.50 ready for public beta. My goal was to get 10.50 posted before I go to FlightSimCon 2016, but it looks like it’s going to be Monday or Tuesday of next week by the time it’s live.

A bunch of us (including Austin, who is presenting) will be at the Conference, and most certainly at the bar after – if you’re there, come say hi. We’ll be talking about the latest stuff in X-Plane 10.50, and possibly some stuff from the lab as well.

Getting the Planes Moving

As part of the ATC tune-up for X-Plane 10.50, Austin and I have worked on a number of features and bug fixes that should hopefully improve the rate of arrivals and departures at our airports. The current code can get pretty backed up, and we’ve had complaints from users about very long taxi times. (Ironically, this totally happens in real life, but I understand that you don’t want a simulation of KDFW when a thunderstorm passes through or KLGA on a Friday afternoon of a long weekend.)

Here are a few of the changes that help move traffic:

  • The AI drive better. And the better they drive, the less likely they are to bring traffic to a standstill.
  • ATC has a more realistic estimate of the speed of the AI aircraft. In 10.45, X-Plane launches AI aircraft as if they were real pilots at O’Hare. The actual AI drives more slowly and tries to err on the side of safety; by giving aircraft bigger margins of safety, ATC avoids go-arounds.
  • Simultaneous parallel-runway operations are now supported for VFR weather. One reason for go-arounds is that 10.45 has the hard-ball IFR rules (think socked-in) for runway separation, which means that very close parallel runways can’t operate at the same time. This is no longer a constraint on a nice day.
  • ATC uses same-runway-separation rules. These rules let ATC launch aircraft faster when they turn off the runway heading or when the aircraft are small. This means that if a C172 departs on a 10,000 foot runway, you don’t have to wait (five hours) for it to get to the far end of the runway.

There’s one more thing that really helps expedite traffic that you can do: make custom ATC taxi routes in WED for your airport. Having clean, correct taxi layouts with well-planned runway flows makes a huge difference in terms of ATC efficiency and AI operations.

To help you do this, we’re adding more tools to WED to easily edit and understand ATC data and diagnose problems.  WED 1.5 should be in beta in the next few weeks and has these enhancements. We will also put together articles showing some common problems with ATC layouts and the best way to author them in WED.

 

 

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in News | 31 Comments

Austin Goes Viral

He even got on slash-dot! Anyway, if you want to see a short six minute explanation of why we are being sued, here you go.

YouTube Preview Image

And to state the obvious, we are not discontinuing any of our products, we are not dropping Android as a platform, and we are in no way backing down because of the lawsuit. As you can tell from the video and Austin’s posts, Austin has some strong feelings about standing up to patent trolls.

X-Plane 10.50 update coming tomorrow.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in News | 23 Comments