Blog

What Would Make the Library Less Error-Prone?

There is one particular library problem I see all of the time:

  • Scenery pack A exports a pile of art assets to the library.
  • Scenery pack B uses them.
  • User X installs scenery pack B but not A, and can’t run X-Plane.

X-Plane provides a way to work around this: a library pack can contain an EXPORT_BACKUP directive that tells X-Plane “use this art asset if you can’t find it anywhere else” – it’s for place-holder art of last resort.

So scenery pack Bcould contain a library.txt with the backup art to allow it to function (badly) without scenery pack A.

But, even though OpenSceneryX provides this “backup” library, I see over and over again scenery packs with no backup, and confused users who don’t understand why their sim doesn’t work.

I am open to ideas on how to fix this.*  One idea I had (which may or may not be useful): allow scenery pack B to list in its library.txt the scenery packs it requires by some human-readable name.

Then if/when X-Plane can’t find library files, it can provide a useful message like:

The scenery pack “Awesome Downtown NY” could not be loaded because you have not installed the scenery pack “OpenSceneryX.”  Download and install “OpenSceneryX”, then restart X-Plane.

But I am skeptical: given the low adoption rate of EXPORT_BACKUP I am not sure that authors of scenery are paying a lot of attention to library dependencies.

* But not this idea: just load the pack without art assets. I strongly believe that if X-Plane allows broken data to load, the amount of broken data in the scenery packs out there will go way up.  We have seen this happen over and over again; the quality of third party data is proportional to the severity of error checking.

Posted in Development by | 15 Comments

You Have to Link Against the Libraries You Need

Beta 7 is now out – see the links to the right for release notes and bug reporting. Beta 7 fixes a few fire drills with beta 6.  Good times!

Plugin Developers: you have to link against the libraries you use.  You cannot depend on X-Plane to provide those libraries for you!

Historically, due to poorly chosen project settings in X-Plane, X-Plane would “leak” libpng, libfreetype, and (in 10.10) libcurl.  Plugins that used these libraries without properly linking against them would still function: X-Plane would accidentally export these libraries, hiding the fact that the plugins accidentally didn’t link against them, and two wrongs made a right-for-now-until-something-changes.

If your plugin won’t run with X-Plane 10 beta 7 (32-bit or 64-bit), it means you’re not linking properly. The 64-bit build in particular does not share any static libraries.  So whatever library you need, go find the .a or .so or .dylib or .dll or .lib and link against it!  If you are on Unix or Mac, you can type

nm mac.xpl | grep "U "

To see a list of undefined symbols.  You should only see libpng in there if you linked against libpng.dylib or libpng.so.  If you are trying to link statically to your support libraries (and this is definitely the path I recommend) the only “U ” symbols you should see are XPLM and XPWidgets routines.

I will try to post additional SDK documentation on linker settings this week!

Posted in Development by | Comments Off on You Have to Link Against the Libraries You Need

X-Plane 10.20 beta 6: the Fastest Way to Crash Your Computer

Update: this crash may only be happening to users who have ‘runway follows contours’ off.  I still don’t ever see this on my machines, even when I do what I think should cause the bug based on the code and crash reports, but we’ll get this fixed somehow.

To hack around this, open X-Plane.prf in your favorite text editor, find the line that says

renopt_sloped_runways 0

and change the 0 to 1.  You might be (temporarily) back in business with beta 6.

Ever wonder where your crash reports go?  Let me show you!

That’s a screenshot from the back-end tool we use to look at crash reports – in this case, it is a view of all crash reports submitted against 10.20 beta 6 on all platforms, sorted by how they crashed.  Clicking on the links drills down for more details, but in this case, the one picture says it all: the code to “inflate” airports (that’s the code that turns an apt.dat file into real 3-d triangles) is crashing.

As far as I can tell, it’s bad luck that this crash happens at some airports but not the ones that I visited during testing; anyway, beta 7 “real soon” – realistically it’ll be 24 hours before I can get another beta posted.

