Blog

Version 9 – Probably Too Late

If you have a third party add-on and you haven’t tested it against X-Plane 9, well…honestly it’s probably a little bit too late to fix compatibility bugs now. We’re in RC, and only changes to fix critical bugs are going into the sim; everything else will have to wait for 9.1.

So if you have an add-on and you haven’t tested it against 9.0, for crying out loud, do it now! Submit the bug anyway – if we can’t fix it for 9, we can fix it for 9.1. But…after almost 14 weeks in beta, we’ve got to close this build up.

BTW a minor side note on fuel pumps…

In X-Plane 864, an airplane will run even if the electric fuel pump is off. (However, if the fuel pump failure is triggered and the electric fuel pump is off, either by switch or electrical-system failure, then you’re out of fuel.)

X-Plane 900RC1 restores this behavior; in beta 25, an electrical failure would turn off all sources of fuel. This is wrong for a plane like the C172 where gravity can feed the engine.

In the long term X-Plane does need a more complex abstraction (e.g. does this plane have gravity feed or engine drawn fuel, or engine driven pumps, etc. etc.) but for now the 864 model, while inaccurate and incomplete, causes less problems than beta 25, which was simply wrong for a number of planes.

Posted in Aircraft, Development, Scenery by | Comments Off on Version 9 – Probably Too Late

Installer Theory

Let me go into the installers in a little more detail before I start a mini-riot. Basically there are three “installation” operations that we (Laminar Research) support:

  1. Installing a new full sim from a DVD.
  2. Installing a new demo from the internet.
  3. Updating any installation from the internet.

The problem with the current installer model is that tasks two and three (get a new demo, update an existing installation) are handled by a single application. This means that the web-demo-installer/updater cannot know which choice (2) or (3) the user is trying to do (since both are legitimate) and therefore user error can result in the wrong operation.

The most common problem we have is users installing new demos when they meant to update a DVD install. The result is an old copy of X-Plane with scenery, a new copy without scenery, and a very confused user who has to contact us for help.

The solution I am working on is simple: provide separate applications for all three tasks.

  1. Like before, the DVD installer comes on your DVD. It installs the DVD, nothing else.
  2. A demo installer does nothing but install the demo. You get the installer from the web, probably from the “demo” page (which would have to no longer be an “update” page too). The demo installer always does a full install, and will stop you from trying to install on top of existing installations.
  3. The updater is always fetched by the app and updates the app. Thus the paradigm is that the app is “self-updating” (even though most of the work is done by a helper application). That updater (fetched by the sim) can only update the copy of the sim that fetched it.

Dealing With Problems

The above work-flow is meant to address most users doing the usual thing without technical problems. We must also consider how we will deal with tech support problems, and finally what the impact is on advanced users. There are two cases where we sometimes have to help users out:

  • If the DVD installer for some reason will not work for a user’s computer, we usually provide a downloadable DVD installer. You would insert the DVD, run this “DVD installer” and thus install the DVD. This is not the normal case, but we will probably continue to provide DVD installers specifically for users with tech support problems (based on the tech support incident), just like we have been in the past.
  • We will provide the updater directly for users who need to update the sim but cannot launch the sim. This is the exception case, so a direct link to the updater would not be globally advertised on the main page of the sim. Rather it would be a support link, again only provided to users who really need it. 98% of the user base will be able to update from the sim.

When you run the updater from the web (the support case) it will prompt you to locate your X-Plane folder if needed.

Advanced Users

Will you be able to keep multiple copies of X-Plane around? Absolutely. But you’ll have to manage your operations in terms of the “three operations” (make a new install from the DVD, make a new demo install from the web, update any one version you have laying around).

If you want to get a new web demo, you’ll have to use a separate application than you would for an update. I don’t think this is a huge problem; generally your best bet for keeping an old copy of X-Plane (when running a new beta) is to simply copy the entire X-Plane folder, rather than downloading the contents from the net.

Posted in Development by | 7 Comments

Fun With Installers

So first, if I promised you scenery tools about now (MeshTool, AC3D, or any of the other things I’ve been asked for), please wait two weeks and ask again. I thought Austin would be cutting master DVDs while I would have time for tools, but instead I will cut the DVDs, so tools will have to wait until the masters are done.

To calm any fear: if you have X-Plane 9 DVDs, you will not need to buy new ones. We will be periodically updating our master DVDs (just like we always have), but we’ve taken a number of steps to ensure that everything new since the original “Beta 1” DVDs will be deliverable by reasonably small incremental web updates.

