Blog

XSquawkBox Goes 64-Bit

64-bit XSquawkBox is here.

Huge thanks to Wade for getting the beta going, and to Christian for writing brand new Mac audio support!

Besides being big news for VATSIM users (who were stuck in 32-bit land from now on), 64-bit support is a great fit for XSB because it uses a lot of memory for CSLs, and thus was never very happy as a 32-bit plugin.

This announcement is just that; an announcement.  XSquawkBox is not a Laminar Research product.  Please do not report bugs to us (Laminar Research).  Thanks!

Update: Wade says that this build is time-limited.  This is the first public build; he’ll release a time-unlimited build once he’s sure he has the bugs out.  So think of this as a public beta.

Posted in News by | 9 Comments

Kill Your Objects

X-Plane 10.25r1 will go final soon (this week I think) and will be almost the same as 10.25b3.  There is one new feature that I am ‘squeezing’ into the RC at the last minute. Squeezing features into an RC at the last minute is not very good project management discipline, but in this case the feature is simple in its implementation and will allow custom airplane authors to improve framerate a bit.

The feature is “object-kill” – that is, the ability to completely disable (via a dataref) attached objects from being drawn.  Even when objects are hidden, they have CPU overhead; this features lets authors determine (in their plugins) which parts of the plane are not needed and completely remove them.  That big link explains how to use it and what it does.

How the Killers Kill Objects

X-Plane is, for the most part, not like a first-person shooter or racing game; those games have incredibly detail-rich environments, but they also have players that (mostly) stay on the ground, and environments with a lot of near objects blocking far views.  By comparison, with X-Plane, once you take off and climb to about 300 feet AGL, you can see nearly everything around you.

For this reason, X-Plane takes a fairly different strategy than shooters when it comes to figuring out which objects to draw, and which not to draw.

  • X-Plane only eliminates objects that are off-screen (behind you, off to the side), too far away, or too small due to distance.
  • First person shooting games try to eliminate objects that are occluded by nearby scenery.  (They also eliminate the off-screen and too-small objects.)  Here are two Wikipedia articles on the basic techniques.*

We don’t try to eliminate occluded objects because the cost of searching for them would hurt fps at all times; since a lot of the time almost no objects will be occluded, we skip the step, saving overhead.

First person shooters often pre-compute “hint” information to determine which objects can be hidden.  This is not possible for X-Plane because the loaded scenery may be a mix of several scenery packs; while we could pre-compute occlusion information for the global scenery, custom scenery might eliminate the occluders (using exclusion zones), rendering our pre-computed information wrong.

But there is one environment where X-Plane looks a lot more like a first person shooter: inside the virtual cockpit.  The VC is an environment where there is a ton of detail at high density and a lot of occlusion.

Here’s the problem: first person shooters often set up culling data ahead of time in their modeling environments; the engine only evaluates the precomputed hints.  But airplane scan be modeled in any number of programs: Blender 2.49, Blender 2.6, 3DS, ac3d, or any program that can create 3-d.

Therefore the intention of object-kill is to let authors do their own culling and simply tell X-Plane (via datarefs) the result.  These techniques could be portal-style occlusion techniques, computed automatically, or simple rules coded in a script.

Inside/Outside Views

The X-Plane 3-d cockpit camera is a completely free camera – you can walk out of the cockpit, through the cabin, out the door, and go look under your wings.  I think that this kind of ‘freedom to roam’ adds a nice element of ‘playability’ to X-Plane, but it also comes at a performance cost.  We do not provide separate “interior/exterior” objects – every object is drawn in both the interior and exterior views, because the views are fluid.  You can always look in the window from an exterior view, and you can always walk outside from an interior view.

If you need distinct inside/outside views to improve performance, you can use object-kill to implement this feature.  Simply write datarefs to determine when the view is ‘inside’ or ‘outside’ and wire up each object with a dataref to kill it.  Kill your interior views in exterior views and vice versa.