It’s always a good idea to auto-report crashes – we don’t have to worry about “too many reports” because, as you can see, the reporting software gets us a very nice, clear picture of what’s going on.

Anyway, I’m sorry about the delay – we’ll get this fixed and then regular testing can resume.

Posted in Development by | 6 Comments

X-Plane 10.20 Beta 6:

10.20 Beta 6 is out – this build fixes the missing paths in the library that were causing the dreaded “Could not load fac/forest/beach” error. This build also puts in some important changes to 64-bit plugis, so below I will try to point out what matters to select audiences:

Users:

If you don’t make an add-on but you are still testing 10.20, there is still a kind of testing that we need (but you may not like it): is anything broken in the 32-bit edition of 10.20 that worked in 10.11?

This kind of bug (it worked in the old version but is broken now) is called a regression bug in the tech lingo, because the sim has “regressed” – it has gone backward.  This is the most important kind of bug for us to find for three reasons:

  1. No one wants to go backward.
  2. It’s easier for us to find the bugs in new features than random bugs in features we didn’t think we had changed.
  3. If you report a regression bug against two versions of the sim (it worked in 10.11, broken in 10.20) we have tools to see only the code changes from 10.11 to 10.20, which makes finding the bug much quicker.

So: please try the 32-bit 10.20 and if it fails at something that 10.11 did, please let us know ASAP!

Aircraft Developers

This build fixes the prop disc and airspeed indicator, and finally provides more datarefs for the anti-ice system; I suggest rechecking your airplane with these systems.  At this point I think I only have two airplane issues floating around on my radar:

  • The new light billboards and spill can be tricky to use, particularly when lights crash through the fuselage of an airplane.
  • The manifold pressure indication is FUBAR on helicopters.

Both of these bugs were present in 10.11.

In fact, we have no regression bugs on file in the airplane system between 10.11 and 10.20 32-bit.  So if you know of something broken with your airplane that is newly broken in 10.20 32-bit, please report it ASAP.  (You do not need to re-report bugs that were already present in 10.11 like the manifold pressure.)

Plugin Authors

This build integrates a fix for LuaJIT on 64-bit Macs; see the release notes and plugin SDK for how to use it.

This build also strips out the symbols of libpng, libcurl, and libfreetype2 on Mac and Linux.  These symbols never should have been visible in X-Plane, but they have been for years.

  • If your 32-bit plugin used to work on X-Plane 10.11 but stops working on 10.20 32-bit beta 6, please file a bug and we will figure out what to do.
  • If your 64-bit plugin use to work on 10.20 beta 5 but stops working on beta 6, your makefile or X-Code settings have a bug; post to the x-plane-dev mailing list to get help.

There may be future changes to 64-bit like this one; this is why I recommend not releasing while we are in beta!  Our goal is to ‘get 64 bit right’ now during beta while we can try and test.

Scenery

There are no open regression bugs from 10.11 against scenery; facade textures were borked and are now fixed, and the library should be restored.  So if your scenery pack worked in 10.11 and fails in 10.20, please report this ASAP!

I do have one open bug (present in all of the v10 run) that line markings are losing line segments; I hope to get that fixed by the end of beta.

(We also have a report that certain incorrect ATC/apt.dat files will hard-crash the sim – I think Chris will probably be able to get some better validation in place before beta ends.)

Posted in Development, News, Scenery by | 2 Comments

Phases of 64-bit Adoption

I’ve posted a number of times on the transition to 64-bit, we have release notes and a FAQ, as well as a number of tech notes for plugin developers, but in this post I want to cover how I see the community moving over to 64-bit.

64-bit is a fundamentally confusing issue – it’s one of those things that should be totally transparent to computer users, but due to the nature of code and plugins, 64-bit is not transparent.  So more explanation will hopefully at least not confuse the issue even more.  Maybe.

Is a Transition to 64-bit Even Necessary?  Does it Have to be Now?