If you are reading this blog, you’re probably an advanced X-Plane user, possibly one who makes airplanes or scenery or even plugins, and you’re probably comfortable with computers and know a lot about the sim. Please bear in mind as I describe some of the changes we’re making in the installer that we have users who have never used a computer before, and purchased their first computer to run X-Plane.

Simply put, the primary goal of the installer is to allow the non-experts to use X-Plane too.

Anyway, with this post I’d like to call attention to a feature that I believe very few people know about (because it was broken for a long time and yet we didn’t get many reports).

You can update X-Plane 8 or 9 from the About Box – when you pick “About X-Plane” the sim will check our update servers for new versions, and if one is found, it will give you an update button. This update button will then download the very latest installer and launch it, setting it to update the copy of X-Plane you were running.

X-Plane 9 beta 25 will be out soon; when it comes out, please try updating by using the About Box in beta 24. Let me know if the process works correctly.

(What’s so great about updating from the about box? Well, one of the biggest tech support calls we get is users who do not successfully patch their existing copy of x-plane, but use the web updater to fetch a whole new X-Plane, which of course has no scenery. When you get the installer from the about box, you always get the latest correct installer, and the sim tells the installer which copy to live. In the future we’ll be removing the “destination” button when you run this way, so it’s as simple as “go”.)

Posted in Development by | 9 Comments

Don’t use ATTR_cockpit outside the cockpit objects

I’ve blogged about this before, but…let me be totally clear:

Don’t use ATTR_cockpit in objects that are not one of the two cockpit objects for your airplane.
Don’t use ATTR_cockpit in the attached misc. objects for your plane – move the parts of the mesh that require ATTR_cockpit into the cockpit object.
Don’t use ATTR_cockpit in scenery objects.
The OBJ spec basically says as much when it says “don’t use cockpit features” outside of cockpits.
Now what goes wrong if you violate this varies with the betas vs. X-Plane 8, but I can tell you this: no version of X-Plane has ever shipped that will correctly handle ATTR_cockpit in attached objects for all cases.  There’s always been bugs in this not-such-a-good-idea code path; it’s just the severity has varied over time.
Posted in Cockpits, File Formats, Modeling by | Comments Off on Don’t use ATTR_cockpit outside the cockpit objects

Hardware Profiles

X-Plane 9 currently recognizes (roughly) three categories of graphics hardware:

  • Non-Pixel-Shader hardware (GeForce 2,3,4, Radeon 7000-9200)
  • First-Generation Shader Hardware (GeForce FX 5nnnn, Radeon 9500-9800, X300-X600)
  • Later-Generation Shader Hardware (GeForce 6, 7, 8, Radeon X200, Radeon X700+)

That first bucket is pretty simple: those cards don’t support programmable pixel shaders (as we know them today) and can’t run any shader effects. The “use pixel shaders” check box doesn’t appear in the rendering settings.

The distinction between the later two is a little bit more subtle. Basically the first generation of pixel shader cards (the 9700 and friends) support only 96 instructions for each pixel shader; this puts us right on the edge of sometimes not being able to draw all of our effects; we have to simplify the water slightly to make it work. The next generation of chips (X850 and friends) doesn’t have this limitation.

By comparison, while NVidia cards have been able to handle long shaders from day one, the GeForce 5’s shader performance is really poor.

So we bucket all of these chips as “first-gen”. When we detect this we:

  • Simplify shaders slightly (gets us out of trouble with the 9700).
  • Don’t default to shaders being on when the sim is first booted (because the framerate will probably be unusably slow).

Even though the 9700 provided very usable shader performance in its day, by the standards of modern GPUs, this older chip isn’t that fast, so it’s probably for the best that we not enable reflective water by default on machines with these cards.

By comparison, X-Plane deals with almost all other capabilities on an a-la-carte basis; particualr features are enabled if the right menu of hardware features is available. We do this to try to deal more flexibly with the wide variety of cards that are out there. Some examples:

  • You’ll get hardware accelerated runway lights if your card supports pixel shaders and sprites (virtually all shader-enabled cards have sprites).
  • You’ll get sun-glare effects if your card supports pixel counting (virtually all modern cards can do this).
  • The non-pixel-shader rendering code will show more detail if your card supports more texture units (this is only an issue with very old hardware).

I’ve been looking over hardware profiles a lot lately, and I suspect that the next big “jump” in hardware will be the DX10-compliant cards (GeForce 8, Radeon HD). There’s a lot of fine print in what the various cards can do between all of the pre-DX10 cards; at some point when we decide what menu of features we’ll require for rendering, we need to simplify.

My guess is that when we start to have “really advanced” pixel shaders that require hardware more sophisticated than what we need now, we’ll simply require a DX10 card. Otherwise we’ll have to sort through 8 different profiles of fine print, only to attempt to partially support cards that probably won’t be fast enough anyway.

