Developing own WASM module + SimConnect client - all kinds of questions

Ok, so here’s how to create a proper MSFS project that’ll get your WASM file reloading without restarting the sim, and so you can use the real MSFS tools to create your final package (rather than the MSFSLayoutGenerator tool)…

Inside MSFS, click [DevMode]->New project
image

You should see a ‘Create new project’ dialog:

image

When you eventually click ‘Create new project’ on this new dialog, MSFS is going to create a folder - named after the ‘Project Name’ field, in the ‘Projects Folder’ location. The Project Name is just a build-time thing and isn’t visible to end users. In the screenshot I show the settings I’ve used here for my tool.

After clicking ‘Create new project’ you may be prompted with a dialog asking for creator and company name. Or you may not.

Then you’ll see a ‘Wizard selection’ dialog. You’re not creating an Airport or a Visual effect, so select ‘Custom’:
image

The UI will expand to allow you to type in a Display title and a Package name.
image
The Display title is the user-visible main name for your package (it’ll become the “title” in your manifest.json file).
The Package name is going to be the on-disk actual package directory name: all lower-case-with-dashes. (Note that it’ll silently add any “Default company name” setting as a prefix.)
Leave the Content-Type as ‘MISC’.
Click ‘Next’

Eventually you’re going to have two “asset groups” in your MSFS project. One is created automatically, called ‘ContentInfo’, which provides some basic package details such as a thumbnail. We’ll now add another asset group which actually deploys the WASM file.

image

Name your custom asset group ‘Module’ (or anything you like, but ‘Module’ is a reasonable name for the group deploying your .wasm file), and set the Asset type to ‘Copy’. (It’s literally going to copy your compiled WASM file to the output, and not do any processing on it.)
Click ‘Create’.

In the Project Editor, click View->Inspector and you’ll see all your Project details:

Since about November 2021 you now HAVE to put a thumbnail into your package
otherwise it won’t build. You need to create a JPEG file (not PNG) that’s 412x170.
Click on the ‘Content Manager Thumbnail’ block and give it the JPEG file. It’ll copy
that file into PackageDefinitions\package-name\ContentInfo\thumbnail.jpg.

That’s your ContentInfo asset group finished.

Down in the ‘Asset Groups’ section you’ll find the other “Module (Copy)” asset group that we created.
image
Click ‘Edit’. You’ll be taken to a dialog that allows you to control where you’re copying files from
(the AssetDir) and where you’re copying them to (the OutputDir).
By default the values are pretty nasty:

Change the OutputDir value to modules\ as that’s the directory you want your .wasm
file to end up in.
Set the AssetDir to wherever you build your .wasm file to. I keep things simple and arrange for my .wasm file to end up in PackageSources\modules\:

In Project Editor, save your Project.

Copy your .wasm file to your AssetDir (for me, PackageSources\modules).

Ensure you have the MSFS console open (Windows->Console) and click ‘Build All’ in Project Editor. MSFS will freeze up for around 15 seconds, you should see a whole load of entries in the console and it should load your WASM file and start emitting any debug output to the MSFS console.

To reload your .wasm file, rebuild it, copy it to the AssetDir, hit ‘Build All’ and you’re done. It’ll unload the old copy and load the new.

I’ve automated that copying by adding a custom ‘Post Build Event’ to my C++ module compilation settings:

So, the round trip for me is:

  1. Do a build in VS
  2. Click ‘Build All’ in MSFS

Armed with this MSFS project you can also build the actual final output package using the fspackagetool.exe from the MSFS SDK Tools folder. It takes a little while (I think it’s basically booting up MSFS in a command-line tool!) but it produces a perfect output package as defined by MSFS.

Hope that all helps? It’s been a useful reminder for me.

(In my case it was all broken because I’d hand-edited my main project .xml file to change the output folder from ‘Packages’ to ‘’. MSFS has been changed so it now wipes the output folder during a build… destroying all my input files.)

3 Likes