The short answer is yes.  32-bit applications simply cannot take advantage of more than 4 GB of physical memory (among other limitations).  Every year CPUs get faster, people get more cores, GPUs get faster, GPUs ship with more VRAM, and every now and then we even get a faster PCIe bus.  During this time hard drive, SSD and RAM prices continue to fall.  You can bring your computer up to 8 GB of memory (Crucial memory – good stuff!) for $34.  But what’s the point if the app you are feeding is 32-bit?

In other words, the march of hardware is unrelenting, and if we want X-Plane to be able to use the full power of our computers, we have to go to 64-bit.

How soon do we need to go to 64-bit?  Mac users who like add-ons have been crammed up against that 32-bit ceiling for a while now, while Win 7/64 users mostly still have some headroom.  But the real question is: could we finish out a major version run in 32-bit?  Could we wait years to go 64-bit?  I think the answer is no.  Even if we didn’t care about the RAM limit on Mac and Linux* 64-bit will become a Windows issue too; it’s only a matter of time, and I suspect not that much time.

The Phases of Adoption

This is how I see the migration from 32-bits to a 32/64-bit world going:

  1. Beta.  That’s where we are now.  In this phase, 64-bit technology is unproven even in the sim itself.  Plugin developers are hopefully trying the 64-bit betas and looking for major critical bugs, but 64-bit isn’t useful for actually flying. (Well, the sim is beta, and I never recommend flying on the beta.)  I don’t expect anyone to ship a 64-bit add-on during this phase.
  2. Crossover.  Once X-Plane 10.20 goes final and we have a stable 64-bit build that third party developers can actually test against, we’ll have a phase where some add-ons come out in 32/64-bit formats and others are not yet ported.  The length of this phase will be the difference between the fast and slow add-on developers; different plugins will take different time to port, have different levels of complexity, etc.  During this phase, users will have to pick 32-bit for compatibility or 64-bit for memory use.
  3. Acceptance. Eventually we’ll arrive at a point where so many add-ons have been made 64-bit compatible that the norm and expectation is that all add-ons are 64-bit, and the community will mostly have to abandon add-ons that are not migrated forward.

Note that “acceptance” is not only after 10.20 goes final but there is an entire phase between 10.20 going final and being able to “just run all add-ons in 64 bit”.  This is because it is going to take time for people to move their plugins forward.

32-bit Still Works!

I cannot emphasize this enough: there is a 32-bit build of X-Plane in the 10.20 betas, and it should just work!  The switch from 32 to 64 bits is not a binary transition where we pull the rug out from under everyone in one swoosh and everyone scrambles.  It is the beginning of a migration that can happen over time, while 32 and 64-bit apps areboth available to everyone.

* I have heard people tell us that we don’t care about the Mac just when it is surging, that we should drop everything but Windows, and that Linux is, in fact, the wave of the future. We’re going to hedge our bets and keep supporting all three.  Having done the work to be cross-platform it doesn’t make sense to drop multi-OS support.

Posted in Development by | 28 Comments

Chopped Livery

We have received a number of bug reports on the livery system in X-Plane 10, as well as complaints from both users and authors about how the system works.  This post describes what I am thinking for liveries; if this proposal seems hair-brained, the comments section would be a good place to counter-propose.

Two notes on UI discussion before we jump into the details:

  1. We hate check-boxes.  If the UI debate is “which is better, UI A or B”, then the answer is pretty much never “let the user pick A or B with a check-box”, because the point of UI is to present the program in a human-friendly manner.  Having two different UIs with selection forces the user to become the UI designer, which is inherently harder.  So while we don’t have zero check-boxes in our UI, we really try to keep the ‘have it your way’ stuff to a minimum; X-Plane is a product for sophisticated users and if we put in a check-box every time we get a request for one, the product would be absolutely unusable.
  2. In arguing for UI, describe what you want to do, not how you want to do it.  If you describe an implementation but we can’t do the implementation, the discussion is over.  If you describe what you want to do, we can find several implementations and pick the best one.

Liveries Now

As of X-Plane 10.11, you can:

  • Select your livery when you open a plane using Open Aircraft…

But you cannot:

  • Change the livery without reloading the airplane, mid-flight.*
  • Select your livery from the Quick Flight dialog box.
  • Change your livery quickly (since a plane reload is slow).
  • Change which livery the QF dialog box picks for you – it always pick “no livery” (that is, default paint).