(That is to say, a feature is only useful for us if it can run reasonably quickly. It doesn’t make sense for us to try to make a special “simplified” version of a rendering feature for, say, the X850 if every X850 is going to turn it off every time for framerate reasons.)

If any of this turns into hardware buying advice, I suppose it would be this:

  • If you are deciding between a DX10 and DX9 card (e.g. between the HD2400 and X1900, or GeForce 8600 vs 7900) go for the newer generation DX10 ards (HD or GeForce 8); if the card has decent performance you’ll also be setting yourself up for future features.
  • As always, pay attention to the fine print of the model numbers, particularly the configuration. Lower model number cards basically have fewer parallel components than higher number ones and that leads directly to lower framerate.

I see an add online for the GeForce 8500 for $70 and 8600 for $90. But if you look at the links below, you’ll see that the 8500 has only half the shaders of the 8600 – that’s going to be a huge performance difference for $20.

(So the moral of this story is: try to get an HD or GeForce 8 card, but don’t dip into the really low end cards because they’re stripped down too far for X-Plane use.)

These pages (NV, ATI) on Wikipedia list specs for a whole pile of cards and can be useful to decode the fine print.

Posted in Development by | Comments Off on Hardware Profiles

Road Trip

I’m going to be more or less out of the office next week – the Amichai Margolis band is playing a series of shows in Florida. I’m going to have to take the laptop – we’re too close to going final to miss a week of bug reports, but hopefully the next beta will stick for a while. (Initial reports indicate that the video driver initialization changes we made are fixing crashes and not causing new ones.) There will be a beta 23 shortly to address other bugs.

I wanted to take a moment to thank all of the users who have helped me debug video card compatibility problems remotely. I now have seven installed operating system configurations in my office, and it isn’t nearly enough to see all of the problems we hit in field. Looking back at my in-box this week is a reminder of how patient you all have been in trying test builds, sending log after log, helping get to the bottom of some very tricky issues.

Things are going to be a bit busy for the next few weeks – once I get back we’ll be finishing up the last few bugs, so it will take a little while to get back to questions about scenery, plugins, etc.

Posted in Development by | Comments Off on Road Trip

Instability in Version 9

One of the reasons why the X-Plane 9 betas have had so many more crash bugs than version 8 is that we introduced loading DSFs on a second core. This feature makes scenery loads much slower and (by using the second core) impacts fps less while they happen.

The problem is that I’m still fumbling with code that will allow this in all cases. (That would be three operating systems, two hardware vendors, and a myriad of drivers, some new, some quite prehistoric.)

Beta 22 will be out soon, and will contain the fourth major rewrite of the OpenGL setup code for X-Plane 9. So far the initial tests look good, but we never know until we let a lot of users try the code and find the new edge cases.

It’s relatively easy to tell if your instability is related to the use of OpenGL with threads: simply run the sim with the –no_threaded_ogl option. If things become a lot more stable, it’s a threaded GL problem. Mind you –no_threaded_ogl is more of a diagnostic than a workaround; without threaded OpenGL, the sim will pause when loading scenery.

(Also, to clarify, you’ll find talk on discussion groups and game forums about “threaded drivers”. Threads are a programming abstraction that can utilize multiple cores. What I am talking about is X-Plane using multiple threads to load scenery – in our case this requires interfacing with OpenGL. But a threaded driver is different – it’s just a graphics driver that’s been optimized for multcore machines. These two concepts are totally different; you don’t need a threaded driver to use X-Plane 9, and a threaded driver won’t make X-Plane 8 load without pauses.)

Posted in Development by | Comments Off on Instability in Version 9

GeForce 7 and Water Performance

A number of Windows and Linux GeForce 7 users have discovered that the command-line option –no_fbos improves their pixel-shader framerate a lot. Windows and Linux Radeon HD users have also discovred that –no_fbos cleans up artifacts in the water. Here’s what’s going on, at least as far as I can tell. (Drivers are black boxes to us app developers, so all we can do is theorize based on available data and often be proved wrong.)

Warning: this is going to get a bit technical.

FBO stands for framebuffer object, and simply put, it’s an OpenGL extension that lets X-Plane build dynamic textures (textures that change per frame) by drawing directly into the texture using the GPU. Without FBOs we have to draw to the main screen and copy the results into the dynamic texture. (You don’t see the drawing because we never tell the card “show the user”.)

