Blog

Experiencing unexpected crashes to desktop on WED on Windows 10? Here’s why…

We have received at least 5 bugs for WorldEditor that seem to have similar characteristics

  • Inexplicable crash to desktop with no error message
  • Happening on Windows 10, not reproduceable on Windows 7, Linux, or WINE
  • Happens shortly after using the Truck Destination tool

In short, until we get a new beta out that officially fixes the issue, try downloading this nightly build of WED. Also, see all the bugs that are marked as duplicate and related to WED-780.

What happened?

Windows Tool Tips and You

Tool tips are those little pop ups that appear when you hover your mouse over UI elements. Sometimes their text includes helpful tips, sometimes they include data; it is whatever we program them to have.

Hovering the mouse over a cell in the WED hierarchy pane makes a tool tip appear with its content as its text.

The code to do that is located in xptools\src\GUI\GUI_Window.cpp:1252-1272. Windows passes a message to WED saying the user has hovered over some UI element, we hand over some text to a data structure (NMTTDISPINFO), Windows uses the data to display the tool tip.

Look at line 1272. This is the line that does the copying our tip string into the szText for Windows to display.

//wcs = wide-char-string = Unicode string, cpy means copy, _s means "more secure" version of the function
wcscpy_s(
di->szText, //The data in here will show up in
80, //Our stupid magical number
convert_str_to_utf16(tip).c_str() //convert our UTF-8 string to UTF-16 to please Bill Gates
);

This line was the source of the crashes.

What’s so special about the number 80 and “_s”?

Window’s gives you a free “no-work” string, szText, for your tool tip text that is 80 characters long. If you want a longer tool tip, you’ll have to do a bunch of (not well documented) work.

What makes this a “secure” string function is it immediately ends the program if you attempt to copy more than the specified 80 characters into the new string. This information is overwhelmingly under-documented. In addition, the crash doesn’t included any information about the cause, even in debug mode!

How did this go on for so long without getting caught?

Amazingly, we’ve never really had this be a problem, or previous versions of Windows have had this function not crash. One reason why this is now getting reported is due to the Truck Destination tool’s Truck Types property. When you add up enough of those strings and hover your mouse over them, it quickly ends up being much longer than 80 characters.

"Baggage Loader" + "Baggage Train" + "Fuel Truck (Jets)" + ""Fuel Truck (Liners)" + "Fuel Truck (Props)" = 81 characters in total.
With enough selected types, this easily reaches beyond 80 characters.
  • It is also possible we’ve just been getting lucky with our memory, always having strings getting corrupted exactly just right.
  • It is also possible that all our data is short, with abbreviations being so common in aviation, its normally hard to reach more than 80 characters.
  • Maybe no one reported a bug (please report your problems so we can fix them!)

Please comment if you have some ideas of why this doesn’t seem to happen on Windows 7, but does on Windows 10. Maybe this “secure” function isn’t as secure as we all think it is.

The solution: truncation!

Our easy fix for this is to chop a string off at 77 characters and append a “…” at the end. Hopefully no-one will mind this.

This new fix will soon make it into a beta and a release. Until then we have this nightly build available.

Final Thoughts

Thanks to a video sent in by a user, this was a pretty easy WED bug to find and solve. The hard part was weeding through all the bug reports that seemed shrouded in unrelated but related mystery. No one was realizing their most trusted friend, the mouse and common tool-tip, were causing the problem.

If you reported a bug, and this helps, please comment and contact us so we can clean out all the mysterious non-mysteries and get back to triaging bugs that have not been fixed!

Thank you for your patience as always as we try our best to make WED the best we can, and thank you to the people who report their problems instead of suffering through it, making a work around, or assuming their simply doing it wrong: You make the product better for everyone, including the developers!

Posted in Development, Scenery, Tools by | 22 Comments

11.01 and Immediate Work

With X-Plane 11.00 out the door, we have a few immediate things we are working on:

X-Plane 11.01: I’m hoping to have it beta early this coming week. We’ll roll the Linux DVD bug fixes into it, as well as rendering bug fixes that didn’t make 11.00, and a little bit of cleanup of the aircraft SDK.

Almost everything for the aircraft SDK is harmless cleanup, but there is one change in 11.01 that really should have made 11.00: the gamma curve on prop discs is still not correct in X-Plane 11.00. I am going to fix that ASAP for 11.01 so that third party developers can have stability.