(See below for more subtle ways to optimize objects.)

How Would I Use This Feature?

I am not an aircraft author, so that’s a highly theoretical question, but here is how I would use this feature:

  1. I would wire each object up to its own custom dataref and turn each one off in DataRefEditor.  For each object, I would note the change in CPU and GPU usage.  From this I can determine which objects are actually expensive.
  2. For each object that is expensive, I would look at my model, and develop simple rules for when I can avoid drawing them.
  3. I would code some ‘predicates’ – that is, functions that tell me about the state of my objects.  The idea of predicates is to summarize a set of conditions in question form.
  4. I would then code these rules into simple plugin-based datarefs to hide the objects at the right times.

Here are some of the predicates I would look at:

  • Is the camera in the cockpit?  (This requires looking at the XYZ of the pilot’s head position and comparing it to a box I determine from my model, as well as the current view mode.)
  • Can the pilot see backward?  (This requires looking at the pilot’s head horizontal rotation.)
  • Is the cabin of the airplane visible?  (E.g. for planes with a cockpit door, is that door closed?)

Then I can easily write rules like:

  • “if the camera is in cockpit and (the pilot cannot see backward or the cabin is not visible) kill interior cabin.”
  • “if the pilot is in the cockpit and the pilot cannot see backward, kill the entire external model.”
  • “if the pilot is in the cockpit, kill any details underneath the aircraft (gear, gear door, baggage doors, etc.).”

Two last thoughts on performance tuning by removing objects:

  1. It make sense to spend more time tuning performance on the views that matter most.  Note that the above rules are all for the virtual cockpit.  The virtual cockpit is where users will spend most of their time in the plane, including hand-flying it, so performance matters.
  2. You need the most fps gains on the views that are slowest.  So if the virtual cockpit is slower than external views (which it almost always is) it makes sense to do more work to optimize the virtual cockpit.

* I wrote some very simple anti-portal culling code for X-Plane in an attempt to measure what kind of performance gains we might get.  The conclusion: not much.

The problem is that X-Plane heavily groups objects into large clusters so that it can submit them via hardware instancing.  When a lot of objects are visible, this optimization makes a big difference in performance – it can be a 10x improvement in speed.  But the large groups also mean that, at any given time, at least some part of a cluster is on screen, even when portals are used.

When I turned off the grouping, portal culling cut the object load in half (after some hacking the engine).  That’s a big win, but the grouping gives us 10x the object budget, so we hurt object performance by 10x, and then improved it by 2x – not a win in the end.

Posted in Aircraft & Modeling by | 8 Comments

An Exclusive Club

The addition of airport buildings to the default installation of X-Plane in 10.25 makes it much more important than it used to be to prioritize your scenery packs. It also makes it much more important that custom scenery exclude the scenery below it.

I have heard reports of users going into X-Plane and deleting the airports we ship to deal with conflicts.  This is way more work than necessary, will be undone by the updater, and simply isn’t necessary. So this post will explain how you can sort out scenery conflicts without having to change content.

Some Light Reading

I try not to write up documentation in the blog – it’s not really useful to require users to search 900+ posts to find something I mentioned off-hand in a beta four years ago.  So I wrote a knowledge base article.  Please go read the entire article.  I’ll go get another cup of coffee.

