Blog

WED: WED’s Export Dies

Why the nerdy recursive acronym for WED?  Sometimes the data just stares you in the face.

I spent an hour today doing inventory on the build-up of WED bugs. That’s a screenshot of one of my bug screeners for the public scenery tools bug base – open bugs in WED 1.2b1 sorted by severity.  Notice a trend?  100% of the crash bugs come from the import/export module.  In fact, export bugs dominate the crash+major category too.

At this point I believe the DSF overlay export code simply needs a rewrite. The current code converts the polygons from my code to CGAL, then attempts to chop them up to fit into DSFs, and then converts them back and exports them. To put it mildly, this code is not working well.

As far as I can tell, CGAL 3.9 (the version we use) has reliability problems on Windows when processing Bezier curves.  I don’t know if it’s a build environment issue, something I did, or their bug, but I don’t trust the code path; we don’t use CGAL’s bezier curve processing for the global scenery project, so we don’t have strong data that this code will ever work.

Why Do We Need to Cut?

The current WED export code chops up your polygons to fit them into the DSF tile boundaries, because everything in the DSF must be contained within the DSF, right?

Well…

There’s actually nothing in the DSF file format to disallow ‘overhang’, e.g. a facade or some other shape that is partly in the DSF.  And for custom airports, having to cut buildings down the middle at lat/lon boundaries is unfortunate – the results can look ugly.

Unfortunately, as of this writing, X-Plane 10 requires the DSF to not “spill over” its boundaries.  But it looks like this could be fixed.

Multiple Export Fixes

This is my plan for fixing WED export, more or less:

  • WED will provide a “target” X-Plane version, e.g. 9.00, 10.00, 10.30, etc. This will select what kind of export features it can use.  If you try to export a project using a feature that cannot be supported (e.g. custom facade walls to a v9 airport) you will get a warning or error, depending on the nature of the problem.
  • WED export will not attempt to cut overlay data on-the-fly; rather it will either export the geometry spilling over the border (if allowed by export target version) or flag the span as an error.
  • An edit menu tool will be provided to cut geometry at DSF borders, for at least some DSF geometry types.

Why make border cutting a manual step?  I think that it will be more useful for authors to see the result of the border cut. For example, when a facade is border cut and has unique wall choices, the author has no control about the wall type of the wall that was introduced to span the DSF border.  With pre-cutting you can slice your facade, then pick a ‘safe’ wall type for the two walls that face each other at the DSF border.*

WED will currently refuse to border-cut some geometry; I think this will continue in 1.2, albeit this will happen in the “cut at borders” command – if you request to cut a bezier type WED may refuse.

* No matter which way you slice it, cutting facades at the DSF border sucks. This is why I think the long term solution is to allow facades to span borders, at least a little bit.

Posted in File Formats, Scenery, Tools by | 15 Comments

Three Levels of Lua

I seem to be having the same conversation with lots of third party developers via email, so I’m going to write up some of my recent thinking on Lua – if nothing else, it will save me typing the same thing over and over.

One thing was very clear in the X-Plane 10.20 beta: while authors can’t agree on Gizmo vs. SASL*, the entire authoring community is surprisingly united around Lua as a scripting language – it’s everywhere in the payware add-on market.

But Lua is being used for a lot of different things – and these levels of usage are paralleled in Gizmo and SASL; my opinion on the use of Lua must be qualified by which usage we are talking about.

  1. The simplest level is “datarefs and math”.  At this point, to fully utilize the aircraft SDK, an author needs to be able to create and do very simple math with datarefs – something that is not possible inside an OBJ or panel.**  Right now we don’t have an easy way to do this basic dataref math.  Writing a C plugin and compiling for 3 platforms is a huge hurdle to jump just to wire up an animation to a custom rotary switch.
  2. Gizmo and SASL both provide ‘add-on’ SDKs – custom sound APIs, particle systems, physics, gauges – basically replacement SDKs for parts of the sim’s own extension system where authors wanted more than we provide.  This stuff isn’t Lua at all – the underlying systems are coded in C++ and thus can only be maintained by the C++ developer who writes the Lua-based plugin.  The development cost (in man-hours) to do a particle system in Gizmo or SASL is abotu the same as it would be to build it into the sim.
  3. Some authors have written fairly huge scripts in Lua – for example, doing complete systems simulations or navigation code in Lua.  (At least, that’s what I am told, e.g. the JAR A320 – I haven’t read the Lua scripts myself.)  This is “Lua as language for a huge program.”