Like most gamma corrections, your old prop disc might be too bright (because the old alpha blending tended to lose energy). With energy conserved, you might want to tone it down a little bit. I think this is the only gamma change that “got away” but I’m still investigating various cracks and crevices.

(The 2-d panel and panel texture will continue to have its traditional gamma-incorrect blending, matching X-Plane 10, 9, 8, etc.)

Documentation: we have a lot to update; I’ll try to get on FMOD docs as soon as possible. The X-Plane plugin SDK website needs a serious overhaul and may be in “temporary” mode for a week or two.

Developer Support: Philipp and I have been flooded with emails and requests from third parties involving their add-ons. I can’t speak for Philipp, but I’m probably back logged an entire month. If you’ve emailed us with some kind of issue, please be patient – there are a lot of you and not a lot of us.

I’ll post more details on 11.01 when we get closer to a beta.

Posted in Development, News by | 122 Comments

Linux and Aerosoft DVDs (and Fixed Apps)

Yesterday we received multiple reports that the Aerosoft X-Plane 11 DVD set does not work with Linux. It turns out that there’s something strange about how the DVDs are authored that makes the file names on Linux go all lower-case, which causes both the simulator and the installer to not be able to use the DVDs.

We have fixes for these problems that will be rolled into a new installer and the next update of X-Plane; in the meantime you can get them here for Linux now:

To install from the DVD, download this installer, run it, and insert your DVD, this installer from the net will install the contents of the DVDs normally.

Once you have installed X-Plane, replace your normal X-Plane-x86_64 app with the one attached here (placing the new app in your “X-Plane” folder) to run using the DVD to get out of demo mode.

You can use these two apps until we issue replacements; 11.01 should go beta early next week and contain “official” versions of these fixes, at which point you can just use the official version.

(Thanks to Daniel for his patience and helpfulness in trouble-shooting this remotely!)

Posted in Development, News by | 12 Comments

Sneak Preview: Pirate Mode!

Normally we try not to pre-announce new features before they are complete, but it’s been kind of an open secret around the company that we are working on native VR capabilities for X-Plane. Austin mentioned it on a Facebook Live stream, and Chris posted pictures of un-boxing his OcRift and Vive.

So today I’m going to show you a sneak preview of something that I’m just too excited not to post: X-Plane 11’s new Pirate-VR™ mode*.

There are two major challenges to integrating VR with a general purpose flight simulator:

  • Performance. X-Plane typically runs at 30-40 fps on a high-end system on a single monitor. How do we render a stereo image to two eyes without cutting frame-rate in half?
  • Usability. How do users interact with the complex cockpit buttons and switches using 3-d “wand”-type controllers that ship with today’s VR head-mounted displays?

Pirate-VR™ mode solves both of these problems.

When rendering to the head-mounted display, we simulate an eye-patch over the left eye.

By blacking out the left eye, we are able to recover quite a bit of framerate and run a stereo render at over 40 fps; minor optimization should get us to something fluid for the HMD.

In Pirate-VR™ mode, both of your hands are replaced by large metal hooks. Since it is pretty much impossibly to safely operate the over-head panel of an MD-82 with hooks for hands, we can skip 3-d interaction testing on most of the cockpit, simplifying VR interaction quite a bit.

I can’t announce when Pirate-VR™ will ship, but for scallywags who will be joining us at FlightsimCon in Hartford** this year, I think we’ll have something you’ll really want to get your hooks into.

 

* Yes, it is, of coarse, pronounced “Vee-ARRRRRRRRRR!”

** Update: my wife points out that the correct pronunciation is HARRRRRRRRtford.

Posted in Blooper Reel, Development, News by | 30 Comments

SHIP IT!!!!!!!!!!!!!!!!!!!!!

X-Plane 11.00 is out! Release candidate 1 is it. It’s out the door!

If you’ve been waiting for Steam – you can now get X-Plane 11 on Steam.

If you already own X-Plane 11 from our website and you had installed the release candidate 1 patch a day or two ago, there’s nothing new to download – you have the latest version of X-Plane, and it won’t auto-prompt you until we have a patch.

If you’re waiting on DVDs, the materials have been sent off to the duplicator, so my totally-uninformed-guess is maybe a week or two.

 

Posted in News by | 60 Comments

Life After 11.00