We like FBOs for a few reasons:

  • Most importantly, FBOs allow us to draw big images in one pass even if the screen is small. For example, if we have a 1024×1024 dynamic texture but the screen is 1024×768, then withou FBOs we have to draw the image in two parts and stitch it together. That sucks. With FBOs we can just draw straight to the texture and not worry about our “workspace” being smaller than our texture. This is going to become a lot more important for future rendering features where we need really-frickin’ big textures.
  • It’s faster to draw to the texture than to copy to it.
  • If you’re running the sim with FSAA, then we end up using FSAA to prepare all of those dynamic textures. In virtually all cases, we don’t need the quality improvements of FSAA, so there’s no point in taking the performance penalty. When we render right into the texture, FSAA is bypassed and we prep our dynamic textures a lot faster.

Since copying to a texture from the screen predates these new-fangled FBOs by several years, most drivers can copy from the screen to the texture very quickly; however we have hit at least one case where FBOs are much faster than copy-from-screen. That’s really a rare bug, and as you’ll see below, we see more weird behavior with FBOs.

When do we use FBOs vs. copying? Well, it’s pretty random:

  • Pixel shader reflective water and fog use FBOs.
  • Cloud shadows and the sun reflection when pixel shaders are off do not use FBOs.
  • The airplane panel uses FBOs if the panel is 1024×1024 or smaller; if the panel is larger than 1024×1024 we draw from the screen and patch things together. So the P180 and the C172 are using different driver techniques!!

When you run X-Plane with –no_fbos, you instruct X-Plane to ignore the FBO capability of the driver, and we use copy-from-screen everywhere.

Mipmapping

There is one more element: mipmapping. A mip map is a series of smaller versions of a texture. Mipmapping allows the video card to rapidly find a texture that is about the size it needs. Here’s an example: imagine you have a building with a 128×128 texture. If you park your plane by the building, the building might take up about 100×100 pixels on the screen; your 128×128 texture is a good fit.

Now taxi away from the building and watch it get smaller out your rear window. After a while the building is only taking up 8×8 pixels. What good is that 128×128 texture? Its’ much too big for the job. With mipmapping, the card has a bunch of reduced-size versions of your texture laying around…64×64, 32×32,16×16, 8×8, 4×4, 2×2, 1×1. The video card realizes the building is tiny and grabs the 8×8 version.

Why not just use the 128×128 texture? Well, we’d only have two options with this texture:

  1. Examine all 16384 pixels of the texture to compute the 64 pixels on screen. That sucks…we’re accessing VRAM sixty four times for each pixel. Accessing VRAM is slow, so this would kill performance.
  2. Simply pick 64 pixels out of the 16384 based on whatever is nearby. This is what the card will do if mipmapping is not used (because option 1 is too slow) and it looks bad. Thsoe 64 pixels may not be a good representation of the 16384 that make up your building side.

So mipmapping lets the video card grab a small number of pixels that still capture everything we need to know about the building at low res.

We don’t mipmap our dynamic textures very often; the only ones that we do mipmap are the non-pixel-shader sun reflections and the pixel-shader sun reflections.

ATI

As far as we can tell, the current ATI Catalyst 8.1 drivers do not generate mipmaps correctly for an FBO-rendered texture. This is why without –no_fbos ATI users on Windows or Linux see very strange water artifacts. –no_fbos switches to the copy path, which works correctly.

At risk of further killing my track record of driver bugs in v9, we do think this is a bug. We have good contact with the ATI Linux driver guys so I have hopes of getting this fixed.

nVidia

It appears that the process of creating mipmaps for FBO textures is not accelerated by the hardware on the GeForce 7 GPU series. This is why GeForce 7 users are seeing such poor pixel shader performance, while GeForce 8 users aren’t having problems.

Now poor performance is not a bug; there’s nothing in the OpenGL spec that says “your graphics card has to do this function wickedly fast”. Nonetheless, what we’re seeing now is unusably slow. So more investigation is needed — given that the no-FBO case runs so quickly, I suspect the hardware itself can do what we want and it’s just a question of the driver enabling the functionality. But I don’t know for sure.

Posted in Development by | 3 Comments

The Limits of Orthophotos and Meshes in X-Plane

I get asked a lot about the limits of meshes and orthophotos in X-Plane. I’ll try to answer this, but the answer isn’t as simple as most people expect.

Texture Limits and Orthophotos

The maximum single texture size in X-Plane 8 is 1024×1024, and in X-Plane 9 it is 2048×2048.

I believe the maximum number of unique custom orthophotos that can be attached to a single DSF is at least 32768.

In practice, that number is pretty useless because X-Plane loads all textures for a DSF at the highest user-allowed res when the DSF is loaded. That means you tend to load a lot of textures. Every system is different and drivers have a lot to do with RAM efficiency, but generally you’ll run out of virtual address space and crash the sim before you can attach 32768x2048x2048 of pixels.