This is my current thinking on these three tasks:

  1. Datarefs and math are a great use of Lua – it lowers the bar for authors, it’s exactly what scripting languages in games are meant for, and the underlying code in C++ is finite, limited, and therefore not a maintenance problem.  I don’t know what LR’s relation to Lua, Gizmo, SASL, or scripting is yet, but I have been saying for a while (internally in company discussions) that we need something easier than C for this.
  2. I think that if an authoring SDK is limited in X-Plane, we (LR) need to make it better.  In the most useful cases where people are doing things with Gizmo and SASL, we sometimes have on our road map features to add to X-Plane that are similar.  (But note that these features aren’t necessarily coming soon – authors get a time to market advantage by using these outside SDKs.)  I consider this plugin code to be a possible maintenance problem.  For example, you can write graphics code in a plugin, but it may not integrate well with next-generation rendering engine features.
  3. I don’t see huge plugins or huge scripts as something LR should get involved in.  If you want to make a truly huge or complicated add-on, that’s great, but it’s a big undertaking and it just takes a development team.  I don’t know if Lua is good for huge development; the people who say no (people like me) have no serious Lua experience, and the people who say yes have no serious C++ experience.  So far I’ve only heard from people who have lived on one side of the grass.

Anyway, one thing is clear: having LuaJIT work in a plugin is a necessity for X-Plane now; with 10.20 we’ve sunk the engineering cost to make this happen.  I do not yet know how else (or if) we will leverage Lua.

* Don’t even bother to comment on Gizmo vs. SASL – I will delete any attempts to start a Gizmo vs. SASL discussion so fast that your head will spin around 360 degrees!

** No math in OBJs or panels.  An OBJ is a 3-d model – it is data that you view, not a simulation to be executed!  We do not want to mix visualization with simulation or data with code!

Posted in Aircraft & Modeling, Development by | 8 Comments

X-Plane 10.20 and Bug Fixes

X-Plane 10.20 went final last night – we are now officially 64-bit (as well as 32-bit).

We have a number of small bug fixes that we will put into 10.2x bug fix releases – the name of the game here is small, unintrusive fixes that make a big difference to the sim without risking more problems.  We’ll get to bigger fixes in 10.30.

Small things may include:

  • A new apt.dat/nav.dat drop from Robin.
  • Fixing the King-Air wipers – it looks like our exporter script went nuts.
  • Fixing the command key on Mac – the control key works as expected.

Fog is invasive – that’ll have to wait until 10.30.

Posted in News by | 32 Comments

10.20 rc2 Is Here – Test Now!

X-Plane 10.20 rc2 is out – just a few crash fixes and the final code to support Lua-based add-ons.

If you make a third party add-on, please: go try your add-on with 10.20 rc2 now!

If we don’t find any new bug reports, 10.20 will go final next weekend.

Edit: the Kingair is, weirdly, missing a small panel of its fuselage in the right rear corner.  Tom has already edited the file and I’ll post it shortly.  I’m going to let the RC sit for a day or two to see if anything else washes up.

Posted in Development, News by | 21 Comments

Release Schedule – A Rough Timeline

Here’s a rough road-map for getting X-Plane 10.20 and friends out the door:

  • X-Plane 10.20: if all goes well, release candidate 2 will be posted overnight and you’ll get a crack at it this weekend.  RC2 fixes a few crash bugs and sets up Lua memory allocation the way we want it to be for 64-bits going forward.  (I also plan to post the rest of development materials for Lua plugins tonight.)
  • X-Plane 10.21: we are planning a 10.21 bug fix release.  It will include bug fixes that we have already coded but didn’t want to put into 10.20 late in the game.  It will also include new apt and nav data from Robin once he gets the next release done, and possibly more autogen. (If 10.21 goes out before the next autogen drop, we’ll do a 10.22 for autogen.)  We’re not looking to do anything major or disruptive in 10.21.
  • WorldEditor 1.2: WorldEditor finally has some (desperately needed) time on the road map; this should allow me to close out the major bugs in 1.2 and get it posted.  This is a high priority for us; we’ve done most of the work for the new airport system, but it doesn’t do anyone any good until WED 1.2 goes final.  (Yes, you are reading correctly, WED 1.2 is earlier in the road map than an X-Plane release.)
  • X-Plane 10.30: we don’t know when this will be or what will be in it with any kind of certainty, but there are some areas we’re looking at, like fog and visibility (where we have a mix of bugs and feature requests that might go well together).  I think that even for 10.30 we’ll be in “fix what we already have” mode, not “add more stuff” mode; we want to make X-Plane 10 as stable, solid and fast as possible.

One of the goals of this roadmap is to make sure that 10.20 itself is a stable 64-bit release that authors can target and users can run.  One reason why late bug fixes are going into 10.21 is to avoid delay in getting a solid, ‘final’ 64-bit release to everyone.  (We also expect that at least one major bug that was not reported during the long 10.20 beta will pop up as soon as we hit “final”, hence the expectation of 10.21.)