Let me summarize how things are supposed to work:

  • Custom overlay scenery packs should be higher priority than our airports.  If you went out and got a custom scenery pack, you almost certainly want to see it, not our work. (Note that if you get X-Plane, run it once, then install custom scenery, this is what happens automatically.)
  • Custom overlay scenery packs should have exclusion zones to mask out the scenery below them, whether it is autogen, airports we ship, or rogue trees that have decided to invade a runway.  (The need to exclude what is below you is not new – this has been in the sim since X-Plane 8.
  • Mesh scenery packs should be lower priority than our airports if you want to see our airports on top of custom mesh scenery.  (This step is not automatic.)  Mesh scenery excludes everything (think of the mesh as one giant excluzion rectangle) so you can’t have overlays below meshes.

Where Theory Meets Practice

My favorite Farside cartoon ever is a picture of two sets of engineers standing next to the ends of two highways that were clearly meant to connect – the highways are misaligned and do not connect.  The caption: “Where theory meets practice.”

And like the cartoon, the reality of scenery packs doesn’t meet the theory in a few ways:

  1. Some custom airport overlays don’t have exclusion zones.  There was nothing under them in the past, so the authors didn’t bother to exclude.
  2. Some users have their global scenery at the wrong priority level.  The easiest way to have this happen is to delete scenery_packs.ini – the prioritization is lost and our airports end up on top.
  3. If you install a base mesh into X-Plane, it goes to the top of the priority list, which is stupid; it needs to be below all of the overlays.

What is particularly concerning is that users way of fixing this (going in and editing the actual scenery packs) is probably making the situation more complicated, not less. Here’s what I think needs to happen:

  • Custom scenery authors need to start excluding their scenery.  This isn’t a new rule; I consider it a bug to ship an airport without exclusion zones.  If you have a custom scenery pack and it doesn’t have exclusion zones, ask the author to add them.  It is not that hard to add a few exclusion zones in WED.
  • Users need to stop deleting their scenery_packs.ini.  The .ini file is there to help you resolve conflicts, but it won’t work well if you constantly delete it.  Once you set up your priorities properly X-Plane will not change them!  Put your base meshes on the bottom, default airports in the middle, custom scenery in the top, and you are ready to go.
  • X-Plane needs to get the priority of base meshes correct when they are first installed – the fact that users have to go and ‘fix’ the scenery packs list is really annoying.  We are looking at ways to fix this now, but unfortunately we don’t have any plan that we can execute in 10.25.  This is high priority for a future update.
  • X-Plane needs to keep its own overlay scenery (the airports we ship, the demo areas) at a lower priority than any custom overlays that users add.  This is the expected behavior and should be totally automatic.

Exclusion Zones and Custom Scenery

A number of authors have rightfully complained that the exclusion zone is a blunt object and doesn’t provide a way to carefully integrate autogen and custom scenery.

I agree, but I consider the problem to go significantly beyond exclusion zones; there is no way for a custom overlay to “edit” base vector data (e.g. to say “I want to move that road over there.”)  The underlying data doesn’t have any kind of identifier to refer to it, and the underlying data can change if we recut and take newer OSM data.

I think the future solution to this lies not in more precise or powerful editing in overlays, but rather in the fact that we’re getting more network bandwidth, and the global data we have access to is getting better.  Therefore the solution is to (1) push updates to the base scenery and (2) ensure that the base scenery is correct.  With this process working, misalignments between custom scenery and the default scenery will be less important, and authors can simply fix small but ugly bugs in the base scenery (via OSM) and the result will be better scenery alignment in an update.

Exclusion Zones and Shared Global Airports

It is possible to include exclusion zones in an airport you share with the global airport database for inclusion in X-plane; some authors have already done this.

There are some cases where an exclusion zone is a must-have:

  • If the airport gets a new runway, there will be autogen in the location where the old runway used to be; a draped polygon + exclusion zone can “clear” the area for airport.
  • If the airport has trees on the runway (a bug in the default scenery) you can “fix” the bug with an exclusion zone.

The global shared default airports are one case where I don’t think we need complete exclusion in an overlay – they are meant to be the lowest priority overlay, and therefore don’t need to exclude other scenery.

Posted in Scenery by | 12 Comments

It’s Not the Heat, It’s the Humidity

X-Plane 10.25 beta 3 is now available. If you already have 10.25b1 you will be prompted to auto-update.  This build adds some new dry-climate urban textures; here is a comparison.

If we don’t find any more show-stopping bugs, there will be one release candidate, with some updated level-of-detail distance internal settings.

In the future, I will try to write up the scope of changes for the beta-run when the first beta comes out, so you don’t have to ask “will you fix X in this beta?”  For small betas, we try to have all intended fixes available in beta 1, but sometimes (such as with dry urban textures) the fixes go into later betas because they are not ready).