X-Plane has no limits on how the texturing is applied – that is, you can use your 2028×2048 texture to cover an entire tile or a single meter. So again, the limiting factor on the resolution of your orthophotos is how much total area you want to cover and how much RAM you can spend (remember RAM is also used for mesh complexity, 3-d models, etc.).

You do not need to have enough VRAM to hold all loaded orthophotos; the video driver will paeg the textures into VRAM. Virtual address space is the limiting factor. How far you push it depends on a lot of subjective things:

  • If you expect your users to also run with a lot of trees, 3-d objects, cars on roads, and some plugins, you can’t use a lot of RAM.
  • If you expect your users to have /3GB in their boot.ini and use nothing but your add-on, you can use a lot more RAM.

Generally the size of the DDS texture on disk is a good proxy for the virtual memory that is required to hold your textures.

It should be noted that these limits on texturing (due to X-Plane blindly loading a lot of stuff at once) affect all scenery types: objects, draped polygons, very complex airplanes, plugins, and not just terrain mesh orthophotos.

Getting Past the Texture Limit

It will take a future extension to the rendering engine to get past the current limits. Basically X-Plane will have to load textures at lower resolutions when they’re farther away. I don’t know when that is coming, but when it happens, it will increase the total amount of image data a DSF mesh can contain, because the limiting factor will be how much data is in the small area the user is looking at (since the rest can be stored at much lower res for far-away views). At that point the limiting bottleneck will be resolution (smaller means more data at once), not total image data.

Mesh Limits

Unfortunately, limits to the mesh are even more vague than limits to texture usage. X-Plane uses an adaptive mesh – basically you can put your vertices wherever you want. So the highest resolution you can achieve might be much smaller than 1 meter resolution, but you can only do this for a small area before the total mesh size gets too big. But this is okay – the intention of DSF is to let you put a lot of detail where you need it.

I believe that once again memory provides the first limitation to the mesh. That is – you’ll run out of memory loading your insanely huge mesh long before you hit a limit to the DSF container structure. And once again, even the RAM limit isn’t a hard limit because that virtual address space is shared with texures. Your mesh density limits actually go down when your textures go up because it’s a zero-sum game.

Estimating Memory

Here are some ideas on how to estimate your memory footprint:

  • Run X-Plane over ocean to get an idea of the baseline memory use that the sim needs without extra scenery.
  • Load your mesh without textures (move the textures away) to find the cost of the mesh itself. (I am going on the assumption here that you can rescale your mesh using whatever mesh generation tool you’re using).
  • The size of DDS textures is a good proxy for the memory used.
Posted in File Formats, Scenery by | 2 Comments

MeshTool: The Seeds Are Sown

Last night I created the “seed” files for MeshTool. Let me explain what these files are and why we’ll need them.

MeshTool is a wrapper around our irregular-mesh generation code. It will allow third parties to create base mesh scenery without having to create triangulations. Just like DSFTool saves people the work of having to encode DSFs (with point pools, command lists, and all that ugly stuff), MeshTool saves people the work of having to create their own triangulations.

MeshTool is a low level tool – you provide a text input file and some data. It’s designed to be an engine underneath tools like PhotoSceneryX, not an end in itself.

MeshTool will create “default” land-use terrain that approximately matches the global scenery, water, and custom orthophoto-based terrain. You (or a program you use) provide a text file that describes the boundaries between custom photos, land, water, and airports. You must also provide a SRTM-style HGT file for elevation.

How does X-Plane know what land-use should go on what terrain? That’s where the seed files come in. Our global scenery is generated from a set of rules that take into account morphology (land height and slope), approximate climate, and general land use. You provide the terrain shape via the HGT file, and we provide you with a seed file that contains climate and land use for that DSF tile.

Why do we provide the seed file rather than letting you find and create climate data? Well, our rules are tuned for a very specific pair of data sets; by providing the exact climate and land use data that we use, we assure that the rules files work correctly. The purpose of MeshTool is not to customize land use terrain, and we do not provide a mechanism for it. The purpsoe of MeshTool is to let you put orthophotos and new coastlines into the base mesh.

The good news is: seed files are tiny. They are typically 4 kb-8kb each; the entire data set is 322 MB total. That’s because the climate data is only 3×3 per DSF and the land use is only 121×121.

I hope to get MeshTool into some kind of testing within the next few weeks; if you are a programmer and would like to feed MeshTool from your own program, please contact me and perhaps I can arrange an alpha copy. I will also post the seeds as soon as I can.

Posted in Scenery, Tools by | 9 Comments