These first two bugs go hand-in-hand.  Because you have to reload the plane to change liveries, you lose the initialization that Quick Flight may have done for you.

* There is one bug to note: if you go to the open aircraft dialog box, select a different livery and hit cancel, X-Plane will change your livery on the fly but not reload the plane.  Some users have noticed this and use it as a back-door way to change livery mid-flight.

For 10.20

For the short term, I am converting the bug in the Open Aircraft dialog box into a feature – the dialog box will have a “change livery and keep flying” button to change your livery on the fly, and the “cancel” button will not unexpectedly change your livery.  Thus the functionality of the old “open livery…” v9 functionality will be part of “Open Aircraft.”

This isn’t perfect, but it at least addresses the issues of changing liveries quickly, or changing them while flying, without having to know about and use a hidden UI bug.

For the Future

There are more features we’d like to do in the future:

  • Have a dedicated livery-change UI again – perhaps one that ‘floats’ over the main window while you fly, so that you can see the liveries as you click on them.  This would be a quicker way to rapidly preview a large number of liveries.
  • Remember the last user selected livery in the per-aircraft preferences (along with quick-look keys) so that if you go to open an aircraft and don’t do anything else, we can pick the last livery you used.
  • Someday have ‘drill down’ functionality in the Quick Flight window so that you can set more detailed info about your plane (livery, weight and balance, fuel, weapons) and then go back to the main QuickFlight window.  This is a long ways off though.

None of this is going to make it into 10.20 – I mention it only to explain where we’re trying to go – the change for 10.20 are designed to not interfere with this future work.  The future work is all based on user selected livery choice, with preferences an easy selection.

Livery Choice in Plane-Maker

This finally brings me to livery choice in Plane-Maker.  I have always considered this a bit of a weird feature; it is inoperative in 10.20 and we are looking to get rid of it permanently – that is, setting a livery in Plane-Maker has no use in any of the above plans.  Our view:

  • The first livery you see if you first open a plane for the very first time in QuickFlight will be the default one.
  • Preferences should record the users choice of livery, and this should be done entirely from X-Plane. It should not be necessary to open Plane-Maker to change livery preferences, any more than Plane-Maker is needed to change rendering settings or joystick preferences.  User customization should be 100% in-X-Plane.

As I said before in the top of this article, if this seems half-baked to you, please describe what you want to do, not how you want to do it.  And please understand that when it comes to UI, less is more; we need to identify a small, highly leveragable set of UI options to cover a wide variety of features.  We don’t want to have 6 ways to do everything!

Posted in Aircraft, Aircraft & Modeling, Modeling by | 20 Comments

Some New Add-Ons

Two new add-ons out in the last few days:

The first is AlpilotX’s New Zealand Pro scenery.  This is a recut of all of NZ using higher quality global data, the global scenery algorithms run at higher settings (no need to tone them down if the whole world doesn’t have to fit on 8 DVDs) and some custom GIS algorithms Andras came up with to handle various features.

For me it’s exciting to see what the engine can do when someone let’s it a bit off of its leash; the global scenery is always a compromise between the possible and what can be done for all users over the entire planet – it’s a compromise to make a base layer.

NZP is donation-ware.  Andras* is not a Laminar Research employee – he is an X-Plane user who has gone so far with his scenery work that he works directly with us on the global scenery; we are very lucky to have his help — his contributions make X-Plane so much better, both when he works on the global scenery and on his custom work.

* Albert, who does the textures, is in this same category – they are two of a number of X-Plane users who have made outsized contributions to the sim!

Second, the McPhat ATR-72 is out.  I had a chance to meet these guys in Mallorca, and see some of their work-in-progress and the stuff on their laptops was really phenomenal.  I always enjoy seeing people push the envelope; it gives us an idea of where we need to provide more ‘headroom’ inside X-Plane.