Posted in News by | 22 Comments

10.25 Beta 2 Dies a Horrible Death

10.25b2 is Dead On Arrival.  This happens periodically to betas – they pass internal tests, I upload them, and then immediately find something bad wrong with them that is a show stopper.

So for now 10.25b1 is the current beta (again) – just re-run the updater if you accidentally got beta 2 in the 10 minutes that it was available.  Beta 3 will be up as soon as I can get a new beta cut; due to the time it takes to sync our servers, that might be late tonight.

See the beta wiki for what was in beta 2 – beta 3 will be all that plus it should actually work.

Posted in News by | 5 Comments

Please Try WED 1.2.1r2

I just built a release candidate of WorldEditor 1.2.1r2; if you work on airports, please try it and post a WED bug if something is really borked.

There are a few minor bug fixes, some usability tweaks, and two major ones:

  • The export format for sending zip files to Robin is modified to make things easier in the collection process.  For this reason, we’d like everyone submitting airports to go to WED 1.2.1.
  • The library view now hides the resources marked private or deprecated in X-Plane 10.25 or earlier.  So WED 1.2.1 and X-Plane 10.25 provide a much less cluttered library view.  (WED 1.3 will have a nice improvement to filtering as well.)

For more details on what changed, all commits to WED 121 are visible here.  (The commit notes are listed, and the yellow tags tell you the version where we then re-shipped the code.)

We are discussing internally how to handle a more permanent airport submission tracking system.  My current thinking is that eventually we’ll build file transfer directly into WED – that is, you’ll say “share this airport” and WED will call up our servers directly and send the airport; no zip files and email.  But that’s for the future.

X-Plane 10.25b2 should be “real soon” I think – I’m just waiting on one more change to cut the new beta.

Posted in Tools by | 4 Comments

Airports in X-Plane: State of the Union

One of the major initiatives of X-Plane 10 was to add buildings to our airports – terminals, hangers, warehouses, control towers, etc.  In X-plane 8 and 9 we had detailed taxiway line markings, lights, and signs, but most airports were devoid of structures.  The plan we came up with went something like this:

  1. Create a library of “lego brick” airport buildings.  The library provides visually high quality, high performance art-work with moderate variety and ships with the sim.
  2. Extend WorldEditor to edit DSF overlays as well as airports.
  3. Extend the global airport database that Robin Peel maintains to include buildings and not just apt.dat data, so that we can collect, share, and redistribute the buildings.
  4. Release airport building layouts (created by users, contributed to the database, using the lego brick buildings) as part of the sim.

In other words, take the process we have been doing all along  for taxiways, and extend it to buildings.  (Some would call this “crowdsourcing” the airports, but Robin has been collecting user-created airport layouts for us since long before such terms existed.)

So where are we on the project?  As of now, it is more or less completed!

  • X-Plane 10 shipped with the airport library.
  • WED 1.2 provides the tools necessary to create airports using those lego bricks.
  • We have a provisional process to collect those layouts.
  • The first 250+ airports are now included in X-Plane 10.25 beta 1.

Next Steps

So what do we do next?  We are working on a few separate initiatives.

  • Documentation, Instructions, and Tutorials.  We are working on videos, tutorials, etc. to help explain the process.  Some of the docs are done now – for example, Marty and Nick just finished their 13-part WED tutorial, which is a great introduction.
  • Automation and infrastructure.  We’re looking into what we can do to provide a more automated submission process, real-time viewing of what has been submitted, etc. We haven’t made any decisions yet; we’re evaluating options.
  • More library variety and WED features.  We wanted to wait on library extensions until we could see how people were using the existing elements; it makes sense to add more variety in popular categories.  WED 1.3 has additional usability features to make navigating the library easier.