Please do not turn the comments section into a guessing game about 10.30; we don’t have a precise list of what goes into it, and if we did I wouldn’t post it anyway, because it’s likely to change over time as we get new data.

I have some specific comments on airports and ATC, but that’ll be another post.

Posted in News by | 26 Comments

Airplane Authors: You Will Need New 64-Bit Lua Plugins!

A quick follow-up on yesterday’s post regarding LuaJIT memory failures on Windows:

We will be making a change to how plugins interact with LuaJIT and X-Plane for 10.20 rc2.  If you have an add-on that uses a LuaJIT-based plugin (SASL, Gizmo, or FlyLua) you must get new 64-bit binaries for your add-on!  If you do not get new binaries, it will only be a matter of time before your 64-bit add-on stops working.

This change is unavoidable – it either has to happen now (in RC, when only beta testers have X-Plane 10.20) or later (when we’ve shipped the product and everyone is happily flying).  I think now is better — I would rather not have to do this at all, but the memory problems are not going away.

I am already in direct contact with the plugin developers who use LuaJIT to work with them on the needed changes.

With this in mind, I am hoping to cut RC2 later this week.

Posted in Development, News by | 2 Comments

Why Isn’t X-Plane 10.20 Release Candidate 1 Official?

A quick status update on X-Plane 10.20:

  • The Portuguese language bug in the installer is fixed – thanks to all of the users who helped test the new installer.
  • X-Plane 10.20 rc1 has two bugs that we have fixes for: a crash when opening radio controlled planes and a crash on 64-bit Mac under heavy load with Lua-based plugins.  We have fixes for both of those; the second has been privately tested for about a week.
  • We have one more new bug report that I am investigating: memory failures with Lua-based plugins and Windows.  This last bug (if it needs fixing) is serious and will kill our release schedule.  If we don’t need to fix it, we’ll get an RC2 out shortly.  I hope to have a verdict on the bug by tomorrow.
Posted in Development, News by | 1 Comment

Portugese Speakers: the Installer is Broken

There’s a bug in the latest installer/updater: if your machine’s default language is Portugese, it will crash.  I will post new installers that fix this as soon as I get back home on Monday (maybe Tuesday if the snow storm is bad enough).

For now, the sim will run, even though the updater will not.

Posted in News by | 6 Comments

10.20: We Have a Release Candidate

10.20 release candidate is out now; see the release notes for a list of changes.  There are two sets of bugs that we didn’t get to:

  • Some users on Windows are having sound problems; I will write more about this shortly in another post; we’ll fix this as soon as we can.
  • I have a set of bug reports relating to the airplane exterior lighting; I hope to get those fixed in a 10.21 build (as well as whatever one bug gets reported the day after 10.20 goes final).

Plugin authors: if your plugin has a problem with 10.20, you should have reported it weeks ago.  The 2.1.2 SDK is done, 10.20 is a release candidate, so the 64-bit SDK is ready for you and has been for a while now.

We will continue to slip additional airplane improvements and autogen into updates as we get them from our art team.

Posted in Development, News by | 38 Comments

ppjoy Crash Fixed

ppjoy users on Windows have been experiencing a crash on startup; this was a bug in X-Plane 10.10/10.11, induced by particular virtual HID devices that only ppjoy could make.   I found the problem and it will be fixed in 10.20.

In the meantime, if you need to use ppjoy and want to work around the problem, set your hat switches to discrete directions, not analog.  (X-Plane can’t use an analog hatswitch anyway; most people have this because it is a ppjoy default.)

As a side rant to ppjoy users: I was a bit horrified with the process of installing ppjoy.  ppjoy is an unsigned driver so I had to turn off driver signing in Windows.  ppjoy is also, as far as I can tell, not hosted anywhere official.  So I had to install an unsigned driver off of a file locker onto my Windows machine with the safeties off.

To be clear, I do not think that this is the author’s fault.  He is making freeware, and the only thing that would remedy these problems is money.  I do not and cannot expect him to give up not only his time (to code) but also pay to solve the distribution problems of official hosting and buying a signing certificate.

Still, the process of taking off all of the safeties to put random third party binary software on my Windows box was unnerving and not something I would ever do as an end-user.

As far as I know, the ppjoy crash and the PS3 controller crash are the only two known regression bugs* with joystick hardware, and they’ll both be fixed in 10.20.  (Linux users, needing to edit udev rules to use hardware is not something that we consider to be a bug – see this post.)

When will 10.20 go final?  Real soon now.  Plugin authors, if you aren’t already running on 10.20 betas, you should have been doing that weeks ago.

* Regression bug means: it used to work in 10.05 and stopped working in 10.10 when we rewrote the joystick code.

Posted in Development, Hardware, News by | 5 Comments