On the subject of betas: I don’t know when beta six will come out – I think sometime next week but I don’t know if it will be early or late in the week.  We do have a potential fix for the library problems with autogen (the 10.20b5 drop with new autogen is missing some library definitions) so that should help people using custom scenery who are getting the dreaded “could not load forest/facade/beach” message.  (We changed our tools for the new autogen and accidentally lost some library paths which we are putting back.)

The old library did accidentally have a lot of library paths with the word “test” in them; I really hope no one is using them in their add-ons.  As a general rule, if the word “test”, “temporary”/”temp” or “hack” is in a library path don’t use it!

Posted in News by | 23 Comments

Please DO NOT release 64-bit add-ons

I probably should have said this earlier.

Please do not release 64-bit add-ons.

If you want to beta test your add-on in 64-bits, great!  If you have gotten 64 bits working, that’s totally cool!

But, please don’t ship 64-bit code.  The problem is: we are still in beta and there are still open issues with 64-bit plugins that have not been resolved.  If we make changes to the plugin system during beta to make 64-bits work right and your add-on is broken, you won’t be able to react to it if it is already released.

So wait – make sure to test against the RC.  Like new features and scenery file formats, while the new features is in beta, it is unstable and we’re not going to try to ‘protect’ you from change.  Once we go final, things will be set in stone but we are not there yet.

(In beta 3 we changed our address space layout on Mac…that should give you an idea of how new this stuff is.)

Posted in Development, News by | 16 Comments

Autogen Is Here, More Coming

X-Plane 10.20 beta 5 is out now – beta 4 was defective (installer-kitting problem).  This build drops in a lot of new autogen.

The most immediate bug report I’ve gotten is third party scenery packs that are broken because they use library paths that are no longer available.  I need to investigate what’s going on here, but I believe that we will need to post an updated library file that is not missing library definitions in a future beta.  It may take a few betas to get this set up.

I also have not had time to attack most of the ‘meat and potato’ bugs that have been reported, so again it may take a few betas.  We’re not rushing hard on the 10.20 run; I think it’s better to give third parties time to get their feet wet with 64 bits and make sure we address all of the technical concerns that come up from third party plugins.

 About the New Autogen

The new autogen included in 10.20 beta 5 includes some of the new buildings that Alex has been working on; there is more that is not yet complete or published.  The autogen art development actually consists of two tasks:

  • Creating buildings and fragments of buildings (both mesh and texture) that look good and have high performance. Because we want to make the autogen fast, Alex tries to reuse sets of autogen where possible.
  • Taking that “lego kit” of fragments and putting them into specific autogen art assets – autogen art assets are not just individual buildings – a single art asset builds an entire city block, encoding the rules for how a subset of the building fragments are used.

The main problem from 10.11 and earlier is that we had no autogen that provided urban buildings to irregularly shaped blocks – hence we fell back to the ranch houses, which just looked silly.  The new drop has more irregular autogen with higher density urban buildings.

There is another chunk of autogen Alex is working on that is not done yet: buildings that respond to vertical information.  This is why the Manhattan skyline just isn’t that “tall” – the DSF contains the height information.  But while we have art assets that cover the shapes of the city without ranch houses, we don’t have enough art assets that can respond to the “tall” directive.  When Alex drops that in we should see more vertical development.

I do not know what the timeline is for more autogen, but the general plan is simple: Alex will keep working on more art assets and we’ll periodically drop them in as we get them, each time bringing more realism to the existing global scenery.

Posted in News, Scenery by | 58 Comments

I Can’t Hear You…

Please file a bug if:

  • You have no sound with the default aircraft in X-Plane 10.20 beta 3 (either 32 or 64 bit).
  • You do have sound on 10.11.
  • You are on Windows.

If you meet all 3 conditions, please file a new bug even if you filed this before; beta 3’s log.txt includes better diagnostics to try to trace this; we need to know if changes we made fixed this problem or if it’s still out there.  (Like most configuration bugs, our machines here in the lab do have sound.)

Please do not file sound bugs against 3rd party aircraft in 64-bit mode; most of the time it’s the plugin not loading.

Posted in Development by | 8 Comments