How to Participate Now

We’ll have better documents on “how to participate” in the near future, but for now if you want to create your own airport and share it with the community, the basic process is:

  1. Get WorldEditor 1.2.0 (or 1.2.1 beta).
  2. Watch the tutorial on how to create an airport.
  3. Use “Export for Global Airports” to export the airport – you’ll get a zip file.
  4. Email that zip file to robin at x-plane.com for inclusion in the sim.
Posted in Uncategorized by | 24 Comments

10.25 Beta 1 Released

X-Plane 10.25 beta 1 is now live on the servers.  Release notes here, bug reporter here. Please do not submit beta bugs on this post.  There are a few big features of this update that I want to mention in a little bit more detail than the release notes go into.

Community-Created Airports

This is the first release to include airports with 3-d buildings submitted by the community.  We have received over 250 submissions so far; last I counted there were over 35,000 objects placed in those airports.

If you are working on an airport that you have not submitted, do not panic; we will continue to collect airports and release patches regularly to get them to all users.  We are also working on web resources, documentation and training to help make the creation process more accessible.

(A few pictures of default airports at moderate settings, airports picked at random.)

In these pictures I have tried to align the far views with the airnav overview pictures so you can get a sense of how closely people can and can’t match the real world with the airport library elements.

Urban Terrain

For the longest time, our cities have looked like a big green blob.  We have been working on this for a while; the problem is actually a three-part one.

  1. The urban terrain we shipped wasn’t very good – in some cases it wasn’t even meant to be released.
  2. The application of urban terrain to cities errs on the side of vegetation (and not concrete) in the DSFs, due to problems with the DSF zoning algorithm.
  3. The autogen footprints don’t persist when rendering settings are turned down.

The urban terrain in 10.25 beta 1 addresses problem (1) for wet climates.  I am hoping we’ll get a working dry-climate urban terrain set before the beta is over, but that is still in progress.

What about the other issues?  We have a fix for (2) in our DSF generator, so recut cities will have better far-view balance than the first generations do.  We have ideas on how to fix (3) for a future update.

In these pictures you can see a far view of New York City in 10.22 (shipping now), 10.25 (new wet urban terrain), and 10.25 with a recut DSF fixing zoning, based on the current DSF generation code we hope to use.

Hopefully you can see from these images that while the new urban terrain helps, it works best when the zoning bugs are fixed in the DSF as well.

Edit: to be clear, 10.25 does not ship any DSF recuts.  We have not yet shipped recut tiles.  The NY City pictured is a recut DSF I made for myself last night for code testing purposes; it illustrates improvements to the DSFs due to new data and bug fixes in the generation algorithms.

Posted in News by | 41 Comments

WorldEditor 1.2.1 Beta 1 – Ease of Use (for Robin too)

I just posted a beta of WED 1.2.1; hopefully it will only take one beta to get this quick “bug fix” patch done.

Some usability fixes:

  • Locked and hidden items don’t cause clicks to select their parents.
  • The interior of an airport boundary is not selectable – it never should have been.
  • The marquee tool will never select the “world” entry on the hierarchy.
  • The click hot spots of handles don’t shrink at low zoom – they were doing that before, which made clicking hard.

(Basically Chris tried to use WED and got really annoyed*, so we dug in and fixed some of the smaller annoyances.  The ones we left (like how locking works) need a major rework and can’t go into a bug fix.)

1.2.1 also filters out the private and deprecated library items (once you have X-Plane 10.25, beta coming “real soon now”).  This should make the library display a lot cleaner. Also, hidden airports won’t export or fail validation, which is what you would expect.

The only other changes are a bug fix for exporting polygons on a DSF edge, and a bunch of changes to help Robin collect global airports.

If you are using WED 1.2r4 to make airports, please try 1.2.1b1 this weekend, and file bugs here.

* Which was difficult to differentiate from his normal state.

Posted in News, Tools by | 11 Comments