The rate of comments on this blog sky-rocketed when I mentioned that beta 16 was the last beta. (As it turned out, beta 17 is the last beta, because I had to fix a stupid bug I introduced in beta 16.) I would describe this as “fear of missing the train” as it leaves the station.

What will be the impact of actually shipping 11.0?  The short summary:

  • We will keep fixing bugs.
  • We will be able to fix some bugs that we were not able to fix late in beta because the changes are complicated and need more testing time.
  • X-Plane 11.0 users who don’t want to deal with unstable betas can simply stick with 11.0 until a patch goes final. This should make the whole beta process more pleasant for everyone.
  • We will have to write compatibility code for add-ons that depend on 11.0’s behavior.
  • The set of major features of 11.0 won’t change – we’ve made our “big plays” for the version.

In other words, post 11.0 will probably be like now but less stressful for everyone. I expect we will do at least one bug fix patch – we’ve had to do one for every major patch we’ve done but we don’t have a specific plan. We’re waiting to see what gets reported after 11.0.

Will It Blend?

We’ve pushed hard to get compatibility and SDK bugs fixed for 11.0 so that third party developers can “get going”. There is one area of the sim where we’ve had a pile of bug reports that, realistically, aren’t going to be fixed in 11.0 and might have some impact.

X-Plane draws translucent, blended effects (lights, smoke, clouds) in a fixed order. Because these are translucent effects, they must be drawn from farthest to closest or they won’t look right, but X-Plane draws them in a fixed order. The results are not good – when the order that X-Plane picks is backward, you get rendering bugs.

X-Plane has been like this for a very long time, and a lot of these bugs are present in X-Plane 10, and only more noticeable in X-Pane 11 because of lighting changes.

My concern about these bugs is that they may affect third party plugin interfaces. My goal is to get this resolved as quickly as possible to avoid surprising people.

The good news is that this is a pretty narrow part of the sim – if you’re not using plugins to draw, or you’re making an aircraft, or non-plugin-enhanced scenery, this probably doesn’t affect you.

Posted in Development by | 114 Comments

Philipp Made The Cessna Trickier

Philipp made a change to the Cessna’s autopilot that makes it more realistic, but also slightly trickier to use.

As of 11.30, the Cessna’s autopilot uses HDG + GPSS for nav course selection. Philipp wrote a developer article explaining what all five of X-Plane’s nav course source modes do, but here are a few notes.

Among autopilots that aren’t totally hopeless (e.g. the Sperry, “none” for its course source) there are two major divisions:

  1. Autopilots that get the heading for a VOR or ILS from the autopilot heading bug.
  2. Autopilots that get the heading for a VOR or ILS from an (E)HSI, leaving you to use the heading bug to pick your own heading.

This first category is less high tech and less useful to the pilot, and it’s the bucket the Cessna is in. If you want to fly a localizer, you have to set your AP heading bug to the localizer’s course, or the autopilot is going to lose its mind.

What this means is: if ATC gives you a heading to intercept the localizer, you cannot just engage heading mode, arm localizer mode, and fly the course to intercept – when you intercept the localizer, you won’t track it properly. You will have to adjust your heading bug onto the localizer front course once you start intercepting it.

The GPS is a special case: It works like a VOR/LOC when you are in NAV mode (affected by the heading bug) and like you’d expect when you are in GPSS mode (not affected by the HDG bug). So if you want to fly a GPS flight plan with twists and turns fully automated, you must press the NAV button twice in order to turn the autopilot to GPSS.

Something that can trip people up is that you cannot use GPSS and APR/GS at the same time – if you want to fly a WAAS approach with vertical guidance, you have to step down from NAV GPSS to NAV APR, which means you’re dependent on the pesky heading bug again. Confusing? Yes. Annoying? Certainly. Realistic? Definitely! This is exactly as annoying as the real thing.

 

The second category gets the localizer heading from either magic (GPS/LOC) or the OBS knob “OBS”) and always gets the VOR radial from the OBS course (which make sense). These setups let you fly a “dual mode” approach – engage HDG, arm LOC, and fly the intercept heading – when the localizer comes alive, the AP can switch modes and know which way to turn to intercept without you having to mess with the HDG dial.

You’ll find GPS/LOC-based systems in our Kingair (which has an EHSI) and Baron (which has a HSI).

Posted in Aircraft, Cockpits by | Comments Off on Philipp Made The Cessna Trickier