SDK Q&A Stream Feedback

Speaking of mixing add-ons:

This is one of the most fundamental architectural principle impairing creativity in my opinion and this is what I’m alluding about with this statement. And there is a reason for this: the SDK inherits the mindset of the past, which is the mindset ACE developers had when they initially build the SDK for internal use which they later opened partially to the public as the official SDK. Here is what I mean by this:

In the Q&A they are saying FS2020 is a platform like Windows, and the add-ons are the applications like Word. This is not true nor representative to me. If I’d keep the same analogy, here is what it would be instead:

FS2020 is Excel

  • add-ons are Excel documents.

  • add-ons can only use the limited set of programing functions included in Excel.

  • the set of programing functions available are those selected for an Excel purpose only.

  • you can only mix documents if you copy/paste the content of one document into the other, creating a new tab for example.

  • when you do, you risk formula conflicts and non-working references to the other document.

  • an Excel document is no more than what the Excel developer thought it could ever be.

  • as a 3rd party Excel document author, you can never make an Excel document be something else than what it is, a document.

  • if the Excel programmers are only working with 3rd party document authors doing financial amortization documents, they won’t include statistical functions.

  • those wanting statistical functions are not listened to nor engaged with because Excel is only sold to financial people.

X-Plane/Prepar3D are Python runtime

  • add-ons are Python program.

  • add-ons can only use the limited set of language functions included in Python.

  • add-ons can extend the set of functions with the use of 3rd party libraries. They can even develop their own libraries to extend the language and use the resources available in the underlying operating system.

  • a Python program can be many different things the Python language inventor(s) couldn’t ever have imagined their language could or would do.

  • as a 3rd party Python program author, you can make your program anything you’d like it to be.

  • P3D Python is offering more functions but at a higher abstraction level (Say DrawCircle() )

  • XP Python is offering less functions but at a lower level (Say MakeVertexBuffer(), DrawVertexBuffer() ).

  • the runtime doesn’t need to provide a function for everything, just the minimum necessary for the language to be Turing complete. If it is, they don’t need to custom implement a new function because 3rd party Python program authors can do their own.

This specific Flight Simulator SDK vision consisting in “an aircraft is the container” (the document analogy above) is very strong. In practice I find this is reducing the scope of the gauge and system SDK in my opinion, and I can clearly see this impact already in current FS2020 add-on developments. For example:

  • It is hard to add a 3rd party gauge in any aircraft, like the G1000 WT gauge. You can’t add the gauge in any of you aircraft easily because this requires changing the aircraft container because the SDK vision is a self-contained entity, the aircraft, rather than a composable set of modules.

  • If you do find a way to add the G1000 WT gauge, you risk conflicts with the aircraft autopilot system, because both can only assume, in their own right because of how the SDK is imposing this on them, they are the sole entity in the aircraft controlling the autopilot.

  • yourcontrols add-on requires the other add-on to publish its own list of L:vars so that it can use them for interactions. It would be much easier with introspection APIs and a modern (i.e. non inherited from FSX) event system* (1)

These are just a few examples which are equality applicable to other simulators:

  • to P3D for similar FSX inherited vision in the SDK (L:vars for events, aircraft container vision), but at least P3D is offering much lower level features and is not sandboxing add-ons so that 3rd party developers can make solutions to addressing this.

  • X-Plane on the other hand is not suffering any of these, because the SDK is supporting in its very structure and feature set the composable modular concept vision. It is a much richer environment for developing add-ons even if the set of functions is much smaller in number, because they are lower level and therefore they are enabling more.

In my opinion I find the idea to lower the entry barrier to developing add-ons for FS2020 with JS/HTML and the in-sim SDK tools commendable and good for the franchise. I really think this is good this time with the choice of technologies they are using in FS2020, whereas I never thought this was good before with the “XML Scripting Language” which was at the time meant for this.

However, delivering this idea of a lower entry barrier in using higher abstraction constructs, shouldn’t be an excuse to not delivering lower and less abstracted constructs to more experienced developers wanting to do more than what the higher abstraction constructs is provisioning for.

A good example of this to me is the drawing API. At last, Flight Simulator SDK is offering a low level basic but sufficient vector drawing API and a bliter. This is the Asobo Drawing API, very simple, to the point of building vertices and drawing the path and no need for more (2). They also include in the SDK a nanoVG implementation using this low level drawing API. On top of which they are also including in the SDK a GDI+ implementation wrapping the nanoVG implementation in a thin layer. (3)

So if the GDI+ abstraction thin wrapper ontop of NanoVG ontop of Asobo low level graphics API was good enough for the CRJ and for Microsoft/Asobo to allocating development resources just for this, why shouldn’t the same approach be more widespread for the rest and the other type of add-ons or for other add-on vendors? In other words, there is a need for high level abstraction in order to lower the barrier of entry for sure, but there is also a need for lower level API to directly interact with some deeper entry points into the simulator itself, like in other simulators. In my opinion these are really essential to making FS2020 something greater as a platform than a spreadsheet for financial analysts.

But even before going all the way to this route, there are some very basic fundamental constructs which could rapidly and not disruptively be greatly enhanced. We’re detouring the code from FS9 to P3D5 in order to support these few core concepts and to augment the core simulation capabilities (we don’t need to in X-Plane), and I’m not talking millions lines of codes either. These are very light weight very specific augmented capabilities extending their usefulness to any add-on and could help solving some of the inter-gauge and inter-aircraft mixing and communication problems existing in the FS2020 SDK carried over from the FSX area SDK.


(1) In the X-Plane world, an event is a first class citizen, with a name, any other add-on can discover and trigger, and even intercept and transform. This applies both to stock events and runtime created events by add-ons. Furthermore, X-Plane is encouraging the practice to use path delimited names so that it makes it easier to categorize and lookup events. Add-on created events and stock are therefore displaying side-by-side in a coherent tree view in the GUI for example. Any hardware device can also bind to any stock or add-on event created at runtime because they are at the same conceptual level.

In the FS world however, an event is either a number or a stock name. The number type of event is one feature inherited from the past which is perfectly illustrating that the SDK is not designed with multiple add-ons from multiple sources mixed together from the get go. In effect when you mix another 3rd party add-on, you can’t know whether the other add-on is using the same numbers as you. The named type however is limited to the stock SDK event list. The naming convention is also confusing with a some events adopting a noun+verb and others a verb+noun approach. Even in the same category, events can have disparate names and this is due to successive teams adding events with each new FS version. There is no provision for 3rd parties to create their own named events and therefore, there is no way to publish events other add-ons could consume.

This last point is illustrating the founding concept of an aircraft is a sole container, because there is no provision in the SDK to accommodate mixing add-ons. And this has some serious consequences in practice: because there is no event system, gauges are forced to use L:vars as a substitute. The problem is L:vars are meant to store data add-ons can read and write only, and they can read and write the data when it is their turn to do so. In other words, say you have an add-on publishing an L:var to let other add-ons writing 1 or 0 to “trigger” an event. If the other add-on is triggering the event twice during its turn, the publishing add-on will only see 1 event, the last one written in the L:var. A proper event system requires a FIFO queue and an L:var is only a 1 item FIFO.

(2) They are not documenting whether this is CPU rendering (Asobo, SKIA, Blend2D?) or GPU rendering (Asobo, CoherentGT, SKIA?) though.

(3) I understand they spent the time and allocated resources to implementing the GDI+ layer so that it makes it easier for their 1st party partner to release the CRJ quicker with less effort porting the existing FSX drawing code, but I can’t help thinking 3rd party developer doing WASM gauges should have had only 1 choice, which is implementing their own abstracted drawing API on top of the Asobo low level drawing API. We still can hopefuly, but I feel the SDK GDI+/nanoVG now standard has a catch: not only this is creating technical debt with an old graphics API now in the SDK, but because it is now included as standard, many 3rd party developers with legacy GDI+ code might choose to just use this instead of redoing the drawing code. My experience with add-ons is 80% of the CPU resources most gauges are consuming in airliner add-ons are graphics related, and I can’t help thinking both the nature of the GDI+ abstraction in itself (there might be more efficient abstractions than those of GDI+) and their implementation in the SDK (it is WASM code on the CPU running the thin wrapper around NanoVG on the CPU, which is a heavy wrapper around the Asobo drawing API) is not the fastest way, and therefore, add-ons using the “easy porting way” will continue using more resources than necessary and will continue affecting the simulator performance.

5 Likes