MODEL BEHAVIORS
A major part of setting up any SimObject within Microsoft Flight Simulator 2024 is controlling the way the different components of the model will behave under specific circumstances. This is made possible by using components within the <CompileBehaviors>
element of the [model].xml
and you can control these components in one of two ways:
- Using Simulation Variables (SimVars)
- Using code (RPN - Reverse Polish Notation)
In general you would create a series of components that use one of the above methods to get information that will then influence the behavior of the model in the simulation, and each component would be assigned to a specific node and/or animation.
Another feature of model behaviors is that you can use templates that have been pre-created for you or that you have created yourself. This system means that you can call templates with default values for things like landing gear, switches, etc... You can then override any (or all) of the default values when required for any particular model, saving you time having to re-create the same section of XML multiple times for different projects.
IMPORTANT: Incorrectly using the template system may mean you overwrite default Microsoft Flight Simulator 2024 templates, due to the way The Virtual File System works. This will impact all Sim Objects using that template, so extreme care should be taken when creating/editing templates. We recommend that instead of overwriting the default templates, you instead COPY the ones you want to modify and give them a new name, instead of editing either the base files or overriding them in your package using the same template names.
Below you can find in-depth information about the different XML elements used for creating components and templates as well as how to use them:
- General Template XML Properties
- Program Template XML Properties
- Update Frequency Preset XML Properties
- Input Event XML Properties
- Important Templates
There are also some simple tutorial pages that explain the template system and how to use it in a bit more detail:
- Using Model Behaviors
- Model Behaviors Component Overview
- Model Behaviors Parameters
- Model Behaviors Inputs
- Templates
- Default Templates
- Custom Templates
- Debugging Model Behaviors
You can find all the available pre-created templates from the following SDK folder:
C:\MSFS 2024 SDK\ModelBehaviorDefs\Asobo_EX1
NOTE: All the core behaviour files for Microsoft Flight Simulator 2024 are in the Asobo_EX1
folder. The core files for Microsoft Flight Simulator 2020 are in the Asobo
folder. You should not mix and match templates from both folders. They may work together, but future updates may break this and in general all aircraft for MSFS 2024 should use the Asobo_EX1
templates.
The documentation also has an interactive Template Explorer which can be accessed here:
Including Template Files
When using the templates included with the SDK there are some things to note:
- You should be using the
ModelBehaviorFile
attribute of the<Include>
element to include the file in the definitions. This will automatically resolve to the default SDK install location, eg:<Include ModelBehaviorFile="Asobo_EX1\Common\Exterior\Templates\SubTemplates\Landing_SubTemplates.xml" />
- If you are not using compiled behaviors (see
<CompileBehaviors>
for more information), then once the package is built theModelBehaviorFile
path will instead resolve to the streamed templates folder within the simulation packages. - If you are using compiled behaviors, the necessary templates will be compiled into the package and the
ModelBehaviorFile
path will resolve to use them.
Using Input Events
Finally, model behaviors are also used to define Input Events. These are events that are triggered by some interaction between the user and an aircraft cockpit control, like a lever or a button. The input events are used to change or set a value corresponding to the control being used, using the SimVar associated with the control and RPN to modify the value. The XML contents for these events are described in full in the following section:
There is also a tutorial on creating Input Event interactions here:
It is worth noting that the Input Events can also be used to intercept and override some of the general simulation key events, by binding Event IDs to an input event <Preset>
. This is explained in the following section: