- Messages
- 284
- Country
Hi everybody! The time is finally upon us that we can talk about MS2020, and specifically developing for it.
I had a version of this post drafted that did not include SDK details, however it would appear from the other post that they have indeed released the SDK with the sim.
Some of us have been working with the tech already so I'd like to give an overview of where it is at and what has changed, and what we know so far. Keep in mind that many things are TBD or WIP, both from our understanding and from an SDK / platform perspective. These can be further expanded in detail in subsequent posts.
1. Is it based on FSX Tech?
Yes. More or less the entirety of the FSX codebase was compiled in, with obviously some systems being supplemented or totally replaced. This means some things "just work" out of the box:
* XML gauges
* SPB files
* Various aircraft systems
* Basic simobject container structure
* Pieces of airports (more later)
Other systems have changed entirely or substantially:
* Terrain
* Aircraft programming
* Atmospherics / weather
* Aerodynamics
Essentially the sim is composed of an FSX base (not MS Flight) with many improvements, combined with Asobo's graphics engine on DX11 (although it is cross-platform and being ported), plus a Bing maps engine, and the bongfish / blackshark procedural engine.
2. State of the SDK
Version 0.5.0 is out, you can download it from in the sim (see other thread for instructions).
You'll note that it is a work in progress, and still under heavy active development. That's all I'll say for now, we can look forward to continued updates and you should go explore what is in there now.
One thing that will take some getting used to is the tooling is all in-sim using the "dev mode". There are no longer standalone command line tools to compile various file formats, everything is a "package" and is either built in the sim using the GUI or from the command line sim package tool launcher tool in the SDK.
Packages are a simple XML format that the dev mode parses and then uses to generate the actual addon files or signatures if need be. Unfortunately we don't have the full schema for this (yet) and different package types are heavily under development so robust out-of-sim tools may not be practical yet. That being said, go explore the in-engine dev mode, it is very powerful and there may not be a big need for external authoring.
3. What's the deal with these "packages"?
MSFS uses a fully virtualized file system, similar to Flight if anybody ever worked with any of Steve's tools, with a major difference being the zips are extracted to your local file system. Be sure to pick a custom path for the addon content when installing the sim, else this will be way up in your appdata folders.
There is the onestore (no public details / still under NDA) and then a community folder where you can test and distribute packages. All of the default content is installed under "onestore" but you can browse some of it.
A significant departure from previous sims, although similar to many modern game engines, is the requirement that many file changes within your package as you are working on it will require you to "rebuild" the package before the sim will load it, as a form of security and validation. You'll get used to this process pretty quickly, but remember to do it.
A built package can be distributed to users to put in their community folder.
4. What about programming?
Although a source of consternation for some, I want to just stick to the facts on this one.
XML gauges are fully supported, some have reported very minor differences in parsing and systems but it is mostly drop-in.
C++/native gauges have been replaced with a new C++ LLVM / WebAssembly based system. The idea is that upon installation of the SDK you get a new project type (MSFS Project), and you can use this build config to target this platform, in addition to any other platforms like an x64 config for P3D V5. There's no need to really learn about Wasm/Clang/LLVM yourself as this is all fused and distributed with the SDK and integrates directly into VS.
Webassembly modules are distributed as LLVM bytecode (much closer to native assembly than something like .NET IL). They are then JIT compiled on your clients machine on first run by Innative, which the Asobo engine hooks to then add function pointers to native code for things like the gauges.h functions.
So you still compile your C++ through Visual Studio (2019), you just target a different platform. Note that this is currently a single threaded (threads are coming soon) 32-bit environment. You can still use SimConnect.h and Gauges.h which have been ported to work under Wasm, as well as the new MSFS*.h files. There is no concept of "Windows" or Windows.h here, which will probably catch many C++ programmers who are not used to doing cross-platform work by surprise. Atomics are now also working, so most things without explicit threading will build with few changes.
Static libs are now supported and you can pretty easily build things from source for them, such as Boost. Remember - no dlls, no .libs, you need to rebuild from source any 3rd-party dependencies to .a libraries. The debugger is not as good as you are probably used to due to the Wasm linear memory model but is being worked on now.
Note that this is all sandboxed (go read up on WASI for the motivations), meaning if MSFS doesn't give you an API, you can't do it. You can't access arbitrary file locations on the host (you do get access to a folder local to your package for saving / reading data), you can't do things like Windows Registry, and can't do web requests yet. This is a restrictive environment but intentionally designed to make it very easy to repackage and publish your app on many different platforms, and MSFS has many cross-platform ambitions.
There is much to still be worked out in this system, but it is certainly an app platform for the future. For a taste of how powerful Webassembly can be, check out https://lightroom.adobe.com. Yes, we run a massive C++ codebase in your browser.
There is also a new javascript based gauge system that I will describe in further detail below.
5. What APIs do we get?
The sim comes from FSX, so SimConnect is still the standard API. In fact it's the same on-the-wire protocol version. Do note that the TCP implementation on localhost is deprecated for named pipes. For out of process you can either use the new native DLL (like FSUIPC has been doing) or there may be a static lib coming soon. There is also an out of proc .Net client dll that ships with the SDK. For in-process you are required to use Wasm modules and the native SimConnect client.
Also note that it's roughly the same API footprint as FSX. There are some Key Events and Simvars that have changed and are not documented or hooked up through SimConnect yet, this will evolve. Things that were added over the years to SimConnect in P3D are not there and may catch you by surprise, and obviously there is no PDK-style interface. There are also some SimConnect functions (like some around weather and AI) that are either not yet hooked up or have behavioral changes or regressions. Asobo is working heavily on stabilizing the SimConnect API, and then will be expanding it as well.
There is a new gauges system as well that I will describe in the html post.
Ok that's the start, more to come.
I had a version of this post drafted that did not include SDK details, however it would appear from the other post that they have indeed released the SDK with the sim.
Some of us have been working with the tech already so I'd like to give an overview of where it is at and what has changed, and what we know so far. Keep in mind that many things are TBD or WIP, both from our understanding and from an SDK / platform perspective. These can be further expanded in detail in subsequent posts.
1. Is it based on FSX Tech?
Yes. More or less the entirety of the FSX codebase was compiled in, with obviously some systems being supplemented or totally replaced. This means some things "just work" out of the box:
* XML gauges
* SPB files
* Various aircraft systems
* Basic simobject container structure
* Pieces of airports (more later)
Other systems have changed entirely or substantially:
* Terrain
* Aircraft programming
* Atmospherics / weather
* Aerodynamics
Essentially the sim is composed of an FSX base (not MS Flight) with many improvements, combined with Asobo's graphics engine on DX11 (although it is cross-platform and being ported), plus a Bing maps engine, and the bongfish / blackshark procedural engine.
2. State of the SDK
Version 0.5.0 is out, you can download it from in the sim (see other thread for instructions).
You'll note that it is a work in progress, and still under heavy active development. That's all I'll say for now, we can look forward to continued updates and you should go explore what is in there now.
One thing that will take some getting used to is the tooling is all in-sim using the "dev mode". There are no longer standalone command line tools to compile various file formats, everything is a "package" and is either built in the sim using the GUI or from the command line sim package tool launcher tool in the SDK.
Packages are a simple XML format that the dev mode parses and then uses to generate the actual addon files or signatures if need be. Unfortunately we don't have the full schema for this (yet) and different package types are heavily under development so robust out-of-sim tools may not be practical yet. That being said, go explore the in-engine dev mode, it is very powerful and there may not be a big need for external authoring.
3. What's the deal with these "packages"?
MSFS uses a fully virtualized file system, similar to Flight if anybody ever worked with any of Steve's tools, with a major difference being the zips are extracted to your local file system. Be sure to pick a custom path for the addon content when installing the sim, else this will be way up in your appdata folders.
There is the onestore (no public details / still under NDA) and then a community folder where you can test and distribute packages. All of the default content is installed under "onestore" but you can browse some of it.
A significant departure from previous sims, although similar to many modern game engines, is the requirement that many file changes within your package as you are working on it will require you to "rebuild" the package before the sim will load it, as a form of security and validation. You'll get used to this process pretty quickly, but remember to do it.
A built package can be distributed to users to put in their community folder.
4. What about programming?
Although a source of consternation for some, I want to just stick to the facts on this one.
XML gauges are fully supported, some have reported very minor differences in parsing and systems but it is mostly drop-in.
C++/native gauges have been replaced with a new C++ LLVM / WebAssembly based system. The idea is that upon installation of the SDK you get a new project type (MSFS Project), and you can use this build config to target this platform, in addition to any other platforms like an x64 config for P3D V5. There's no need to really learn about Wasm/Clang/LLVM yourself as this is all fused and distributed with the SDK and integrates directly into VS.
Webassembly modules are distributed as LLVM bytecode (much closer to native assembly than something like .NET IL). They are then JIT compiled on your clients machine on first run by Innative, which the Asobo engine hooks to then add function pointers to native code for things like the gauges.h functions.
So you still compile your C++ through Visual Studio (2019), you just target a different platform. Note that this is currently a single threaded (threads are coming soon) 32-bit environment. You can still use SimConnect.h and Gauges.h which have been ported to work under Wasm, as well as the new MSFS*.h files. There is no concept of "Windows" or Windows.h here, which will probably catch many C++ programmers who are not used to doing cross-platform work by surprise. Atomics are now also working, so most things without explicit threading will build with few changes.
Static libs are now supported and you can pretty easily build things from source for them, such as Boost. Remember - no dlls, no .libs, you need to rebuild from source any 3rd-party dependencies to .a libraries. The debugger is not as good as you are probably used to due to the Wasm linear memory model but is being worked on now.
Note that this is all sandboxed (go read up on WASI for the motivations), meaning if MSFS doesn't give you an API, you can't do it. You can't access arbitrary file locations on the host (you do get access to a folder local to your package for saving / reading data), you can't do things like Windows Registry, and can't do web requests yet. This is a restrictive environment but intentionally designed to make it very easy to repackage and publish your app on many different platforms, and MSFS has many cross-platform ambitions.
There is much to still be worked out in this system, but it is certainly an app platform for the future. For a taste of how powerful Webassembly can be, check out https://lightroom.adobe.com. Yes, we run a massive C++ codebase in your browser.
There is also a new javascript based gauge system that I will describe in further detail below.
5. What APIs do we get?
The sim comes from FSX, so SimConnect is still the standard API. In fact it's the same on-the-wire protocol version. Do note that the TCP implementation on localhost is deprecated for named pipes. For out of process you can either use the new native DLL (like FSUIPC has been doing) or there may be a static lib coming soon. There is also an out of proc .Net client dll that ships with the SDK. For in-process you are required to use Wasm modules and the native SimConnect client.
Also note that it's roughly the same API footprint as FSX. There are some Key Events and Simvars that have changed and are not documented or hooked up through SimConnect yet, this will evolve. Things that were added over the years to SimConnect in P3D are not there and may catch you by surprise, and obviously there is no PDK-style interface. There are also some SimConnect functions (like some around weather and AI) that are either not yet hooked up or have behavioral changes or regressions. Asobo is working heavily on stabilizing the SimConnect API, and then will be expanding it as well.
There is a new gauges system as well that I will describe in the html post.
Ok that's the start, more to come.
Last edited: